dashboard.snapcraft.io image collision
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:/
Apparently, it contained a completely different image at some point, we can still see the previous one because Cloudinary:
https:/
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:/
Thank you!
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.djangopro ject.com/ en/2.2/ howto/custom- file-storage/ #django. core.files. storage. get_available_ name