Access by specifying a revision is not allowed for this Snap

I see some similar posts from years ago, but creating a new thread as this has occurred recently.

I am the owner of mir-kiosk-kodi:

$ snap info mir-kiosk-kodi | grep publisher
publisher: Alan Griffiths (alangriffiths)
$ snap whoami
e-mail: alan.griffiths@canonical.com

And so I expected this to work:

$ snap download --revision=307 mir-kiosk-kodi
Fetching snap "mir-kiosk-kodi"
error: cannot download snap "mir-kiosk-kodi": Access by specifying a revision is not allowed for this Snap.

Am I missing something?

Same for me.

$ snap download learnit --revision=27 Fetching snap "learnit" error: cannot download snap "learnit": Access by specifying a revision is not allowed for this Snap.

But I can download a revision if I use an exported auth file:

$ snapcraft export-login --acls package_access creds

[ . . . ]

$ UBUNTU_STORE_AUTH_DATA_FILENAME=./creds snap download learnit --revision=27

Fetching snap "learnit" Fetching assertions for "learnit" Install the snap with: snap ack learnit_27.assert snap install learnit_27.snap

1 Like

snap download does not go through snapd and so has no knowledge of your credentials. This is why a credential file needs to be used, as Kyle described. More here : Improvements in snap download

I can only wish the need for export-login/ UBUNTU_STORE_AUTH_DATA_FILENAME was a bit easier to discover.

Thanks!

I totally agree. I have to explain it to someone new about once a week :slight_smile:

Actually - I wonder if you checked some documentation while trying to figure this out and could point me to what you checked, so I have an idea of where to document this. I’d settle for a good place to put a note about this, that’s not a forum thread buried somewhere and that basically only 5 people know about.

  • Daniel

My first stop was:

$ snap download --help
Usage:
  snap download [download-OPTIONS] <snap>

The download command downloads the given snap and its supporting assertions
to the current directory with .snap and .assert file extensions, respectively.

[download command options]
      --channel=            Use this channel instead of stable
      --edge                Install from the edge channel
      --beta                Install from the beta channel
      --candidate           Install from the candidate channel
      --stable              Install from the stable channel
      --revision=           Download the given revision of a snap, to which you must have developer access
      --basename=           Use this basename for the snap and assertion files (defaults to <snap>_<revision>)
      --target-directory=   Download to this directory (defaults to the current directory)
      --cohort=             Download from the given cohort

[download command arguments]
  <snap>:                   Snap name

And then I googled the error “Access by specifying a revision is not allowed for this Snap”. I saw several old (over 3 years) threads, but the comments left me with the impression that they were historic issues. I don’t remember seeing the above solution in any of them.