TypeError: execv() arg 2 must contain only strings

Bug #1461192 reported by Andreas Hasenack
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Landscape Server
Fix Released
High
Данило Шеган
15.07
Fix Released
High
Данило Шеган
Cisco-odl
Fix Released
High
Chris Glass
nova-compute (Juju Charms Collection)
Fix Released
High
Liam Young

Bug Description

Got this during an HA Autopilot deployment:

2015-06-02 16:15:49 INFO unit.nova-compute/2.juju-log cmd.go:247 ceph:68: Rendering from template: nova.conf
2015-06-02 16:15:49 INFO unit.nova-compute/2.juju-log cmd.go:247 ceph:68: Wrote template /etc/nova/nova.conf.
2015-06-02 16:15:49 INFO unit.nova-compute/2.juju-log cmd.go:247 ceph:68: Libvirt secret changed for uuid 514c9fca-8cbe-11e2-9c52-3bc8c7819472.
2015-06-02 16:15:49 INFO unit.nova-compute/2.juju-log cmd.go:247 ceph:68: Defining new libvirt secret for uuid 514c9fca-8cbe-11e2-9c52-3bc8c7819472.
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 Secret 514c9fca-8cbe-11e2-9c52-3bc8c7819472 created
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 Traceback (most recent call last):
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/ceph-relation-changed", line
 390, in <module>
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 main()
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/ceph-relation-changed", line
 384, in main
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 hooks.execute(sys.argv)
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/charmhelpers/core/hookenv.py
", line 557, in execute
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 self._hooks[hook_name]()
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/charmhelpers/core/host.py",
line 312, in wrapped_f
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 f(*args, **kwargs)
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/ceph-relation-changed", line
 284, in ceph_changed
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 key=relation_get('key'))
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/var/lib/juju/agents/unit-nova-compute-2/charm/hooks/nova_compute_utils.py", line
 564, in create_libvirt_secret
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 check_call(cmd)
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 retcode = call(*popenargs, **kwargs)
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/usr/lib/python2.7/subprocess.py", line 522, in call
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 return Popen(*popenargs, **kwargs).wait()
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 errread, errwrite)
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 raise child_exception
2015-06-02 16:15:49 INFO unit.nova-compute/2.ceph-relation-changed logger.go:40 TypeError: execv() arg 2 must contain only strings
2015-06-02 16:15:49 ERROR juju.worker.uniter.operation runhook.go:86 hook "ceph-relation-changed" failed: exit status 1

That's:

    cmd = ['virsh', '-c', uri, 'secret-set-value', '--secret', secret_uuid,
           '--base64', key]
    check_call(cmd)

Revision history for this message
Samantha Jian-Pielak (samantha-jian) wrote :

Deployed nova-compute from cloud-archive juno and failed with the same error: TypeError: execv() arg 2 must contain only strings

Revision history for this message
Samantha Jian-Pielak (samantha-jian) wrote :

log('Unsupported virt-type configured: %s' % virt_type)

I removed virt-type (kvm) option in the config file which I called to deploy nova-compute: juju deploy nova-compute --config openstack.cfg. After that it is deployed successfully.

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Can we also get detail about which charm branch / version is in use here?

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Also please specify which release combo(s) where this is being observed. ie. trusty-kilo, trusty-juno, utopic-juno, etc.

Revision history for this message
Alberto Donato (ack) wrote :

Autopilot currently deploys trusty-kilo, nova compute charm is cs:trusty/nova-compute-24.

tags: added: oil
Liam Young (gnuoy)
Changed in nova-compute (Juju Charms Collection):
importance: Undecided → High
assignee: nobody → Liam Young (gnuoy)
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Got this again. Fetching logs.

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

The call to create_libvirt_secret in ceph_changed() is not gated on relation_get('key') actually returning a value so if the ceph unit at the other end of the relation hasn't set a key on the relation yet None is passed to create_libvirt_secret and then passed to

    cmd = ['virsh', '-c', uri, 'secret-set-value', '--secret', secret_uuid,
           '--base64', key]

I think

=== modified file 'hooks/nova_compute_hooks.py'
--- hooks/nova_compute_hooks.py 2015-04-30 17:01:22 +0000
+++ hooks/nova_compute_hooks.py 2015-09-01 07:35:54 +0000
@@ -278,10 +278,11 @@

     # With some refactoring, this can move into NovaComputeCephContext
     # and allow easily extended to support other compute flavors.
- if config('virt-type') in ['kvm', 'qemu', 'lxc']:
+ ceph_key = relation_get('key')
+ if config('virt-type') in ['kvm', 'qemu', 'lxc'] and ceph_key:
         create_libvirt_secret(secret_file=CEPH_SECRET,
                               secret_uuid=CEPH_SECRET_UUID,
- key=relation_get('key'))
+ key=ceph_key)

     if (config('libvirt-image-backend') == 'rbd' and
             assert_libvirt_imagebackend_allowed()):

should fix it

Changed in nova-compute (Juju Charms Collection):
status: New → In Progress
David Britton (dpb)
no longer affects: nova
Changed in landscape:
milestone: none → 15.07
milestone: 15.07 → none
importance: Undecided → High
David Britton (dpb)
no longer affects: landscape
no longer affects: landscape/release-29
tags: added: landscape-release-29
Revision history for this message
David Britton (dpb) wrote :

Adding landscape as the autopilot would like to do some work here to see if we can test out this fix from Liam added in comment #7

tags: added: kanban
removed: landscape-release-29
tags: removed: kanban
David Britton (dpb)
Changed in landscape:
importance: Undecided → High
importance: High → Medium
Revision history for this message
Liam Young (gnuoy) wrote :

This was fixed in r157 in /next. The fix will be backported to stable

Changed in nova-compute (Juju Charms Collection):
status: In Progress → Fix Committed
Changed in landscape:
importance: Medium → High
James Page (james-page)
tags: added: stable
Liam Young (gnuoy)
Changed in nova-compute (Juju Charms Collection):
status: Fix Committed → Fix Released
Revision history for this message
Данило Шеган (danilo) wrote :

Merged into lp:landscape r9247 (merged back from release-29 r9085).

Changed in landscape:
status: New → Fix Committed
assignee: nobody → Данило Шеган (danilo)
Changed in landscape:
status: Fix Committed → Fix Released
milestone: none → 15.07
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.