Comment 3 for bug 1915202

Revision history for this message
Facundo Batista (facundo) wrote :

Jonathan (and see below 'both'):

I understand that two identical revisions are not allowed (for snaps and charms).

However, from the user POV, this is not the case! The first attempt fails, so I don't expect for the charm to be in Charmhub. But because of whatever reason I miss the real problem.

Then I try again (this time with --verbose, or not sending error to a file, or whatever), to see what is the problem, and the second response is telling me that the second upload fails because the charm is already in Charmhub?

So, the first attempt was a success and the charm is already up?

Daniel (and see below 'both'):

Process to make this happen... create a charm project with a bad metadata, build and upload:

:: charmcraft init
:: (edit metadata.yaml, fix its name for something you own, add a bad resources like...
::
:: resources:
:: foobar:
:: type: asdasd
:: ...)
:: charmcraft build
:: charmcraft upload -v --charm-file your-charm-file.charm
::
:: (that should give you the first error, and then...)
::
:: charmcraft upload -v --charm-file your-charm-file.charm
::
:: (this should give you the second error)

The rest of your comment is not of use here, as I'm not trying to upload a resource at all. Just trying to upload a charm which has a resource key in its metadata.

Both:

Note that if the charm has a wrong metadata because 'series' is missing, the first time it's uploaded the error will be that it's "missing series", and the second time! and the third time!

So, if the metadata is wrong *in that way*, it behaves correctly.

But if the metadata is wrong because an invalid resource key, Charmhub behaves wrongly.