Public bug reported:

Hi,
we created a new image for our ubuntu core enabled board.

We noticed that the prepare device hook script that worked fine until
core revision 3750, is now unable to perform the serial vault
registration (core revision 4409).

We noticed a bug apparmor-denied-in-prepare-device-hooks and modified
the snap.yaml accordingly

But we optain anyhow an error during the “Initialize device” step:
----------------------------------------------------------------------------------------------
domotz@localhost:~$ snap changes
ID   Status  Spawn                 Ready                 Summary
1    Done    2018-04-18T10:04:18Z  2018-04-18T10:07:19Z  Initialize system state
2    Error   2018-04-18T10:05:06Z  2018-04-18T10:06:04Z  Initialize device
----------------------------------------------------------------------------------------------

and:
----------------------------------------------------------------------------------------------
domotz@localhost:~$ snap change 2
Status  Spawn                 Ready                 Summary
Done    2018-04-18T10:05:06Z  2018-04-18T10:06:04Z  Run prepare-device hook
Done    2018-04-18T10:05:06Z  2018-04-18T10:06:02Z  Generate device key
Error   2018-04-18T10:05:06Z  2018-04-18T10:06:01Z  Request device serial

......................................................................
Request device serial

2018-04-18T10:06:01Z ERROR cannot deliver device serial request: unexpected 
status 400
----------------------------------------------------------------------------------------------


The prepare device hook script is:
----------------------------------------------------------------------------------------------
#!/bin/sh
set -x
exec >> "$SNAP_COMMON"/prepare-device-hook.log 2>&1
product_serial=$(grep Serial /proc/cpuinfo  | awk '{print $3}')
snapctl set device-service.url="https://serial-vault-partners.canonical.com/v1/";
snapctl set device-service.headers='{"api-key": "secret_api_key", 
"X-Use-Proposed": "yes"}'
snapctl set registration.proposed-serial="\"${product_serial}\""
----------------------------------------------------------------------------------------------

Thanks,

Francesco

** Affects: snapd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1765315

Title:
  snapd unexpected status error during prepare-device hook

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1765315/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to