dashboard.snapcraft.io image collision

Bug #1939718 reported by Francisco Jimenez Cabrera
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Expired
Low
Unassigned

Bug Description

Hi,

Could you investigate an issue with the following image?

https://dashboard.snapcraft.io/site_media/appmedia/2021/08/logo.png

Apparently, it contained a completely different image at some point, we can still see the previous one because Cloudinary:
https://res.cloudinary.com/canonical/image/fetch/f_auto,q_auto,fl_sanitize,w_60,h_60/https://dashboard.snapcraft.io/site_media/appmedia/2021/08/logo.png

How is it possible that someone is reporting their snap to have a completely different image?

I tried to upload images with the same for different snaps but I couldn't reproduce this issue.

For more info please take a look into the issue reported on the snapcraft.io repo:

https://github.com/canonical-web-and-design/snapcraft.io/issues/3622

Thank you!

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

I'm unable to reproduce, but I suspect it's a race condition at django's storage layer.

When a file is uploaded, django's storage (django-storage-swift, in our case) takes a filename, checks if it already exists, and if so it appends and underscore and 7 random alphanumeric chars to it [0]. I think it's possible that if two identically named files (e.g. "logo.png") are uploaded at the same time, and if the storage layer (swift) is slow enough, the 2nd one might end up winning and overwriting the first one. The store could proactively "randomize" filenames to prevent this. But, we've only seen it happen once, and are unable reproduce, so this is not urgent imho.

Please let us know if you see this again.

[0] https://docs.djangoproject.com/en/2.2/howto/custom-file-storage/#django.core.files.storage.get_available_name

Changed in snapstore-server:
status: New → Triaged
importance: Undecided → Low
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snap Store Server because there has been no activity for 60 days.]

Changed in snapstore-server:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.