note to self: SRU ok for release ** Description changed:
[SRU] 2.72: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/2124239 [ Impact ] - Currently using snap packthe network-bind requirement applies for classic snaps as well. Example: + Currently using snap pack the network-bind requirement applies for classic snaps as well. Example: ``` Cannot pack snap: error: cannot validate snap "snap-name": invalid definition of application "snap-name": "network-bind" interface plug is required when sockets are used Detailed information: Command '['snap', 'pack', '--check-skeleton', PosixPath('/root/prime')]' returned non-zero exit status 1. ``` [ Test Plan ] 1. Reproduce with snapd snap < 2.72 - Pack classic snap without network-bind plug specified - Expect: ``` Cannot pack snap: error: cannot validate snap "snap-name": invalid definition of application "snap-name": "network-bind" interface plug is required when sockets are used... ``` 2. Prove fixed with snapd snap 2.72 - Pack classic snap without network-bind plug specified - Expect: No error This is covered by snapd spread test: tests/main/services-socket- activation/task.yaml ---original--- ### Bug Description It's not possible to publish a `classic` snap that has a daemon with a managed unix socket, something like this: ``` myd: environment: command: commands/run_daemon daemon: notify restart-condition: on-failure sockets: unix: listen-stream: $SNAP_COMMON/myd/myd.socket socket-mode: 0666 plugs: - network-bind ``` due to the difference between snapcraft (aka `snap pack` from snapd in this case) validation rules and the store's validation rules. The former will respond with: ``` Cannot pack snap: error: cannot validate snap "snap-name": invalid definition of application "snap-name": "network-bind" interface plug is required when sockets are used Detailed information: Command '['snap', 'pack', '--check-skeleton', PosixPath('/root/prime')]' returned non-zero exit status 1. ``` If the plug is removed then, then the snap will be packed but the Store will complain on upload: ``` - confinement 'classic' not allowed with plugs/slots ``` See also https://github.com/canonical/snapd/blob/846d56dff4ac86e820d20ad5157f522de4df6db6/snap/validate.go#L917 ### Environment - Ubuntu 24.04 LTS ### snapcraft.yaml ```yaml myd: environment: command: commands/run_daemon daemon: notify restart-condition: on-failure sockets: unix: listen-stream: $SNAP_COMMON/myd/myd.socket socket-mode: 0666 plugs: - network-bind ``` -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2117121 Title: `snap pack` and Snap Store validation rules mismatch for classic snaps To manage notifications about this bug go to: https://bugs.launchpad.net/snapd/+bug/2117121/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
