-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0] fastapi error on request #414
Comments
I found that after this commit (OCA/OCB@6758fca) the error appears, so I take this commit (OCA/OCB@a859fd9) to fix it for now. |
Same error here FYI @lmignon |
I have run into the same issue today. There is a workaround (accessing the wrapped request) but it's not very nice. |
Short-term workaround for the problem described here: OCA#414
pfffff I hate odoo. |
Hello, I'm getting this error: During handling of the above exception, another exception occurred: Traceback (most recent call last): I tried the solution mentioned by @meestaben, but I still get the server error; nothing is in the log this time when a server error occurs. If I try to call some endpoint, it returns me an HTML website with this message: We couldn't find the page you're looking for!Don't panic. If you think it's our mistake, please send us a message on this page. `Everything worked fine on the last Thursday. This is the last revision when it worked: From this revision, it stopped working: Any help on how to solve this issue would be highly appreciated. |
However, I have to manage priorities on the project I'm currently working on. So I don't have time to look at it right now. The fix may be simple, but for that I need a bit of time. |
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
@florian-dacosta @Tscunami @hugomartineznetkia Can you test #416. This should fix the issue. |
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
Hello @lmignon , I wanted to confirm that the fix proposed in the pull request has been tested on my end, and it successfully resolves the issue with the Odoo module for version 16.0 latest on Odoo.sh. I have approved the changes in the pull request. Thank you for your prompt and effective solution to this issue. Best regards |
Thank you for the feedback @Tscunami |
Thank you @lmignon 👍 |
Hello @lmignon , I'm currently working on migrating from base_rest to fastapi and I realized about this issue. I've tried your fix and it worked for me. Thanks for the fix 🙌🏼 |
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
From odoo/odoo@cb1d057, the orignal werkzeug request is wrapped in a dedicated class to keep under control the attributes developers use. This change add code to make the fastapi addon working with version including this last change and prior version refs OCA#414
Module
fastapi
Describe the bug
Error on request:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 2044, in call
response = request._serve_db()
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1633, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1660, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/custom/src/rest-framework/fastapi/fastapi_dispatcher.py", line 22, in dispatch
environ = self._get_environ()
File "/opt/odoo/custom/src/rest-framework/fastapi/fastapi_dispatcher.py", line 46, in _get_environ
environ["wsgi.input"] = self.request.httprequest._get_stream_for_parsing()
AttributeError: 'HTTPRequest' object has no attribute '_get_stream_for_parsing'
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior:
1.Install fastapi
2.Configure any endpoint
3.Try to use the endpoint via request/swagger
Additional context
Debian
Doodba
Python 3.10
The text was updated successfully, but these errors were encountered: