observer-mdns fails on unicode issue

Bug #1773698 reported by Mark Shuttleworth on 2018-05-27
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
High
Björn Tillenius
2.4
High
Björn Tillenius

Bug Description

I see this in logs with 2.4.0:

May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: Traceback (most recent call last):
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/maas/maas-common", line 87, in <module>
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: main()
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/maas/maas-common", line 83, in main
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: run()
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/maas/maas-common", line 52, in run
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: from provisioningserver.__main__ import main
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/__main__.py", line 55, in <module>
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: main()
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/script.py", line 91, in __call__
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: self.execute(argv)
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/script.py", line 86, in execute
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: args.handler.run(args)
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/avahi.py", line 221, in run
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: _observe_mdns(reader, output, args.verbose)
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/avahi.py", line 145, in _observe_mdns
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: for event in observer(events):
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/avahi.py", line 161, in _observe_resolver_found
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: for event in filter(_p_resolver_found, events):
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3/dist-packages/provisioningserver/utils/avahi.py", line 125, in _extract_mdns_events
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: for event in map(parse_avahi_event, lines):
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: File "/usr/lib/python3.6/codecs.py", line 321, in decode
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: (result, consumed) = self._buffer_decode(data, self.errors, final)
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [info] observe-mdns: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 276: invalid start byte
May 27 16:39:53 maas-1 sh[27877]: 2018-05-27 16:39:53 provisioningserver.utils.services: [critical] mDNS observation process failed.
May 27 16:39:53 maas-1 sh[27877]: #011Traceback (most recent call last):
May 27 16:39:53 maas-1 sh[27877]: #011Failure: twisted.internet.error.ProcessTerminated: A process has ended with a probable error condition: process ended with exit code 1.
May 27 16:39:53 maas-1 sh[27877]: #011

Related branches

Changed in maas:
milestone: none → 2.4.1
milestone: 2.4.1 → 2.5.0
importance: Undecided → High
status: New → Triaged
Andres Rodriguez (andreserl) wrote :

I did more investigation on this, and found [1]. As per Mike, this is an issue where avahi is sending unicode, when it probably shouldn't [3]. That said, MAAS should be bullet proof and deal with this case and not just crash the way it has.

[1]: https://bugs.launchpad.net/maas/+bug/1752737
[2]: https://bugs.launchpad.net/maas/+bug/1752737/comments/1
[3]: https://github.com/lathiat/avahi/issues/169

The measure of software quality is how it deals with the unexpected, so
let's focus on MAAS quality ;)

Changed in maas:
assignee: nobody → Björn Tillenius (bjornt)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: 2.5.0 → 2.5.0alpha1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.