Not able to download snap at required revision to build image

Hi, I have a brand store account. I download the snap at the revisions i want using command :

snapcraft export-login --acls package_access store.auth

UBUNTU_STORE_ID=** UBUNTU_STORE_AUTH_DATA_FILENAME=store.auth snap download --revision=30

But this command suddenly started giving error saying "error: cannot decode auth file “./store.auth”: invalid character ‘e’ looking for beginning of value "

Did the method to download snap change in the recent snapcraft update? Is this a bug ?

Hello,

This might be an incompatibility between the version of snapcraft you used to generate your credentials file and the format supported by snapd (and snap command). Please ensure you are using snapcraft 6.x or older to generate the credential file; specifically unless something has changed while I wasn’t looking, the authentication file produced by snapcraft 7 and newer is incompatible with what snapd/snap expect.

  • Daniel

HI,

i am using

snapcraft 7.0.8 7779 latest/stable canonical✓ classic

snapd 2.56 16010 latest/stable canonical✓ snapd

are these 2 snaps incompatible with each other?

Also, i am creating the store.auth with the snapcraft 7.x version.

Yes, as I said, you need to use snapcraft 6.x; credentials generated with snapcraft 7.x will not work with snap download.

i tried going to snapcraft version 6.x but after that i am not able to use any snapcraft commands.

I am getting "Cannot parse config: File contains no section headers. file: ‘’, line: 1 {“r”: , “d”: } "

i cant login or run any snapcraft command

I figured out the issue. I have to remove the snapcraft.cfg file file from the folder ~/.config/snapcraft. Then everything worked