Writing string where byte is expected

Bug #1735068 reported by Ante Karamatić
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph Monitor Charm
Fix Released
Critical
James Page
OpenStack Neutron API Charm
Fix Released
Critical
James Page
OpenStack Neutron Gateway Charm
Fix Released
Critical
James Page
OpenStack Neutron Open vSwitch Charm
Fix Released
Critical
James Page

Bug Description

Test run failed with:

2017-11-29 04:10:06 DEBUG juju-log nrpe-external-master:123: Writing file /etc/cron.d/cat-ceph-health root:root 444
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined Traceback (most recent call last):
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined File "/var/lib/juju/agents/unit-ceph-mon-0/charm/hooks/nrpe-external-master-relation-joined", line 725, in <module>
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined hooks.execute(sys.argv)
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined File "/var/lib/juju/agents/unit-ceph-mon-0/charm/hooks/charmhelpers/core/hookenv.py", line 798, in execute
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined self._hooks[hook_name]()
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined File "/var/lib/juju/agents/unit-ceph-mon-0/charm/hooks/nrpe-external-master-relation-joined", line 655, in update_nrpe_config
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined write_file(STATUS_CRONFILE, cronjob)
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined File "/var/lib/juju/agents/unit-ceph-mon-0/charm/hooks/charmhelpers/core/host.py", line 552, in write_file
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined target.write(content)
2017-11-29 04:10:06 DEBUG nrpe-external-master-relation-joined TypeError: a bytes-like object is required, not 'str'
2017-11-29 04:10:06 ERROR juju.worker.uniter.operation runhook.go:107 hook "nrpe-external-master-relation-joined" failed: exit status 1

I suspect this will be a problem for many things (including certs), since in python 3.5 writing a binary really means writing binary. Passing string will not work.

Tags: cpe-onsite
tags: added: cpe-onsite
Revision history for this message
James Page (james-page) wrote :
James Page (james-page)
Changed in charm-ceph-mon:
status: New → In Progress
Changed in charm-neutron-api:
status: New → In Progress
Changed in charm-neutron-gateway:
status: New → In Progress
Changed in charm-neutron-openvswitch:
status: New → In Progress
Changed in charm-ceph-mon:
importance: Undecided → Critical
Changed in charm-neutron-api:
importance: Undecided → Critical
Changed in charm-neutron-gateway:
importance: Undecided → Critical
assignee: nobody → James Page (james-page)
Changed in charm-neutron-openvswitch:
importance: Undecided → Critical
assignee: nobody → James Page (james-page)
Changed in charm-neutron-api:
assignee: nobody → James Page (james-page)
Changed in charm-ceph-mon:
assignee: nobody → James Page (james-page)
milestone: none → 17.11
Changed in charm-neutron-api:
milestone: none → 17.11
Changed in charm-neutron-gateway:
milestone: none → 17.11
Changed in charm-neutron-openvswitch:
milestone: none → 17.11
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-mon (master)

Reviewed: https://review.openstack.org/523806
Committed: https://git.openstack.org/cgit/openstack/charm-ceph-mon/commit/?id=ffd60c0cc6618d20ef375a45daf3bb1ebac2a7db
Submitter: Zuul
Branch: master

commit ffd60c0cc6618d20ef375a45daf3bb1ebac2a7db
Author: James Page <email address hidden>
Date: Wed Nov 29 09:24:19 2017 +0000

    Resync charmhelpers for py3 fixes

    Includes fix for write_file encoding under py3.

    Change-Id: Id0e3677f4f877b23c95902140cc4f24736f2768c
    Closes-Bug: 1735068

Changed in charm-ceph-mon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-openvswitch (master)

Reviewed: https://review.openstack.org/523816
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-openvswitch/commit/?id=92ecb6f527d28ac42f6043ca8997b10fc525237e
Submitter: Zuul
Branch: master

commit 92ecb6f527d28ac42f6043ca8997b10fc525237e
Author: James Page <email address hidden>
Date: Wed Nov 29 09:28:31 2017 +0000

    Resync charmhelpers for py3 fixes

    Includes fix for write_file encoding under py3.

    Change-Id: I0ab95470c79bbb53d9177bc662d10d1d22369e86
    Closes-Bug: 1735068

Changed in charm-neutron-openvswitch:
status: In Progress → Fix Committed
Changed in charm-neutron-api:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-api (master)

Reviewed: https://review.openstack.org/523813
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-api/commit/?id=638789cb0540468d2852a897eea7e92dfa583dd2
Submitter: Zuul
Branch: master

commit 638789cb0540468d2852a897eea7e92dfa583dd2
Author: James Page <email address hidden>
Date: Wed Nov 29 09:27:27 2017 +0000

    Resync charmhelpers for py3 fixes

    Includes fix for write_file encoding under py3.

    Change-Id: I38a15c686674f52a77ec4a2ac271785de64f2fae
    Closes-Bug: 1735068

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-gateway (master)

Reviewed: https://review.openstack.org/523814
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-gateway/commit/?id=8ebe32897b168153808b284a0a0af58395945023
Submitter: Zuul
Branch: master

commit 8ebe32897b168153808b284a0a0af58395945023
Author: James Page <email address hidden>
Date: Wed Nov 29 09:28:01 2017 +0000

    Resync charmhelpers for py3 fixes

    Includes fix for write_file encoding under py3.

    Change-Id: Ib5f211644c9591cb8185c4646679405b9e0f0f07
    Closes-Bug: 1735068

Changed in charm-neutron-gateway:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-ceph-mon:
status: Fix Committed → Fix Released
Changed in charm-neutron-gateway:
status: Fix Committed → Fix Released
Changed in charm-neutron-api:
status: Fix Committed → Fix Released
Changed in charm-neutron-openvswitch:
status: Fix Committed → Fix Released
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.