/charm/data/openssl.cnf No such file or directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-haproxy |
Fix Released
|
High
|
Unassigned |
Bug Description
New revisions of the charm do not work with SELFSIGNED certificate parameter.
I tested revisions 70 and 72. Revision 66 works for me.
/var/log/
2023-08-02 14:39:54 INFO juju.worker.uniter resolver.go:161 awaiting error resolution for "config-changed" hook
2023-08-02 14:39:54 INFO unit.haproxy72/
2023-08-02 14:39:56 INFO unit.haproxy72/
2023-08-02 14:39:58 INFO unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 WARNING unit.haproxy72/
2023-08-02 14:39:58 ERROR juju.worker.
2023-08-02 14:39:58 INFO juju.worker.uniter resolver.go:161 awaiting error resolution for "config-changed" hook
2023-08-02 14:41:27 INFO juju.worker.uniter resolver.go:161 awaiting error resolution for "config-changed" hook
Steps to reproduce:
$ juju deploy haproxy haproxy72 --revision=72 --channel=
Located charm "haproxy" in charm-hub, revision 72
Deploying "haproxy72" from charm-hub charm "haproxy", revision 72 in channel latest/stable on ubuntu@22.04/stable
$ juju config haproxy72 ssl_cert=SELFSIGNED
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
default aws-controller aws/us-east-1 3.1.5 unsupported 18:46:34+04:00
App Version Status Scale Charm Channel Rev Exposed Message
haproxy66 active 1 haproxy latest/stable 66 no Unit is ready
haproxy70 error 1 haproxy latest/stable 70 no hook failed: "config-changed"
haproxy72 error 1 haproxy latest/stable 72 no hook failed: "config-changed"
Unit Workload Agent Machine Public address Ports Message
haproxy66/0* active idle 2 54.224.7.53 Unit is ready
haproxy70/0* error idle 0 18.207.180.232 hook failed: "config-changed"
haproxy72/0* error idle 1 34.239.179.155 hook failed: "config-changed"
Machine State Address Inst id Base AZ Message
0 started 18.207.180.232 i-032d632215425e525 ubuntu@22.04 us-east-1d running
1 started 34.239.179.155 i-0b8124c93003c905b ubuntu@22.04 us-east-1f running
2 started 54.224.7.53 i-030a547a0672e28ad ubuntu@20.04 us-east-1c running
Related branches
- Canonical IS Reviewers: Pending requested
- haproxy-team: Pending requested
-
Diff: 33 lines (+3/-2)2 files modifiedcharmcraft.yaml (+1/-0)
hooks/hooks.py (+2/-2)
Changed in charm-haproxy: | |
status: | New → Confirmed |
importance: | Undecided → High |
That fails also for me. As a result the certificate is not created at /var/lib/ haproxy/ service_ landscape- https/0. pem
root@landscapeh a-1:/var/ lib/juju/ agents/ unit-landscape- server- haproxy- 0/charm# ./hooks/ reverseproxy- relation- changed reverseproxy- relation- changed" , line 1575, in <module> reverseproxy- relation- changed" , line 1542, in main interface( "changed" ) reverseproxy- relation- changed" , line 1095, in reverseproxy_ interface
Traceback (most recent call last):
File "./hooks/
main(hook_name)
File "./hooks/
reverseproxy_
File "./hooks/
config_changed()
As a result the certificate is not created reverseproxy- relation- changed" , line 1032, in config_changed reverseproxy- relation- changed" , line 754, in create_services service_ config( services_ dict) reverseproxy- relation- changed" , line 848, in write_service_ config
File "./hooks/
if not create_services():
File "./hooks/
write_
File "./hooks/
f.write(content)
TypeError: write() argument must be str, not bytes
for write() one may use write(content. decode( 'utf-8' ))
That fixes the issue