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
Tried to look for solutions but I don't seem to have found any, so I'm opening a new issue:
I have a django project which uses a gcp bucket for images upload. Locally it works fine, but when deployed on GCP App Engine and I try to upload an image I get this exception
[Errno30] Read-onlyfilesystem: '/workspace/media'
I am confident my env vars are correct and the django-storages library gets set up correctly at startup, but I really can't understand why the backend is trying to access the local filesystem instead of uploading the image. The bucket setup code is below:
ifenv("USE_BUCKET_AS_MEDIA_FOLDER"):
# Set "media" folderDEFAULT_FILE_STORAGE="myproject.gcsutils.Media"GS_BUCKET_NAME=env("MEDIA_FOLDER_BUCKET_NAME")
# Add an unique ID to a file name if same file name existsGS_FILE_OVERWRITE=FalseGCP_CREDENTIALS=env("GCP_CREDENTIALS")
GS_CREDENTIALS=service_account.Credentials.from_service_account_info(
json.loads(GCP_CREDENTIALS)
)
And here are the contents of myproject.gcsutils.py
A SpooledTemporaryFile is used as the backing storage which will rollover to disk at a configurable amount. However, the default is to not rollover at all. You haven't set that GS_MAX_MEMORY_SIZE setting, have you?
Tried to look for solutions but I don't seem to have found any, so I'm opening a new issue:
I have a django project which uses a gcp bucket for images upload. Locally it works fine, but when deployed on GCP App Engine and I try to upload an image I get this exception
I am confident my env vars are correct and the
django-storages
library gets set up correctly at startup, but I really can't understand why the backend is trying to access the local filesystem instead of uploading the image. The bucket setup code is below:And here are the contents of
myproject.gcsutils.py
Happy to add any useful details, any help would be very appreciated
The text was updated successfully, but these errors were encountered: