sefsigned certificate is not creating

Bug #2030726 reported by Natalia Litvinova
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
charm-haproxy
Fix Released
Undecided
Unassigned

Bug Description

When deploying revision 73 of the charm with the SELFSIGNED option the hook fails not being able to create the certificate:

root@landscapeha-1:/var/lib/juju/agents/unit-landscape-server-haproxy-0/charm# ./hooks/reverseproxy-relation-changed
Generating a RSA private key
...........+++++
....................+++++
writing new private key to '/var/lib/haproxy/selfsigned.key'
-----
Cannot write random bytes:
139901954950464:error:2407007A:random number generator:RAND_write_file:Not a regular file:../crypto/rand/randfile.c:183:Filename=/dev/urandom
./hooks/reverseproxy-relation-changed:331: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  sysctl_dict = yaml.load(config_data.get("sysctl", "{}"))
Generating a RSA private key
........+++++
.......+++++
writing new private key to '/var/lib/haproxy/selfsigned.key'
-----
Cannot write random bytes:
140448263198016:error:2407007A:random number generator:RAND_write_file:Not a regular file:../crypto/rand/randfile.c:183:Filename=/dev/urandom
Traceback (most recent call last):
  File "./hooks/reverseproxy-relation-changed", line 1575, in <module>
    main(hook_name)
  File "./hooks/reverseproxy-relation-changed", line 1542, in main
    reverseproxy_interface("changed")
  File "./hooks/reverseproxy-relation-changed", line 1095, in reverseproxy_interface
    config_changed()
  File "./hooks/reverseproxy-relation-changed", line 1036, in config_changed
    update_ssl_cert(config_data)
  File "./hooks/reverseproxy-relation-changed", line 361, in update_ssl_cert
    write_ssl_pem(pem_path, content)
  File "./hooks/reverseproxy-relation-changed", line 1444, in write_ssl_pem
    f.write(content.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

I was able to reproduce this bug again with this bundle: https://pastebin.ubuntu.com/p/GMd3jV6Qtg/

Related branches

description: updated
description: updated
description: updated
Revision history for this message
Tom Haddon (mthaddon) wrote :

This has been fixed in revision 74, which has been released to the stable channel

Changed in charm-haproxy:
status: New → 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.