Activity log for bug #2030726

Date Who What changed Old value New value Message
2023-08-08 08:35:48 Natalia Litvinova bug added bug
2023-08-08 08:39:51 Natalia Litvinova 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' Steps to reproduce: $ juju deploy haproxy haproxy73 --channel=latest/stable Located charm "haproxy" in charm-hub, revision 73 Deploying "haproxy73" from charm-hub charm "haproxy", revision 73 in channel latest/stable on ubuntu@22.04/stable $ juju config haproxy73 ssl_cert=SELFSIGNED 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'
2023-08-08 08:51:17 Przemyslaw Hausman bug added subscriber Przemyslaw Hausman
2023-08-08 10:06:12 Natalia Litvinova 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' 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 not able to reproduce this bug the second time
2023-08-08 18:25:21 Natalia Litvinova 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 not able to reproduce this bug the second time 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/
2023-08-09 07:21:15 Tom Haddon branch linked lp:~mthaddon/charm-haproxy/lp-2030726
2023-08-09 07:33:49 Tom Haddon charm-haproxy: status New Fix Released