Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error testing files with v6.1.0 #41

Open
asaunier opened this issue Oct 4, 2017 · 1 comment
Open

Error testing files with v6.1.0 #41

asaunier opened this issue Oct 4, 2017 · 1 comment

Comments

@asaunier
Copy link
Member

asaunier commented Oct 4, 2017

We recently pushed release v6.1.0 to camptocamp.org prod but we have observed errors when "publishing" images: uploading and thumbnails creating work but the photo backend returns a 500 error when moving files from "incoming" to "active".

The logs say:

ERROR c2cwsgiutils.errors POST http://haproxy.exoscale.infra.camptocamp.org:8081/publish returned status code 500: An error occurred (403) when calling the HeadObject operation: Forbidden
images_1    |   File "/app/c2corg_images/views.py", line 114, in publish
images_1    |     already_published = active_storage.exists(filename)
images_1    |   File "/app/c2corg_images/storage.py", line 119, in exists
images_1    |     raise e
images_1    |   File "/app/c2corg_images/storage.py", line 101, in exists
images_1    |     object.load()

See
https://github.com/c2corg/v6_images/blob/master/c2corg_images/views.py#L114
https://github.com/c2corg/v6_images/blob/master/c2corg_images/storage.py#L101

A hint found by @gberaudo: the file does not exist but the storage returns a 403 code instead of 404 as expected by https://github.com/c2corg/v6_images/blob/master/c2corg_images/storage.py#L116

It seems that S3 indeed returns 403 code when a file is missing.
The weird thing is that it worked on the demo site whose storage is also S3 (?).

@arnaud-morvan
Copy link
Member

The file storage return 403 instead of 404 for GET request, nothing to do with HeadObject operation.
I've tested locally and the HeadObject operation return 404. Note that this is tested locally, but skipped on travis.

lbesson pushed a commit that referenced this issue Jan 14, 2021
[requires.io] dependency update on master branch
@lbesson lbesson closed this as completed Oct 14, 2022
@brunobesson brunobesson reopened this Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants