console-conf cannot support canX and crashes

Bug #1890397 reported by Robert Liu
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Fix Released
Undecided
Unassigned
probert (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Summary]
On Ubuntu Core 20, console-conf cannot support canX interfaces and crashes when can0 is available

[Steps to reproduce]
1. load the driver of CAN device
2. run console-conf

[Expected result]
console-conf shows the supported network devices

[Actual result]
console-conf crashes

## type of can0 is '???'
2020-08-05 06:25:50,732 DEBUG probert.network:671 link_change NEW {'ifindex': 4, 'flags': 262272, 'arptype': 280, 'family': 0, 'is_vlan': False, 'name': b'can0'}
2020-08-05 06:25:51,514 DEBUG subiquitycore.models.network:268 new_link 4 can0 ???
2020-08-05 06:25:51,515 DEBUG subiquitycore.models.network:294 new_link 4 can0 with config {}

## type '???' is not supported
2020-08-05 06:25:54,566 INFO console_conf/Network/apply_config:479 start: silent=True
2020-08-05 06:25:54,568 INFO console_conf/Network/apply_config:484 finish: '???' FAIL
2020-08-05 06:25:54,699 DEBUG subiquitycore.core:248 _exception_handler KeyError('???')
2020-08-05 06:25:54,703 ERROR subiquitycore.core:688 Exception in controller.run():
Traceback (most recent call last):
  File "/usr/share/subiquity/subiquitycore/core.py", line 686, in run
    self.urwid_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 286, in run
    self._run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 384, in _run
    self.event_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 1484, in run
    reraise(*exc_info)
  File "/usr/lib/python3/dist-packages/urwid/compat.py", line 58, in reraise
    raise value
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/share/subiquity/subiquitycore/async_helpers.py", line 26, in _done
    fut.result()
  File "/usr/share/subiquity/subiquitycore/controllers/network.py", line 384, in _apply_config
    self._write_config()
  File "/usr/share/subiquity/subiquitycore/controllers/network.py", line 340, in _write_config
    config = self.render_config()
  File "/usr/share/subiquity/subiquitycore/controllers/network.py", line 337, in render_config
    return self.model.render_config()
  File "/usr/share/subiquity/subiquitycore/models/network.py", line 369, in render_config
    key = type_to_key[dev.type]
KeyError: '???'

[Failure rate]
100%

[Environment]
Hardware: A Raspberry Pi based device with CAN
Software:
  - armhf UC20 image
  - core20 snap rev. 633
  - snapd v2.45.2, rev. 8544

Revision history for this message
Robert Liu (robertliu) wrote :
Revision history for this message
Robert Liu (robertliu) wrote :

I added '???' to NETDEV_IGNORED_IFACE_TYPES in subiquity/subiquitycore/models/network.py manually, then console-conf can ignore can0 and display other interfaces correctly.

Revision history for this message
Robert Liu (robertliu) wrote :

a better way is: add the mapping for CAN to _compute_type() in probert/network.py as well as add 'can' and '???' to NETDEV_IGNORED_IFACE_TYPES in subiquity/subiquitycore/models/network.py

Revision history for this message
Robert Liu (robertliu) wrote :

Opened corresponding PRs on github.

1. subiquity - https://github.com/CanonicalLtd/subiquity/pull/810
2. probert - https://github.com/canonical/probert/pull/93

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks, I merged your PRs

Revision history for this message
Robert Liu (robertliu) wrote :

Hi @mwhudson,

Thanks for your help. Do you want me to file bugs and send patches for SRU?

Also, do you have an ETA that these updates will be landed in core20 snap? Because CE team has some deliveries are blocked by this issue. Currently we use a patched core20 snap as temporary workaround.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi, we don't maintain console-conf in the archive any more so no need for an SRU. You should probably talk to xnox about when it gets to core20 -- I think we just need to merge main to the core/focal branch, or cherry-pick the needed commits.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package probert - 0.0.20

---------------
probert (0.0.20) groovy; urgency=medium

  [ Ryan Harper ]
  * Run wrap-and-sort on debian dir
  * debian/control: Change probert-storage Architecture to any to allow
    binary arch dependencies
  * Add dasd files to probert-common and probert-storage install files
  * multipath: use non-whitespace to split output
  * Makefile: use python3 and be virtenv friendly
  * lvm: don't use vgscan --mknodes

  [ Michael Hudson-Doyle ]
  * cope with block devices with no MAJOR in udev
  * introduce and use a sane_block_devices helper that checks for MAJOR
  * fix tests, thanks ryan
  * have dry run mode supply some fake scan results

  [ Tsunghan Liu (Robert Liu) ]
  * Support CAN interfaces (LP: #1890397)

  [ Paride Legovini ]
  * d/control:
    - drop Build-Depends on pyflakes (not needed) (LP: #1879731)
    - drop Build-Depends on pep8 (not actually used)
    - set Rules-Requires-Root: no
    - bump the dh compat level to 13 via debhelper-compat
    - bump Standards-Version to 4.5.0 (no changes needed)
    - fix the bin packages short descriptions
    - drop the XSBC-Original-Maintainer field
  * d/rules:
    - drop the PYBUILD environment variables (not needed)
    - drop explicit dh_missing --fail-missing (default in compat >=12)
    - include pkg-info.mk instead of parsing d/changelog
    - build with DEB_BUILD_MAINT_OPTIONS = hardening=+all
    - drop the get-orig-source target
  * d/copyright: use the versioned format URI

 -- Paride Legovini <email address hidden> Fri, 22 May 2020 19:00:47 +0200

Changed in probert (Ubuntu):
status: New → Fix Released
Revision history for this message
Paride Legovini (paride) wrote :

Hi Robert,

The patches landed in probert and subiquity, so this should be fixed in the latest version of the subiquity snap. Can you please confirm? Thanks!

no longer affects: subiquity (Ubuntu)
Changed in subiquity:
status: New → Incomplete
Revision history for this message
Robert Liu (robertliu) wrote :

Hi Paride,

I verified the crash issue does exist in core20 snap on the edge channel. To be precise, the revisions I tried are 823 for amd64 and 826 for armhf.
So I think we can close this bug.
Thank you!

Paride Legovini (paride)
Changed in subiquity:
status: Incomplete → 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.