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

404 error with attached pictures on various streetcomplete notes #6041

Closed
qugebert opened this issue Dec 11, 2024 · 12 comments
Closed

404 error with attached pictures on various streetcomplete notes #6041

qugebert opened this issue Dec 11, 2024 · 12 comments
Assignees
Labels

Comments

@qugebert
Copy link
Contributor

Hi,

I'm not sure where to report this, but I'm getting 404 errors on various images attached to (still open) notes with streetcomplete.
So far I have not been able to recognize any real pattern, sometimes it concerns pictures with low numbers and sometimes more recent ones

A few open example notes:
https://www.openstreetmap.org/note/4325307 -> https://streetcomplete.app/p/223229.jpg
https://www.openstreetmap.org/note/4027127 -> https://streetcomplete.app/p/189098.jpg
https://www.openstreetmap.org/note/4362583 -> https://streetcomplete.app/p/229342.jpg
https://www.openstreetmap.org/note/4401974 -> https://streetcomplete.app/p/235524.jpg
https://www.openstreetmap.org/note/4508499 -> https://streetcomplete.app/p/249845.jpg

How to Reproduce

Expected Behavior

Versions affected

@qugebert qugebert added the bug label Dec 11, 2024
@matkoniecz
Copy link
Member

For possible nonbuggy reasons: Maybe it was closed & reopened by now deleted account?

@map-per
Copy link

map-per commented Dec 11, 2024

A two more examples from Munich:

It looks like only newer Notes are affected, the images of older nodes still work fine.

@Bormoglot
Copy link

@Jean-BaptisteC
Copy link
Contributor

Jean-BaptisteC commented Dec 11, 2024

I think it's caused by server migration
Now photos are stocked on streetcomplete.app server and before they was stocked on wesdornost.de server

@matkoniecz
Copy link
Member

Actually it looks like all images are broken. See say https://www.openstreetmap.org/note/3551383

Maybe redirect was disabled/redone to handle #6040 what broke redirects elsewhere?

@mnalis
Copy link
Member

mnalis commented Dec 11, 2024

I've also seen that on one note today: https://www.openstreetmap.org/note/3631178 linking to https://westnordost.de/p/140720.jpg, which is being redirected to https://streetcomplete.app/p/140720.jpg which returns 404 Not found.

Actually it looks like all images are broken

well, some (even majority?) still seem to work for me, e.g. all three pictures linked in https://www.openstreetmap.org/note/4156505 redirect to e.g. https://streetcomplete.app/p/202009.jpg and seem to work fine 🤷‍♂️


Hopefully @westnordost just made that redirect (ref. cc2b690) before all the pictures have finished copying to new location, and there will be less and less errors with time as the copying nears finish. Otherwise something has broken in the process.

@westnordost
Copy link
Member

westnordost commented Dec 11, 2024

I didn't copy any pictures, I just moved the directory from one location to another on the same webspace. The operation completed basically immediately.

I will have a look.

@westnordost
Copy link
Member

So for some reason the photo-cleanup job that runs every night at 2:20 UTC deletes loads of pictures because it thinks the notes have been closed or deleted. Still investigating...

@westnordost westnordost self-assigned this Dec 11, 2024
@westnordost
Copy link
Member

I've deactivated the cleanup job and have a backup from the evening before I fiddled around with my webspace, so I should be able to restore (almost) everything as soon as I've found the cause.

@westnordost
Copy link
Member

westnordost commented Dec 12, 2024

The error was that the cleaner looked for links to photos in notes now only under the new URL https://streetcomplete.app/p/...

Since all the existing notes link to photos via https://westnordost.de/p/... , those notes were thought to not contain any links to photos anymore and thus the photos were deleted. The only reason why not all photos have been deleted yet (about 17% were deleted) is because the cleanup job only runs for a little while and postpones work to the next day after some minutes.

This is fixed now by introducing an option to specify several urls so that the old URL is recognized, too: streetcomplete/sc-photo-service@32cb1ff

@westnordost
Copy link
Member

westnordost commented Dec 12, 2024

The photos are now restored from backup.

Note: The backup was from the night before I changed the configuration to point to streetcomplete.app. So, photos uploaded on the 8th of December that were deleted by the cleanup job are lost.

@westnordost
Copy link
Member

Anyway, thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants