config-changed chown: cannot access '/srv/nova/instances': No such file or directory

Bug #1771327 reported by Ryan Beisner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Compute Charm
Triaged
Medium
Unassigned

Bug Description

xenial-queens, master charms pre-18.05:

The nova-compute charm traces trying to chown the instance storage directory because it does not yet exist.

2018-05-15 11:00:36 INFO juju-log Generating new ssh key for user nova.
2018-05-15 11:00:36 DEBUG worker.uniter.jujuc server.go:178 running hook tool "relation-get"
2018-05-15 11:00:36 DEBUG config-changed ERROR no relation id specified
2018-05-15 11:00:36 DEBUG worker.uniter.jujuc server.go:178 running hook tool "relation-get"
2018-05-15 11:00:36 DEBUG config-changed ERROR no relation id specified
2018-05-15 11:00:36 DEBUG config-changed chown: cannot access '/srv/nova/instances': No such file or directory
2018-05-15 11:00:36 DEBUG config-changed Traceback (most recent call last):
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/config-changed", line 579, in <module>
2018-05-15 11:00:36 DEBUG config-changed main()
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/config-changed", line 572, in main
2018-05-15 11:00:36 DEBUG config-changed hooks.execute(sys.argv)
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/charmhelpers/core/hookenv.py", line 823, in execute
2018-05-15 11:00:36 DEBUG config-changed self._hooks[hook_name]()
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/charmhelpers/contrib/openstack/utils.py", line 1449, in wrapped_f
2018-05-15 11:00:36 DEBUG config-changed restart_functions)
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/charmhelpers/core/host.py", line 730, in restart_on_change_helper
2018-05-15 11:00:36 DEBUG config-changed r = lambda_f()
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/charmhelpers/contrib/openstack/utils.py", line 1448, in <lambda>
2018-05-15 11:00:36 DEBUG config-changed (lambda: f(*args, **kwargs)), restart_map, stopstart,
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/charmhelpers/contrib/hardening/harden.py", line 79, in _harden_inner2
2018-05-15 11:00:36 DEBUG config-changed return f(*args, **kwargs)
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/config-changed", line 195, in config_changed
2018-05-15 11:00:36 DEBUG config-changed fix_path_ownership(fp, user='nova')
2018-05-15 11:00:36 DEBUG config-changed File "/var/lib/juju/agents/unit-nova-compute-0/charm/hooks/nova_compute_utils.py", line 669, in fix_path_ownership
2018-05-15 11:00:36 DEBUG config-changed check_call(cmd)
2018-05-15 11:00:36 DEBUG config-changed File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
2018-05-15 11:00:36 DEBUG config-changed raise CalledProcessError(retcode, cmd)
2018-05-15 11:00:36 DEBUG config-changed subprocess.CalledProcessError: Command '['chown', 'nova', '/srv/nova/instances']' returned non-zero exit status 1
2018-05-15 11:00:36 ERROR juju.worker.uniter.operation runhook.go:113 hook "config-changed" failed: exit status 1
2018-05-15 11:00:36 DEBUG juju.worker.uniter.operation executor.go:84 lock released
2018-05-15 11:00:36 INFO juju.worker.uniter resolver.go:100 awaiting error resolution for "config-changed" hook
2018-05-15 11:00:36 DEBUG juju.worker.uniter agent.go:17 [AGENT-STATUS] error: hook failed: "config-changed"
2018-05-15 11:00:36 INFO juju.worker.uniter resolver.go:100 awaiting error resolution for "config-changed" hook

.

#### Workaround:
juju run --application nova-compute "sudo mkdir -vp /srv/nova/instances"
juju resolved nova-compute/0
juju resolved nova-compute/1
juju resolved nova-compute/2
juju resolved nova-compute/3

Tags: uosci
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

So '/srv/nova/instances' comes from the config.yaml 'instances-path', which has a default of /var/lib/nova/instances -- so it must be set for this to happen.

Options:

 1. Not do the action of setting the permissions if the lib doesn't exist.
 2. Create the directory and then set the permissions, if it doesn't exist.

Changed in charm-nova-compute:
status: New → Triaged
importance: Undecided → Medium
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.