Misleading error the second time an upload is tried
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
New
|
Undecided
|
Unassigned |
Bug Description
I tried to upload a charm with a problem, first time I got:
{'revisions': [{'errors': [{'code': 'review-error', 'message': "'stuff' is not one of ['file', 'oci-image'] at /resources/
That is fine.
I re-tried the upload without touching anything, and I got:
{'revisions': [{'errors': [{'code': 'review-error', 'message': "Cannot insert SHA3-384 '8b5968db2c63e5
That is misleading. Also, I'm pushing a charm, not a snap.
Thanks!
This is a longstanding constraint of snaprevs: It has never allowed a snap to upload two identical revisions. The same constraint applies to charms, even though this old error message mentions 'snap'.
This problem previously impacted the migration of charms from charmstore to charmhub. Many charms in charmstore do have some identical revisions. (Perhaps some publishers mistakenly thought they had to upload the same revision once for each supportedseries?) The migration currently skips all these clashing revisions but for the one with the highest revision number.
When this was first observed, discussion concluded that this doesn't matter much, it only affects older revisions, and we don't need to fix it for now, unless it proves to be a big problem.
I agree the error message ought to say "{package-type}" instead of "snap". But other than that, when you say 'misleading', what precisely did you mean? What is your expected behavior? A better error message (what?) or to accept the upload?