serial-port interface: no feedback if symlink doesn't match expected pattern

Bug #1676492 reported by Kyle Fazzari on 2017-03-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
High
Unassigned

Bug Description

I have a gadget snap with the following interface:

    slots:
      kobuki:
        interface: serial-port
        path: /dev/kobuki
        usb-vendor: 0x0403
        usb-product: 0x6001

This represents the interface to the iClebo Kobuki from Yujin Robot. Its driver is configured by default to expect the device to be available at /dev/kobuki, so that's what I used for the path in the slot definition.

However, after I generated an image with this gadget and booted it, my interface was nowhere to be found. After a day, I learned by talking to people that this was due to regex used to validate the udev symlink: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/serial_port.go#L58 . Indeed, once I changed the path to /dev/serial-port-kobuki, this worked as expected.

This information was not given on the interface documentation (https://github.com/snapcore/snapd/wiki/Interfaces#serial-port), but more importantly, no feedback was provided to me at any point in the process about the fact that my slot was completely invalid. This experience could probably be improved. Snapd warns when installing an app snap with invalid interfaces, is there a reason it doesn't also warn when creating an image with a gadget snap with invalid interfaces?

Kyle Fazzari (kyrofa) on 2017-03-29
description: updated
Gustavo Niemeyer (niemeyer) wrote :

Topic was split out to cover the independent issues properly:

https://forum.snapcraft.io/t/the-serial-port-interface-fails-silently-with-a-bad-path/93

Michael Vogt (mvo) on 2018-01-04
Changed in snapd:
status: New → Triaged
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers