snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

docs: "snapcraft pack" did not work

Open markylaing opened this issue 3 weeks ago • 4 comments

Please describe the question or issue you're facing with "Craft a snap - Snapcraft 8.13.2 documentation".

Running the tutorial in a fresh LXD ubuntu:24.04 VM got me:

root@v1:~/ukuzama-pyfiglet# snapcraft pack
Bad snapcraft.yaml content:
- field 'confinement' required in top-level configuration

Reported from: https://documentation.ubuntu.com/snapcraft/stable/tutorials/craft-a-snap/

markylaing avatar Dec 02 '25 10:12 markylaing

It looks like you may have replaced the top two stanzas rather than just the first one. The output from snapcraft init includes this second stanza that contains the confinement field:

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

Leaving this open for our technical authors to determine whether they can improve the doc to make that clearer.

lengau avatar Dec 02 '25 18:12 lengau

Ah yes I've just tried again and that is my mistake.

I often find what helps is a "this is what your should look like before you run <command X>"

markylaing avatar Dec 02 '25 18:12 markylaing

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/SNAPCRAFT-1260.

This message was autogenerated

@markylaing Thanks for reporting this! We'll take another look at the flow of the tutorial and try and steer people away from making this mistake.

medubelko avatar Dec 02 '25 22:12 medubelko