ntp install fails causing commissioning and deploying to fail on trusty and xenial

Bug #1701935 reported by Liam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
New
Undecided
Unassigned

Bug Description

I cannot commission new machines as they fail commissioning. I have tried three different machines and tried to commission with both trusty and xenial but they all fail with:

2017-07-02 16:47:06,049 - util.py[DEBUG]: Running command ['systemctl', 'reload-or-restart', 'ntp'] with allowed return codes [0] (shell=False, capture=True)
2017-07-02 16:47:06,106 - cc_ntp.py[ERROR]: Failed to reload/start ntp service: Unexpected error while running command.
Command: ['systemctl', 'reload-or-restart', 'ntp']
Exit code: 1
Reason: -
Stdout: -
Stderr: Job for ntp.service failed because the control process exited with error code. See "systemctl status ntp.service" and "journalctl -xe" for details.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_ntp.py", line 78, in handle
    reload_ntp(systemd=cloud.distro.uses_systemd())
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_ntp.py", line 140, in reload_ntp
    util.subp(cmd, capture=True)
  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1821, in subp
    cmd=args)
cloudinit.util.ProcessExecutionError: Unexpected error while running command.
Command: ['systemctl', 'reload-or-restart', 'ntp']
Exit code: 1
Reason: -
Stdout: -
Stderr: Job for ntp.service failed because the control process exited with error code. See "systemctl status ntp.service" and "journalctl -xe" for details.

If I set the node to allow an ssh connection and not power off during commissioning then I can ssh to the node. Once there I can confirm that I can reproduce the error with "sudo systemctl restart ntp". I can 'fix' it by disabling the apparmor ntp profile:

ubuntu@caring-koi:~$ sudo systemctl restart ntp
sudo: unable to resolve host caring-koi
Job for ntp.service failed because the control process exited with error code. See "systemctl status ntp.service" and "journalctl -xe" for details.
ubuntu@caring-koi:~$ sudo ln -s /etc/apparmor.d/usr.sbin.ntpd /etc/apparmor.d/disable/
sudo: unable to resolve host caring-koi
ubuntu@caring-koi:~$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.ntpd
sudo: unable to resolve host caring-koi
ubuntu@caring-koi:~$ sudo systemctl restart ntp
sudo: unable to resolve host caring-koi
ubuntu@caring-koi:~$

Oddly, I worked around this by adding a commissioning script to create the symlink above which allowed me to commission 3 nodes. However, when I came to add a third it no longer seemed to work and I was back to the error above. fwiw I also hit the same error when deploying via juju and worked around it here by deploying zesty images.

I appreciate this may be a bug in ntp or cloud-init but I'm experiencing it in maas.

Revision history for this message
Liam Young (gnuoy) wrote :
Liam Young (gnuoy)
summary: - Cannot commission or deploy trusty or xenial
+ ntp install fails causing commissioning and deploying to fail on trusty
+ and xenial
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Liam,

This is an issue with either the kernel or apparmor, hence this bug has been marked a duplicate of such issue.

That said, MAAS 2.1 (and 2.2) is now deprecated, as such, I highly recommend you upgrade to 2.2. Using MAAS 2.2 now has a work around that would prevent this failure.

If you are no upgrade, you have two options:

1. Use "hwe-16.04" as the kernel to deploy the machine.
2. Use apparmor=0 as a kernel paran. This will, however, cause apparmor to be disabled in your deployed machine.

Thanks!

Revision history for this message
Liam Young (gnuoy) wrote :

Thanks Andres! an upgrading to 2.2 sorted the issue as you said.

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.