canonical / charm-lldpd

LLDPd charm
Other
1 stars 8 forks source link

ascii decode error during install hook #4

Closed jhobbs closed 4 years ago

jhobbs commented 4 years ago

This cs:lldpd-5 on bionic:

2020-05-11 03:31:19 INFO juju.worker.uniter resolver.go:130 found queued "install" hook 2020-05-11 03:34:26 DEBUG install Traceback (most recent call last): 2020-05-11 03:34:26 DEBUG install File "/var/lib/juju/agents/unit-lldpd-2/charm/hooks/install", line 134, in 2020-05-11 03:34:26 DEBUG install main(LldpdCharm) 2020-05-11 03:34:26 DEBUG install File "lib/ops/main.py", line 180, in main 2020-05-11 03:34:26 DEBUG install metadata, actions_metadata = _load_metadata(charm_dir) 2020-05-11 03:34:26 DEBUG install File "lib/ops/main.py", line 46, in _load_metadata 2020-05-11 03:34:26 DEBUG install metadata = yaml.safe_load((charm_dir / 'metadata.yaml').read_text()) 2020-05-11 03:34:26 DEBUG install File "/usr/lib/python3.6/pathlib.py", line 1197, in read_text 2020-05-11 03:34:26 DEBUG install return f.read() 2020-05-11 03:34:26 DEBUG install File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode 2020-05-11 03:34:26 DEBUG install return codecs.ascii_decode(input, self.errors)[0] 2020-05-11 03:34:26 DEBUG install UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 119: ordinal not in range(128) 2020-05-11 03:34:26 ERROR juju.worker.uniter.operation runhook.go:132 hook "install" failed: exit status 1

It's not able to deal with the special character in Ante's name: "maintainer": "Ante Karamatić ante.karamatic@canonical.com"

ivoks commented 4 years ago

Hi Jason

That line contained 'ć' since 2016. I'm unable to reproduce the problem on Bionic:

2020-05-15 12:51:41 INFO juju.worker.uniter resolver.go:130 found queued "install" hook 2020-05-15 12:51:42 INFO juju-log Installing lldpd. 2020-05-15 12:51:43 DEBUG install Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease 2020-05-15 12:51:43 DEBUG install Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease 2020-05-15 12:51:43 DEBUG install Hit:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease 2020-05-15 12:51:43 DEBUG install Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease 2020-05-15 12:51:44 DEBUG install Reading package lists... 2020-05-15 12:51:45 INFO juju-log Installing ['lldpd'] with options: ['--option=Dpkg::Options::=--force-confold'] 2020-05-15 12:51:45 DEBUG install Reading package lists... 2020-05-15 12:51:45 DEBUG install Building dependency tree... 2020-05-15 12:51:45 DEBUG install Reading state information... 2020-05-15 12:51:45 DEBUG install The following package was automatically installed and is no longer required: 2020-05-15 12:51:45 DEBUG install libfreetype6 2020-05-15 12:51:45 DEBUG install Use 'apt autoremove' to remove it. 2020-05-15 12:51:45 DEBUG install The following additional packages will be installed: 2020-05-15 12:51:45 DEBUG install libsensors4 libsnmp-base libsnmp30 2020-05-15 12:51:45 DEBUG install Suggested packages: 2020-05-15 12:51:45 DEBUG install lm-sensors snmp-mibs-downloader snmpd 2020-05-15 12:51:45 DEBUG install The following NEW packages will be installed: 2020-05-15 12:51:45 DEBUG install libsensors4 libsnmp-base libsnmp30 lldpd 2020-05-15 12:51:45 DEBUG install 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. 2020-05-15 12:51:45 DEBUG install Need to get 1332 kB of archives. 2020-05-15 12:51:45 DEBUG install After this operation, 4828 kB of additional disk space will be used. 2020-05-15 12:51:45 DEBUG install Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libsensors4 amd64 1:3.4.0-4 [28.8 kB] 2020-05-15 12:51:45 DEBUG install Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsnmp-base all 5.7.3+dfsg-1.8ubuntu3.3 [224 kB] 2020-05-15 12:51:45 DEBUG install Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsnmp30 amd64 5.7.3+dfsg-1.8ubuntu3.3 [929 kB] 2020-05-15 12:51:45 DEBUG install Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 lldpd amd64 0.9.9-1ubuntu0.1 [150 kB] 2020-05-15 12:51:46 DEBUG install Fetched 1332 kB in 0s (2667 kB/s) 2020-05-15 12:51:47 DEBUG install Selecting previously unselected package libsensors4:amd64. (Reading database ... 35406 files and directories currently installed.) 2020-05-15 12:51:47 DEBUG install Preparing to unpack .../libsensors4_1%3a3.4.0-4_amd64.deb ... 2020-05-15 12:51:47 DEBUG install Unpacking libsensors4:amd64 (1:3.4.0-4) ... 2020-05-15 12:51:49 DEBUG install Selecting previously unselected package libsnmp-base. 2020-05-15 12:51:49 DEBUG install Preparing to unpack .../libsnmp-base_5.7.3+dfsg-1.8ubuntu3.3_all.deb ... 2020-05-15 12:51:49 DEBUG install Unpacking libsnmp-base (5.7.3+dfsg-1.8ubuntu3.3) ... 2020-05-15 12:51:53 DEBUG install Selecting previously unselected package libsnmp30:amd64. 2020-05-15 12:51:53 DEBUG install Preparing to unpack .../libsnmp30_5.7.3+dfsg-1.8ubuntu3.3_amd64.deb ... 2020-05-15 12:51:53 DEBUG install Unpacking libsnmp30:amd64 (5.7.3+dfsg-1.8ubuntu3.3) ... 2020-05-15 12:51:56 DEBUG install Selecting previously unselected package lldpd. 2020-05-15 12:51:56 DEBUG install Preparing to unpack .../lldpd_0.9.9-1ubuntu0.1_amd64.deb ... 2020-05-15 12:51:57 DEBUG install Unpacking lldpd (0.9.9-1ubuntu0.1) ... 2020-05-15 12:51:59 DEBUG install Setting up libsensors4:amd64 (1:3.4.0-4) ... 2020-05-15 12:52:00 DEBUG install Setting up libsnmp-base (5.7.3+dfsg-1.8ubuntu3.3) ... 2020-05-15 12:52:01 DEBUG install Setting up libsnmp30:amd64 (5.7.3+dfsg-1.8ubuntu3.3) ... 2020-05-15 12:52:02 DEBUG install Setting up lldpd (0.9.9-1ubuntu0.1) ... 2020-05-15 12:52:06 DEBUG install Created symlink /etc/systemd/system/multi-user.target.wants/lldpd.service → /lib/systemd/system/lldpd.service. 2020-05-15 12:52:07 DEBUG install Processing triggers for systemd (237-3ubuntu10.40) ... 2020-05-15 12:52:08 DEBUG install Processing triggers for man-db (2.8.3-2ubuntu0.1) ... 2020-05-15 12:52:09 DEBUG install Processing triggers for ureadahead (0.100.0-21) ... 2020-05-15 12:52:10 DEBUG install Processing triggers for libc-bin (2.27-3ubuntu1) ... 2020-05-15 12:52:15 INFO juju.worker.uniter.operation runhook.go:138 ran "install" hook 2020-05-15 12:52:16 INFO juju.worker.uniter resolver.go:130 found queued "leader-elected" hook 2020-05-15 12:52:19 INFO juju.worker.uniter.operation runhook.go:138 ran "leader-elected" hook 2020-05-15 12:52:21 INFO juju-log Running config-changed 2020-05-15 12:52:25 INFO juju.worker.uniter.operation runhook.go:138 ran "config-changed" hook 2020-05-15 12:52:27 INFO juju.worker.uniter resolver.go:130 found queued "start" hook 2020-05-15 12:52:29 INFO juju.worker.uniter.operation runhook.go:138 ran "start" hook 2020-05-15 12:52:29 INFO juju.worker.uniter.relation relations.go:553 joining relation "lldpd:juju-info ubuntu:juju-info" 2020-05-15 12:52:30 INFO juju.worker.uniter.relation relations.go:589 joined relation "lldpd:juju-info ubuntu:juju-info" 2020-05-15 12:52:33 INFO juju.worker.uniter.operation runhook.go:138 ran "juju-info-relation-joined" hook 2020-05-15 12:52:35 INFO juju.worker.uniter.operation runhook.go:138 ran "juju-info-relation-changed" hook

jhobbs commented 4 years ago

As discussed on IRC, this is not happening with juju 2.7, only with 2.6. It seems 2.7 changed the locale for hook execution.

ivoks commented 4 years ago

Workaround for juju 2.6 has been released.