pylxd cannot start containers with LXD 2.0.11

Bug #1736454 reported by Colin Watson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
Undecided
Unassigned
Newton
Fix Released
Critical
James Page
Ocata
Fix Released
Critical
James Page
python-pylxd (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Critical
Colin Watson

Bug Description

The LXD 2.0.11 SRU in xenial broke pylxd and hence broke Launchpad builds, as visible here:

  https://launchpadlibrarian.net/348160479/buildlog_snap_ubuntu_xenial_arm64_core_BUILDING.txt.gz

  /usr/lib/python2.7/dist-packages/pylxd/model.py:113: UserWarning: Attempted to set unknown attribute "used_by" on instance of "Profile"
    key, self.__class__.__name__
  /usr/lib/python2.7/dist-packages/pylxd/model.py:113: UserWarning: Attempted to set unknown attribute "description" on instance of "Container"
    key, self.__class__.__name__
  Traceback (most recent call last):
    File "/usr/share/launchpad-buildd/slavebin/in-target", line 27, in <module>
      sys.exit(main())
    File "/usr/share/launchpad-buildd/slavebin/in-target", line 23, in main
      return args.operation.run()
    File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lifecycle.py", line 40, in run
      self.backend.start()
    File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 380, in start
      container.start(wait=True)
    File "/usr/lib/python2.7/dist-packages/pylxd/container.py", line 163, in start
      wait=wait)
    File "/usr/lib/python2.7/dist-packages/pylxd/container.py", line 151, in _set_state
      self.sync()
    File "/usr/lib/python2.7/dist-packages/pylxd/model.py", line 154, in sync
      setattr(self, key, val)
    File "/usr/lib/python2.7/dist-packages/pylxd/model.py", line 135, in __setattr__
      return super(Model, self).__setattr__(name, value)
  AttributeError: 'Container' object has no attribute 'description'

I initially thought this would require reverting LXD, but on inspection it's just adding some new attributes and it's really not its fault that pylxd is unnecessarily strict. This was fixed in pylxd upstream a while ago (https://github.com/lxc/pylxd/pull/234), and the fix is in 2.2.4 so >=artful is already fixed. zesty in principle requires the fix but I can't actually reproduce the bug there, so it's probably best to leave it alone for the time being. However, xenial's pylxd is currently broken.

[Test Case]

  >>> from pylxd import Client
  >>> client = Client()
  >>> container = client.containers.create({"name": "test", "architecture": "x86_64", "profiles": ["default"], "source": {"type": "image", "mode": "pull", "server": "https://cloud-images.ubuntu.com/releases", "protocol": "simplestreams", "alias": "xenial"}}, wait=True)
  >>> container.start(wait=True) # should produce no exceptions

[Regression Potential]

The fix is to the code that marshals objects between the LXD server and the Python client code, so anything around there could in principle go wrong. I think running launchpad-buildd against it ought to exercise it fairly well.

Colin Watson (cjwatson)
Changed in python-pylxd (Ubuntu):
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Colin Watson (cjwatson) wrote :
description: updated
Changed in python-pylxd (Ubuntu Xenial):
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Colin Watson (cjwatson)
Changed in python-pylxd (Ubuntu):
status: In Progress → Fix Released
importance: Critical → Undecided
assignee: Colin Watson (cjwatson) → nobody
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Colin, or anyone else affected,

Accepted python-pylxd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-pylxd/2.0.5-0ubuntu1.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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 python-pylxd (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Revision history for this message
Colin Watson (cjwatson) wrote :

The posted test case works, and launchpad-buildd seems to be happy now.

description: updated
tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-pylxd - 2.0.5-0ubuntu1.2

---------------
python-pylxd (2.0.5-0ubuntu1.2) xenial; urgency=medium

  * d/p/ignore-unsupported-attributes.patch: Backport patch from 2.2.4 to
    make models resilient to new attributes in LXD (LP: #1736454).

 -- Colin Watson <email address hidden> Tue, 05 Dec 2017 14:53:11 +0000

Changed in python-pylxd (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote : Update Released

The verification of the Stable Release Update for python-pylxd 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.

James Page (james-page)
Changed in cloud-archive:
status: New → Fix Released
Revision history for this message
James Page (james-page) wrote : Please test proposed package

Hello Colin, or anyone else affected,

Accepted python-pylxd 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
Revision history for this message
James Page (james-page) wrote :

Hello Colin, or anyone else affected,

Accepted python-pylxd 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: added: verification-newton-needed
James Page (james-page)
tags: added: verification-newton-done verification-ocata-done
removed: verification-newton-needed verification-ocata-needed
Revision history for this message
James Page (james-page) wrote :

Newton:

python-pylxd (2.1.1-0ubuntu1~cloud0.1) xenial; urgency=medium

  * d/p/ignore-unsupported-attributes.patch: Backport patch from 2.2.4 to
    make models resilient to new attributes in LXD (LP: #1736454).

Revision history for this message
James Page (james-page) wrote :

Ocata:

python-pylxd (2.2.4-0ubuntu1~cloud0) xenial; urgency=medium

  * New upstream stable release, including fix to make models resilient
    to new attributes in LXD (LP: #1736454).

Revision history for this message
James Page (james-page) wrote :

Updates should publish out in the next hour.

Revision history for this message
James Page (james-page) wrote :

Hello Colin, or anyone else affected,

Accepted python-pylxd 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
removed: verification-ocata-done
Revision history for this message
James Page (james-page) wrote : Update Released

The verification of the Stable Release Update for python-pylxd 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.

Revision history for this message
James Page (james-page) wrote :

This bug was fixed in the package python-pylxd - 2.2.4-0ubuntu0.17.04.1~cloud0
---------------

 python-pylxd (2.2.4-0ubuntu0.17.04.1~cloud0) xenial; urgency=medium
 .
   * New upstream stable release, including fix to make models resilient
     to new attributes in LXD (LP: #1736454).

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.