cloud init depends on python-serial but does not declare it

Bug #1381776 reported by Drew Fisher on 2014-10-15
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Medium
Dan Watkins
Precise
Undecided
Unassigned
Trusty
Undecided
Unassigned

Bug Description

[Impact]
cloud-init will fail to run on an installation of Ubuntu which doesn't include python-serial. This excludes normal cloud images (as they ship with Landscape, which indirectly depends on it), but custom built images (or more minimal images) will see this.

[Test Case]
Build an image with cloud-init in its default configuration but without another package that depends on python-serial. cloud-init should run successfully on boot.

[Regression Potential]
None; we are just adding a dependency which exists in the archive for all versions and which is installed already in most deployments.

[Original Report]
cloud-init 0.6.3-0ubuntu1.14 appears to depend on python-serial (due to the backported cloudsigma support patch), but this dependency is not specified in the package.

I built a machine image via debootstrap and installing the cloud-init package, but upon boot, cloud-init doesn't perform any of the expected actions, and I get this backtrace in /var/log/boot.log:

Traceback (most recent call last):
  File "/usr/bin/cloud-init", line 229, in <module>
    main()
  File "/usr/bin/cloud-init", line 166, in main
    cloud.get_data_source()
  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 207, in get_data_source
    dslist = list_sources(cfglist, self.ds_deps)
  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 552, in list_sources
    return(DataSource.list_sources(cfg_list, depends, ["cloudinit", ""]))
  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSource.py", line 178, in list_sources
    mod = __import__("%sDataSource%s" % (pkg, ds_coll))
  File "/usr/lib/python2.7/dist-packages/cloudinit/DataSourceCloudSigma.py", line 25, in <module>
    from cloudinit.cs_utils import Cepko
  File "/usr/lib/python2.7/dist-packages/cloudinit/cs_utils.py", line 36, in <module>
    import serial
ImportError: No module named serial

The fix would appear to be adding python-serial to Depends.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cloud-init (Ubuntu):
status: New → Confirmed

This also appears for me in Ubuntu 12.04 LTS, with cloud-init 0.6.3-0ubuntu1.15.

Rebooting in recovery mode, I was able to install the python-serial package, and the error message went away once I rebooted.

Robie Basak (racb) on 2015-02-04
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
Dan Watkins (oddbloke) on 2015-07-16
Changed in cloud-init (Ubuntu):
assignee: nobody → Dan Watkins (daniel-thewatkins)
Dan Watkins (oddbloke) wrote :

Hi Drew, Jonathan,

cloud-init dynamically loads the data source modules based on which ones it's configured to use. If you don't need the CloudSigma data source, then you could do 'dpkg-reconfigure cloud-init' and remove it from the list that is configured. This just puts a file in /etc/cloud/cloud.cfg.d (see below for an example with most data sources disabled), so you could also look at doing this manually.

$ cat /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# to update this file, run dpkg-reconfigure cloud-init
datasource_list: [ NoCloud, ConfigDrive ]

I will also look in to including python-serial in the Depends for precise and trusty.

Thanks,

Dan

Dan Watkins (oddbloke) on 2015-07-16
description: updated

Hello Drew, or anyone else affected,

Accepted cloud-init into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.5-0ubuntu1.7 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 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 cloud-init (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Changed in cloud-init (Ubuntu Precise):
status: New → Fix Committed
Chris J Arges (arges) wrote :

Hello Drew, or anyone else affected,

Accepted cloud-init into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.6.3-0ubuntu1.18 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 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!

Felipe Reyes (freyes) wrote :

cloud-init from -proposed for precise is pulling in python-serial now, no problems detected after installing this new version

ubuntu@foo2:~$ dpkg -l python-serial
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 Description
+++-===============================================-===============================================-==============================================================================================================
un python-serial <none> (no description available)
ubuntu@foo2:~$ sudo apt-get install -q cloud-init
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  python-serial
Suggested packages:
  python-wxgtk2.8 python-wxgtk2.6 python-wxgtk
The following NEW packages will be installed:
  python-serial
The following packages will be upgraded:
  cloud-init
1 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
Need to get 210 kB of archives.
After this operation, 383 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main python-serial all 2.5-2.1build1 [74.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ precise-proposed/main cloud-init all 0.6.3-0ubuntu1.18 [136 kB]
Fetched 210 kB in 1s (174 kB/s)
Preconfiguring packages ...
Selecting previously unselected package python-serial.
(Reading database ... 47512 files and directories currently installed.)
Unpacking python-serial (from .../python-serial_2.5-2.1build1_all.deb) ...
Preparing to replace cloud-init 0.6.3-0ubuntu1.17 (using .../cloud-init_0.6.3-0ubuntu1.18_all.deb) ...
Unpacking replacement cloud-init ...
Processing triggers for ureadahead ...
Setting up python-serial (2.5-2.1build1) ...
Setting up cloud-init (0.6.3-0ubuntu1.18) ...
Leaving 'diversion of /etc/init/ureadahead.conf to /etc/init/ureadahead.conf.disabled by cloud-init'
ubuntu@foo2:~$ dpkg -l python-serial cloud-init
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 Description
+++-===============================================-===============================================-==============================================================================================================
ii cloud-init 0.6.3-0ubuntu1.18 Init scripts for cloud instances
ii python-serial 2.5-2.1build1 pyserial - module encapsulating access for the serial port

tags: added: verification-done-precise
Felipe Reyes (freyes) wrote :
Download full text (3.2 KiB)

cloud-init from trusty is already depending on python-serial. Why does it need to get added explicitly?

Package: cloud-init
Priority: extra
Section: admin
Installed-Size: 964
Maintainer: Scott Moser <email address hidden>
Architecture: all
Version: 0.7.5-0ubuntu1
Replaces: ec2-init (<< 0.5.3)
Provides: ec2-init
Depends: cloud-guest-utils | cloud-utils, ifupdown (>= 0.6.10ubuntu5), procps, python (>= 2.7), python-requests (>= 0.8.2), software-properties-common, debconf (>= 0.5) | debconf-2.0, python (<< 2.8), python:any (>= 2.7.1-0ubuntu2), python-cheetah, python-prettytable, python-oauth, python-serial, python-configobj, python-yaml, python-jsonpatch
Recommends: eatmydata
Conflicts: ec2-init (<< 0.5.3)
Filename: pool/main/c/cloud-init/cloud-init_0.7.5-0ubuntu1_all.deb
Size: 190622
MD5sum: cc0d636ccbdff6f6969505eb33da29cc
SHA1: 05aef5df1b3b7c0f4612b4b08cc5b8931efbf43f
SHA256: e669b7b7bc7176219f013c1895e8662640e25e70f7fa0e76ba8333b9244fa397
Description-en: Init scripts for cloud instances
 Cloud instances need special scripts to run during initialisation
 to retrieve and install ssh keys and to let the user run various scripts.
Description-md5: 8719ef0e4178017b7147590b1fde082e
Python-Version: 2.7
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: cloud-image

ubuntu@foo:~$ dpkg -l python-serial
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 python-serial 2.6-1build1 all pyserial - module encapsulating access for the serial port
ubuntu@foo:~$ sudo apt-get remove python-serial
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  cloud-init python-serial
0 upgraded, 0 newly installed, 2 to remove and 99 not upgraded.
After this operation, 1,410 kB disk space will be freed.
Do you want to continue? [Y/n] ^Cubuntu@foo:~$ dpkg -l cloud-init
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 cloud-init 0.7.5-0ubuntu1.5 all Init sc...

Read more...

Dan Watkins (oddbloke) wrote :

This change wasn't needed in trusty, but as it doesn't actually change how the package behaves we will fix it in the next SRU (which will be coming hot on the heels of the current version in -proposed). Marked as verification-done.

tags: added: verification-done
removed: verification-done-precise verification-needed
Dan Watkins (oddbloke) on 2015-08-10
Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.5-0ubuntu1.7

---------------
cloud-init (0.7.5-0ubuntu1.7) trusty; urgency=medium

  * d/patches/lp-1456684-eu-central-1.patch:
    - Add central as a direction for EC2 availability zones (LP: #1456684).
  * d/patches/lp-1464253-handle-new-cloudstack-passwords.patch:
      - Handle both old and new CloudStack password servers (LP: #1464253).
  * Add python-serial to Build-Depends (LP: #1381776).

 -- Daniel Watkins <email address hidden> Thu, 16 Jul 2015 17:34:01 +0100

Changed in cloud-init (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for cloud-init 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 cloud-init - 0.6.3-0ubuntu1.18

---------------
cloud-init (0.6.3-0ubuntu1.18) precise; urgency=medium

  * d/patches/lp-1456684-eu-central-1.patch:
      - Add central as a direction for EC2 availability zones (LP: #1456684).
  * d/patches/lp-1464253-handle-new-cloudstack-passwords.patch:
      - Handle both old and new CloudStack password servers (LP: #1464253).
  * Add python-serial to Depends (LP: #1381776).

 -- Daniel Watkins <email address hidden> Thu, 16 Jul 2015 17:14:18 +0100

Changed in cloud-init (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers