Google Clould Functions Deploy: Erofs: Read-only File System
Solution 1:
Everything in the Cloud Functions runtime is read-only except for os.tmpdir()
(which is likely going to be /tmp
, but you shouldn't assume that). If you have any code (in api/user.js
for example) that attempt to write anywhere else, it'll error.
Solution 2:
Same issue for python, above answer worked for me, but putting this for clarity. My error -
File "/env/local/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 753, in download_to_filename
withopen(filename, "wb") as file_obj:
OSError: [Errno 30] Read-only file system: 'testFile.zip'
Googles documentation can be found here.
While Cloud Storage is the recommended solution for reading and writing files in App Engine, if your app only needs to write temporary files, you can use standard Python 3.7 methods to write files to a directory named /tmp.
All files in this directory are stored in the instance's RAM, therefore writing to /tmp takes up system memory. In addition, files in the /tmp directory are only available to the app instance that created the files. When the instance is deleted, the temporary files are deleted.
Post a Comment for "Google Clould Functions Deploy: Erofs: Read-only File System"