← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1808351] [NEW] [Xenial] modules-final fails with 'Paths' object has no attribute 'run_dir'

 

Public bug reported:

* Xenial node deployed via Juju 1.25.14, using MAAS as provider.
* cloud-init version: 18.4-0ubuntu1~16.04.2

1) MAAS shows the node as deployed
2) cloud-init runs ok until modules:config, then:
"""
Dec 13 13:11:00 ubuntu cloud-init[10991]: failed run of stage modules-final
Dec 13 13:11:00 ubuntu cloud-init[10991]: ------------------------------------------------------------
Dec 13 13:11:00 ubuntu cloud-init[10991]: Traceback (most recent call last):
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 658, in status_wrapper
Dec 13 13:11:00 ubuntu cloud-init[10991]:     ret = functor(name, args)
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 494, in main_modules
Dec 13 13:11:00 ubuntu cloud-init[10991]:     _maybe_persist_instance_data(init)
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 700, in _maybe_persist_instance_data
Dec 13 13:11:00 ubuntu cloud-init[10991]:     init.datasource.persist_instance_data()
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 276, in persist_instance_data
Dec 13 13:11:00 ubuntu cloud-init[10991]:     json_file = os.path.join(self.paths.run_dir, INSTANCE_JSON_FILE)
Dec 13 13:11:00 ubuntu cloud-init[10991]: AttributeError: 'Paths' object has no attribute 'run_dir'
Dec 13 13:11:00 ubuntu cloud-init[10991]: ------------------------------------------------------------
Dec 13 13:11:00 ubuntu cloud-init[10991]: Traceback (most recent call last):
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/bin/cloud-init", line 9, in <module>
Dec 13 13:11:00 ubuntu cloud-init[10991]:     load_entry_point('cloud-init==18.4', 'console_scripts', 'cloud-init')()
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 904, in main
Dec 13 13:11:00 ubuntu cloud-init[10991]:     get_uptime=True, func=functor, args=(name, args))
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2514, in log_time
Dec 13 13:11:00 ubuntu cloud-init[10991]:     ret = func(*args, **kwargs)
Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 682, in status_wrapper
Dec 13 13:11:00 ubuntu cloud-init[10991]:     if v1[m]['errors']:
Dec 13 13:11:00 ubuntu cloud-init[10991]: KeyError: 'modules-init'
"""

If "cloud-init modules -m final" is run manually, we see that "cloud-init modules -m init" is the one that fails on:
https://git.launchpad.net/cloud-init/tree/cloudinit/cmd/main.py?h=ubuntu/xenial&id=ubuntu/18.4-0ubuntu1_16.04.2#n698

That code was introduced on commit c7555762f.

By downgrading to the previous version found on the node, and manually running "cloud-init modules -m final", Juju gets deployed correctly:
"""
# apt-cache policy cloud-init                                                                                                                                                                         
cloud-init:
  Installed: 0.7.7~bzr1212-0ubuntu1
  Candidate: 18.4-0ubuntu1~16.04.2
  Version table:
     18.4-0ubuntu1~16.04.2 500
        500 http://archive.ubuntu.com//ubuntu xenial-updates/main amd64 Packages
 *** 0.7.7~bzr1212-0ubuntu1 500
        500 http://archive.ubuntu.com//ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
"""

Thank you,
-Alvaro.

PS: I know, Juju 1.25 is discontinued, but we are still supporting a
couple of environments, so I need to test under that version, too.

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: canonical-bootstack

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1808351

Title:
  [Xenial] modules-final fails with 'Paths' object has no attribute
  'run_dir'

Status in cloud-init:
  New

Bug description:
  * Xenial node deployed via Juju 1.25.14, using MAAS as provider.
  * cloud-init version: 18.4-0ubuntu1~16.04.2

  1) MAAS shows the node as deployed
  2) cloud-init runs ok until modules:config, then:
  """
  Dec 13 13:11:00 ubuntu cloud-init[10991]: failed run of stage modules-final
  Dec 13 13:11:00 ubuntu cloud-init[10991]: ------------------------------------------------------------
  Dec 13 13:11:00 ubuntu cloud-init[10991]: Traceback (most recent call last):
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 658, in status_wrapper
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     ret = functor(name, args)
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 494, in main_modules
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     _maybe_persist_instance_data(init)
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 700, in _maybe_persist_instance_data
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     init.datasource.persist_instance_data()
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 276, in persist_instance_data
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     json_file = os.path.join(self.paths.run_dir, INSTANCE_JSON_FILE)
  Dec 13 13:11:00 ubuntu cloud-init[10991]: AttributeError: 'Paths' object has no attribute 'run_dir'
  Dec 13 13:11:00 ubuntu cloud-init[10991]: ------------------------------------------------------------
  Dec 13 13:11:00 ubuntu cloud-init[10991]: Traceback (most recent call last):
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/bin/cloud-init", line 9, in <module>
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     load_entry_point('cloud-init==18.4', 'console_scripts', 'cloud-init')()
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 904, in main
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     get_uptime=True, func=functor, args=(name, args))
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2514, in log_time
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     ret = func(*args, **kwargs)
  Dec 13 13:11:00 ubuntu cloud-init[10991]:   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 682, in status_wrapper
  Dec 13 13:11:00 ubuntu cloud-init[10991]:     if v1[m]['errors']:
  Dec 13 13:11:00 ubuntu cloud-init[10991]: KeyError: 'modules-init'
  """

  If "cloud-init modules -m final" is run manually, we see that "cloud-init modules -m init" is the one that fails on:
  https://git.launchpad.net/cloud-init/tree/cloudinit/cmd/main.py?h=ubuntu/xenial&id=ubuntu/18.4-0ubuntu1_16.04.2#n698

  That code was introduced on commit c7555762f.

  By downgrading to the previous version found on the node, and manually running "cloud-init modules -m final", Juju gets deployed correctly:
  """
  # apt-cache policy cloud-init                                                                                                                                                                         
  cloud-init:
    Installed: 0.7.7~bzr1212-0ubuntu1
    Candidate: 18.4-0ubuntu1~16.04.2
    Version table:
       18.4-0ubuntu1~16.04.2 500
          500 http://archive.ubuntu.com//ubuntu xenial-updates/main amd64 Packages
   *** 0.7.7~bzr1212-0ubuntu1 500
          500 http://archive.ubuntu.com//ubuntu xenial/main amd64 Packages
          100 /var/lib/dpkg/status
  """

  Thank you,
  -Alvaro.

  PS: I know, Juju 1.25 is discontinued, but we are still supporting a
  couple of environments, so I need to test under that version, too.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1808351/+subscriptions