Hook failed

Hi, I am deploying openstack using MAAS and JUJU (documentation link here: https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/latest/install-maas.html). Although almost every single charm deployed correctly, but I have problem with ntp. In my attached screenshot below you can see my juju status.

It says that ntp/12 unit hook failed. I did some research and found out that ntp/12 unit tries to open 123 UDP port on 10.1.1.11 host. After some debbuging I am getting same error as in a link (https://askubuntu.com/questions/983461/is-it-possible-to-check-the-open-ports-in-a-juju-charm) subprocess.CalledProcessError: Command ‘[‘open-port’, ‘123/UDP’]’ returned non-zero exit status 1. Why juju deployed 5 units? As far as I understand 4 is enough and it would worked perfectly for me

It looks like the ntp hook just failed on the one unit ntp/12. To debug this you can use the juju debug-log tool or you can ssh to the unit and take a look at the unit log in /var/log/juju/unit....

There are 5 ntp units because it’s a subordinate. What that means is that it’s related to principal applications. Any time one of these principals spins up (juju add-unit, etc) then a new ntp will come up and also be on the same machine. In this case you’ve got

  • 4 ceph-osd units with an ntp on each
  • 1 neutron-gateway unit with an ntp

This is why you end up with 5 of them.

HTH

Thank you for response, Rick :slight_smile: My error log of /var/log/juju/unit-ntp-12.log is:

Maybe, it is because he tries to open 123 UDP port twice on the same host?

Hmm, maybe? It’d be interesting to try to run that using the debug-hooks tool and manually try to run the open-port command that’s generated and see what the error message coming out of that is.

Yes. Steps I made was:

  1. juju debug-hooks ntp/12

  2. cd /var/lib/juju/agents/unit-ntp-12/charm

  3. ./hooks/install

And here comes the output:

It looks I was right, but next question is how to avoid this error…

And also, it does not let me close 123 UDP port for the same reason I cant open port

Oh hmm, this looks odd. You have both ntp 10 and 12 on the same machine? I think there might be a confusion there. As a subordinate should only be setup once per machine. Otherwise they’re competing for managing the same local config files and such. I think an audit of what is on the machine and what subordinates are in play is in order. You might have to remove the subordinate relation from the neutron-gateway if it’s on the same machine as a ceph-osd, for instance.

Yes I do have ntp/10 and ntp/12 on the same machine. If I do “juju remove-unit ntp/10” I get output “removing unit ntp/10 failed: unit “ntp/10” is a subordinate”

From openstack documentation (https://docs.openstack.org/project-deploy-guide/charm-deployment-guide/latest/install-openstack.html):

And it says to add a relation between neutron-gateway and ntp. Is something wrong with a documentation?

Well I think it assumes they’re on different machines. Instead of removing the unit break the relation.

juju remove-relation ntp neutron-gateway
1 Like

Okay. My juju status output is all green now. I hope everything will work fine now :smiley: Thank you for your help

1 Like

Awesome! Glad we got it sorted out.