You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/app'] There was an error parsing the body is too generic 400 status msg, wrong permissions to file system hide real problem
#11487
Problem was on my side with wrong configuration but fastapi in that case give only this error:
"There was an error parsing the body", the original error was "detail "[Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/app']"" but it was never revealed to me, I only discovered that after I created custom route and remove this exception.
I think we should at least log this exception as it can be many different reasons behind, an Error log would really help here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
My problem was related to this change of code
fastapi/fastapi/routing.py
Line 264 in 38929aa
I am using Kubernetes and I apply security context which enable readOnlyRootFilesystem
I think this caused https://docs.python.org/3/library/tempfile.html#module-tempfile to fail as it was trying to create temp file in directory where it doesn't have permissions.
Problem was on my side with wrong configuration but fastapi in that case give only this error:
"There was an error parsing the body", the original error was "detail "[Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/app']"" but it was never revealed to me, I only discovered that after I created custom route and remove this exception.
I think we should at least log this exception as it can be many different reasons behind, an Error log would really help here.
I haven;t found similar issue anywhere.
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.100
Pydantic Version
1.10.1
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions