I'm using the dev_appserver.py
to test out my application (it's still far from being ready to deploy). My application allows users to upload files which is working fine. However, when I go to serve those files, I'm running into problems.
I'm serving them through my application rather than using the public URL because I need to restrict access to only authorized users. When I attempt to serve the file using CloudStorageTools::serve
, I get a 500 error. I've tried catching the error and have been unable to do so (I still get a 500 error even though it's wrapped in a try-catch block). The only indication I have as to what's going wrong is from the logs:
ERROR 2018-02-17 17:06:54,105 blob_download.py:202] Blob-serving response with status 404, expected 200.
Based on that it looks like it can't find the file but I can't figure out why. I can access the file just fine using file_get_contents
so I know it got uploaded correctly.
What's going wrong? Why is CloudStorageTools
unable to find the file?