Configure hook not running

Bug #1636931 reported by Kyle Fazzari
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
Unassigned

Bug Description

snapd includes a test snap within it for the configure hook, located in tests/lib/snaps/snapctl-hooks. This snap's configure hook works fine in the spread tests, but when used locally, results in the following:

    $ sudo snap set snapctl-hooks foo=bar
    error: cannot perform the following tasks:
    - Run configure hook for snapctl-hooks (cannot snap-exec: cannot find hook "configure" in "snapctl-hooks")

With the following system:

$ snap --version
snap 2.16ubuntu3
snapd 2.16ubuntu3
series 16
ubuntu 16.04

$ snap list
Name Version Rev Developer Notes
snapctl-hooks 1.0 x1 -
ubuntu-core 16.04.1 423 canonical -

I suspect this is simply due to the snap-exec being used by snapd being the one contained within the core snap, which may not know about the configure hook.

Kyle Fazzari (kyrofa)
description: updated
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Note that as of core snap revision 963 (on amd64) this works. This is only on the edge channel though, so I'll leave this bug open until it's reached stable.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

As of core snap revision 1111 (again, amd64) this is no longer working again.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

As far as snapd is concerned, this was never broken since it was originally created. The problem is always something out-of-date: snapd, snap-confine, or the ubuntu-core snap.

For the record, I just went through the process of installing snapd 2.20 from edge, and ubuntu-core from edge, and it all works fine:

[niemeyer@nomade ..s/snapctl-hooks]% snap --version
snap 2.20
snapd 2.20
series 16
ubuntu 16.04

[niemeyer@nomade ..s/snapctl-hooks]% dpkg -l snapd snap-confine
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
ii snap-confine 2.20 amd64 Support executable to apply confinement for snappy apps
ii snapd 2.20 amd64 Tool to interact with Ubuntu Core Snappy.

[niemeyer@nomade ..s/snapctl-hooks]% snap list ubuntu-core
Name Version Rev Developer Notes
ubuntu-core 16.04.1 1239 canonical -

Test snap:

[niemeyer@nomade ..s/snapctl-hooks]% sudo snap install ./snapctl-hooks_1.0_all.snap --dangerous
[sudo] password for niemeyer:
snapctl-hooks 1.0 installed

[niemeyer@nomade ..s/snapctl-hooks]% sudo snap set snapctl-hooks command=test-snapctl-set-foo

[niemeyer@nomade ..s/snapctl-hooks]% sudo snap get snapctl-hooks foo
bar

Different snap, created by snapcraft:

[niemeyer@nomade ..s/snapctl-hooks]% snap changes hello
ID Status Spawn Ready Summary
381 Done 2016-12-16T17:44:35Z 2016-12-16T17:44:36Z Install "hello" snap from file "./hello_1.0_amd64.snap"
382 Done 2016-12-16T17:45:11Z 2016-12-16T17:45:11Z Change configuration of "hello" snap

[niemeyer@nomade ..s/snapctl-hooks]% snap change 382
Status Spawn Ready Summary
Done 2016-12-16T17:45:11Z 2016-12-16T17:45:11Z Run configure hook of "hello" snap

Changed in snappy:
status: New → Incomplete
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

If there's no further evidence, let's close this bug once 2.20 goes into xenial-updates and the respective snaps get into stable.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

v2.20 isn't actually needed-- I think this can be closed as soon as the `ubuntu-core` snap in stable can actually run hooks.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

To clarify: This bug still effects fully up-to-date xenial installs with the stable ubuntu-core snap installed.

Changed in snappy:
status: Incomplete → New
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Note that it's actually even worse on an up-to-date xenial, since the configure hook is now run on install in v2.17:

$ sudo snap install --dangerous snapctl-hooks_1.0_all.snap
error: cannot perform the following tasks:
- Run configure hook of "snapctl-hooks" snap if present (cannot snap-exec: cannot find hook "configure" in "snapctl-hooks")

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Now that ubuntu-core has been updated (rev 1357 for amd64) hooks are working. Hooks now work with both core and ubuntu-core. As such, I think this bug can be marked Fixed Released.

Changed in snappy:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.