[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#841063: marked as done (cloud-init: Python modules import failure)



Your message dated Tue, 17 Oct 2017 00:00:41 +0200
with message-id <73c28746-a236-268d-da0d-7f27a76c9f41@debian.org>
and subject line Outdated bug?
has caused the Debian Bug report #841063,
regarding cloud-init: Python modules import failure
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
841063: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841063
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: cloud-init
Version: 0.7.6~bzr976-2
Severity: normal

Hello,

I'm trying to use the Openstack vendor-data functionality. It works on Ubuntu/Fedora/Centos VM, but not on Debian (either the cloud-ready available on cdimage.debian.org, or a private one)
While looking at the cloud-init logs, I found several issues.

Looking at the vendor-data part, cloud-init is not calling the openstack api for the vendor-data value, as it does on other OS

Results of 'cat /var/log/cloud-init.log | grep "vendor"'

Logs Debian:
Oct 17 09:05:33 test [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud/vendor-data (quiet=False)
Oct 17 09:05:33 test [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud-net/vendor-data (quiet=False)
Oct 17 09:05:40 test [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-00000051/vendor-data.txt - wb: [384] 4 bytes
Oct 17 09:05:40 test [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-00000051/vendor-data.txt.i - wb: [384] 345 bytes
Oct 17 09:05:41 test [CLOUDINIT] stages.py[DEBUG]: no vendordata from datasource

Logs Ubuntu
Oct 17 07:51:27 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud/vendor-data (quiet=False)
Oct 17 07:51:27 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud-net/vendor-data (quiet=False)
Oct 17 07:51:28 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud/vendor-data (quiet=False)
Oct 17 07:51:28 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /var/lib/cloud/seed/nocloud-net/vendor-data (quiet=False)
Oct 17 07:51:37 ubuntu [CLOUDINIT] url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/openstack/latest/vendor_data.json' with {'url': 'http://169.254.169.254/openstack/latest/vendor_data.json', 'timeout': 5.0, 'allow_redirects': True, 'method': 'GET', 'headers': {'User-Agent': 'Cloud-Init/0.7.8'}} configuration
Oct 17 07:51:37 ubuntu [CLOUDINIT] url_helper.py[DEBUG]: Read from http://169.254.169.254/openstack/latest/vendor_data.json (200, 81b) after 1 attempts
Oct 17 07:51:43 ubuntu [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/bb80327c-08be-4868-a638-8d8e57fcf36f/vendor-data.txt - wb: [384] 62 bytes
Oct 17 07:51:43 ubuntu [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/cloud/instances/bb80327c-08be-4868-a638-8d8e57fcf36f/vendor-data.txt.i - wb: [384] 367 bytes
Oct 17 07:51:43 ubuntu [CLOUDINIT] handlers.py[DEBUG]: start: init-network/consume-vendor-data: reading and applying vendor-data

With a further look at the logs, I found several failures when importing python modules:

Small sample of'cat /var/log/cloud-init.log | grep "Failed"'

Oct 17 09:03:33 host-192-168-100-91 [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'debian' due to: No module named debian
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'debian' due to: No module named debian
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceNoCloud' due to: No module named DataSourceNoCloud
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceAltCloud' due to: No module named DataSourceAltCloud
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceCloudStack' due to: No module named DataSourceCloudStack
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceConfigDrive' due to: No module named DataSourceConfigDrive
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceMAAS' due to: No module named DataSourceMAAS
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceOVF' due to: No module named DataSourceOVF
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceGCE' due to: No module named DataSourceGCE
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceNone' due to: No module named DataSourceNone
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'debian' due to: No module named debian
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceNoCloud' due to: No module named DataSourceNoCloud
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceAltCloud' due to: No module named DataSourceAltCloud
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceCloudStack' due to: No module named DataSourceCloudStack
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceConfigDrive' due to: No module named DataSourceConfigDrive
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceEc2' due to: No module named DataSourceEc2
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceMAAS' due to: No module named DataSourceMAAS
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceOVF' due to: No module named DataSourceOVF
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceGCE' due to: No module named DataSourceGCE
Oct 17 09:05:33 test [CLOUDINIT] importer.py[DEBUG]: Failed at attempted import of 'DataSourceNone' due to: No module named DataSourceNone

However, all these modules are available:
'find / -name "DataSourceNone.py"'

/usr/lib/python2.7/dist-packages/cloudinit/sources/DataSourceNone.py

And they can be manually imported with a python2.7 script.
With the other OSs, the modules appears to be in the python3 folder instead of 2.7

Ubuntu 'find / -name "DataSourceNone.py"'

/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceNone.py

Maybe the issue stems from a python2.7/3 mix-up when calling the modules?

-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

--- End Message ---
--- Begin Message ---
Hi,

It looks to me that this is a very old bug which only affects oldstable
(ie: Jessie), and there, there is version 0.7.7~bzr1156-1~bpo8+1 from
backports which should be solving the issue.

Cheers,

Thomas Goirand (zigo)

--- End Message ---

Reply to: