question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing PRIVATE_STORAGE_S3_REVERSE_PROXY = True. It saves the files properly on S3, yet, when retrieving the file, when it tries to access the django sever view, it gives 404. Do I have to configure a reverse proxy with apache/nginx/caddy or the django server view actually fetches the object from S3 and proxies to the client?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lorinkozcommented, Feb 15, 2019

Possible problem: In django, I am hosting the reverse proxy on the url /file/... In the S3 bucket, the file folder does not exist.

Assuming private_file is an instance of a FieldFile returned by accessing a private file, if I do:

private_file.storage.exists(private_file.path) it raises SuspiciousOperation, as path is prefixed with /file. Then, if I manually remove the /file part, the storage returns True. As I said before, I can private_file.read() and private_file.size without any problem.

1reaction
vdboorcommented, Feb 9, 2019

Hi, the while point of the PRIVATE_STORAGE_S3_REVERSE_PROXY is to let Django retrieve the file, and serve it. Thus, Django becomes a proxy for the S3 file. I can’t really diagnose what’s happening here. Maybe some bucket policy prevents the file from being downloaded? For some reason Django doesn’t seem to be able to fetch the file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Important Issues with AWS S3 and How to Fix Them
5 Important Issues with AWS S3 and How to Fix Them · Issue #1: Space in AWS S3 Keys · Issue #2: Unable...
Read more >
Common Problems with Amazon S3 - Zapier Help
I want to add files to a folder. In Amazon S3, folders are designated by the key name. · Some of my Buckets...
Read more >
Troubleshooting Amazon S3 by Symptom - AWS Documentation
The following topics list symptoms to help you troubleshoot some of the issues that you might encounter when working with Amazon S3.
Read more >
7 Ways AWS Can Fix Its Public S3 Bucket Problem - Matt Fuller
1. Decouple public access from buckets entirely. · 2. Merge ACLs and bucket policies · 3. Make public bucket access a CLI-only setting...
Read more >
Troubleshoot Amazon S3 content loading issue - AWS re:Post
If another AWS account uploads an object to your bucket, then you won't own the object by default. As a result, you might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found