LXDAPIException: json: cannot unmarshal bool into Go value of type string when using config-drive

Bug #1691428 reported by James Page on 2017-05-17
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Undecided
Unassigned
Newton
Undecided
Unassigned
Ocata
Undecided
Unassigned
Pike
Undecided
Unassigned
nova-lxd
Undecided
Unassigned
nova-lxd (Ubuntu)
Undecided
Unassigned
Yakkety
Undecided
Unassigned
Zesty
Undecided
Unassigned
Artful
Undecided
Unassigned

Bug Description

[Impact]
Not possible to use the config-drive support (as currently in yakkety-proposed, zesty and artful)

[Test Case]
Deploy Nova-LXD based OpenStack Cloud
openstack server create --wait --image xenial --flavor m1.small --key-name testkey --nic net-id=XXXX --min 1 --max 1 --config-drive True xenial-config-drive
instance will go into ERROR state and fail to boot.

[Regression Potential]
Minimal; this feature has never worked correctly, the fix resolves and issue with passing the readonly flag for the config-drive device as a boolean rather than a string (as required by the LXD API).

[Original Bug Report]
When booting instances using the --config-drive flag, the instance fail to boot with the following error:

  LXDAPIException: json: cannot unmarshal bool into Go value of type string

nova-lxd is passing the 'readonly' flag as a boolean, not as a string, and the LXD API fails to unmarshall it as a result.

James Page (james-page) on 2017-05-17
description: updated

Reviewed: https://review.openstack.org/465482
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=95e1db84bc7c9bb83ca3081d613b013427b7ed56
Submitter: Jenkins
Branch: master

commit 95e1db84bc7c9bb83ca3081d613b013427b7ed56
Author: James Page <email address hidden>
Date: Wed May 17 10:43:40 2017 +0100

    Pass readonly flag as a string, not a boolean.

    The LXD API requires that data be passed as strings; pass the
    readonly flag for config-drive support as a string to ensure
    it can be parsed by LXD avoiding the following error:

      json: cannot unmarshal bool into Go value of type string

    Change-Id: I0c5dbd9cb8b8ea4f43398849f8b4c33305231d54
    Closes-Bug: 1691428

Changed in nova-lxd:
status: New → Fix Released

Reviewed: https://review.openstack.org/465483
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=d7b8e7013be4208c699ecde4224f03bc31d56cf8
Submitter: Jenkins
Branch: stable/ocata

commit d7b8e7013be4208c699ecde4224f03bc31d56cf8
Author: James Page <email address hidden>
Date: Wed May 17 10:43:40 2017 +0100

    Pass readonly flag as a string, not a boolean.

    The LXD API requires that data be passed as strings; pass the
    readonly flag for config-drive support as a string to ensure
    it can be parsed by LXD avoiding the following error:

      json: cannot unmarshal bool into Go value of type string

    Change-Id: I0c5dbd9cb8b8ea4f43398849f8b4c33305231d54
    Closes-Bug: 1691428
    (cherry picked from commit 73e33e6ebd1b0ecee76b29835274406ac2a00bd4)

Reviewed: https://review.openstack.org/465485
Committed: https://git.openstack.org/cgit/openstack/nova-lxd/commit/?id=39c807b9b3d434c0f2552d3552aea7b236ab12e5
Submitter: Jenkins
Branch: stable/newton

commit 39c807b9b3d434c0f2552d3552aea7b236ab12e5
Author: James Page <email address hidden>
Date: Wed May 17 10:43:40 2017 +0100

    Pass readonly flag as a string, not a boolean.

    The LXD API requires that data be passed as strings; pass the
    readonly flag for config-drive support as a string to ensure
    it can be parsed by LXD avoiding the following error:

      json: cannot unmarshal bool into Go value of type string

    Change-Id: I0c5dbd9cb8b8ea4f43398849f8b4c33305231d54
    Closes-Bug: 1691428
    (cherry picked from commit 95e1db84bc7c9bb83ca3081d613b013427b7ed56)

Hello James, or anyone else affected,

Accepted nova-lxd into pike-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:pike-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-pike-needed to verification-pike-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-pike-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-pike-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nova-lxd - 16.0.0~b1-0ubuntu2

---------------
nova-lxd (16.0.0~b1-0ubuntu2) artful; urgency=medium

  * d/p/bug1691428-pike.patch: Cherry pick fix to ensure that readonly
    flag for config-drive device is correctly passed to LXD
    (LP: #1691428).

 -- James Page <email address hidden> Wed, 17 May 2017 11:07:27 +0100

Changed in nova-lxd (Ubuntu Artful):
status: New → Fix Released
Brian Murray (brian-murray) wrote :

Hello James, or anyone else affected,

Accepted nova-lxd into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nova-lxd/15.0.1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in nova-lxd (Ubuntu Zesty):
status: New → Fix Committed
tags: added: verification-needed
Changed in nova-lxd (Ubuntu Yakkety):
status: New → Fix Committed
Brian Murray (brian-murray) wrote :

Hello James, or anyone else affected,

Accepted nova-lxd into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nova-lxd/14.2.2-0ubuntu0.16.10.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

James Page (james-page) wrote :

Hello James, or anyone else affected,

Accepted nova-lxd into newton-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:newton-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-newton-needed to verification-newton-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-newton-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-pike-needed
tags: added: verification-newton-needed
James Page (james-page) wrote :

Hello James, or anyone else affected,

Accepted nova-lxd into ocata-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:ocata-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-ocata-needed to verification-ocata-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-ocata-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-ocata-needed
James Page (james-page) wrote :

Deployed and verified ability to launch config-drive enabled instances under xenial-newton/proposed - package version:

# apt-cache policy nova-compute-lxd
nova-compute-lxd:
  Installed: 14.2.2-0ubuntu0.16.10.2~cloud0
  Candidate: 14.2.2-0ubuntu0.16.10.2~cloud0
  Version table:
 *** 14.2.2-0ubuntu0.16.10.2~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-proposed/newton/main amd64 Packages
        100 /var/lib/dpkg/status
     13.3.0-0ubuntu1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     13.2.0-0ubuntu1.16.04.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     13.0.0-0ubuntu3 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

tags: added: verification-newton-done
removed: verification-newton-needed
James Page (james-page) wrote :

Deployed and verified ability to launch config-drive enabled instances under zesty proposed - package version '15.0.1-0ubuntu1.1':

# apt-cache policy nova-compute-lxd
nova-compute-lxd:
  Installed: 15.0.1-0ubuntu1.1
  Candidate: 15.0.2.dev1.201705231139.zesty-0ubuntu1
  Version table:
     15.0.2.dev1.201705231139.zesty-0ubuntu1 500
        500 http://ppa.launchpad.net/openstack-ubuntu-testing/ocata/ubuntu zesty/main amd64 Packages
 *** 15.0.1-0ubuntu1.1 500
        500 http://archive.ubuntu.com/ubuntu zesty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     15.0.1-0ubuntu1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu zesty/main amd64 Packages

tags: added: verfication-done
removed: verification-needed verification-newton-done verification-ocata-needed
tags: added: verification-done
removed: verfication-done
James Page (james-page) wrote :

yakkety-proposed:

Re-tested with the fixes under bug 1673411; config drive presented correctly and as a read-only share between host and LXD container.

tags: added: verification-newton-done verification-ocata-needed
James Page (james-page) wrote :

xenial-ocata proposed:

$ apt-cache policy nova-compute-lxd
nova-compute-lxd:
  Installed: 15.0.1-0ubuntu1.1~cloud0
  Candidate: 15.0.1-0ubuntu1.1~cloud0
  Version table:
 *** 15.0.1-0ubuntu1.1~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-proposed/ocata/main amd64 Packages
        100 /var/lib/dpkg/status
     13.3.0-0ubuntu1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     13.2.0-0ubuntu1.16.04.1 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     13.0.0-0ubuntu3 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Booted instance with config-drive flag enabled; confirmed /config-drive presented and read-only

tags: added: verification-ocata-done
removed: verification-ocata-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nova-lxd - 14.2.2-0ubuntu0.16.10.2

---------------
nova-lxd (14.2.2-0ubuntu0.16.10.2) yakkety; urgency=medium

  * d/p/bug1691428-ocata.patch: Cherry pick fix to ensure that readonly
    flag for config-drive device is correctly passed to LXD
    (LP: #1691428).

nova-lxd (14.2.2-0ubuntu0.16.10.1) yakkety; urgency=medium

  * New upstream point release for Openstack Newton (LP: #1673411)

 -- James Page <email address hidden> Wed, 17 May 2017 11:12:17 +0100

Changed in nova-lxd (Ubuntu Yakkety):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for nova-lxd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nova-lxd - 15.0.1-0ubuntu1.1

---------------
nova-lxd (15.0.1-0ubuntu1.1) zesty; urgency=medium

  * d/p/bug1691428-ocata.patch: Cherry pick fix to ensure that readonly
    flag for config-drive device is correctly passed to LXD
    (LP: #1691428).

 -- James Page <email address hidden> Wed, 17 May 2017 11:09:51 +0100

Changed in nova-lxd (Ubuntu Zesty):
status: Fix Committed → Fix Released
James Page (james-page) wrote :

The verification of the Stable Release Update for nova-lxd has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

James Page (james-page) wrote :

This bug was fixed in the package nova-lxd - 14.2.2-0ubuntu0.16.10.2~cloud0
---------------

 nova-lxd (14.2.2-0ubuntu0.16.10.2~cloud0) xenial-newton; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 nova-lxd (14.2.2-0ubuntu0.16.10.2) yakkety; urgency=medium
 .
   * d/p/bug1691428-ocata.patch: Cherry pick fix to ensure that readonly
     flag for config-drive device is correctly passed to LXD
     (LP: #1691428).

James Page (james-page) wrote :

The verification of the Stable Release Update for nova-lxd has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

James Page (james-page) wrote :

This bug was fixed in the package nova-lxd - 15.0.1-0ubuntu1.1~cloud0
---------------

 nova-lxd (15.0.1-0ubuntu1.1~cloud0) xenial-ocata; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 nova-lxd (15.0.1-0ubuntu1.1) zesty; urgency=medium
 .
   * d/p/bug1691428-ocata.patch: Cherry pick fix to ensure that readonly
     flag for config-drive device is correctly passed to LXD
     (LP: #1691428).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers