Ubuntu 18.04 and Permission denied when connecting Sunto Vyper with usb

942 views
Skip to first unread message

Audun Hansen

unread,
Aug 9, 2018, 6:45:56 PM8/9/18
to Subsurface Divelog
After upgrading to Ubuntu 18.04 (freshinstall) and Subsurface 4.8.1, I got trouble with communications with my computer.
Following message found in /var/log/syslog:
 systemd-udevd[5463]: Process '/usr/lib/snapd/snap-device-helper bind snap_subsurface_subsurface /devices/pci0000:00/0000:00:14.0/usb2/2-6 189:131' failed with exit code 1.
 subsurface_subsurface.desktop[5088]: [0.000016] ERROR: Permission denied (13) [in serial_posix.c:295 (dc_serial_open)]

What i found:
# ls -latr /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 aug.   9 23:44 /dev/ttyUSB0          <---  look at owner and permissionss

Dirtyfix, works just as long as the computer is connected:
# chown <my_username> /dev/ttyUSB0
Then import of dives works.

This seems like a Ubuntu spesific permission problem(?)

Linus Torvalds

unread,
Aug 9, 2018, 7:28:53 PM8/9/18
to Subsurface Divelog
On Thu, Aug 9, 2018 at 3:45 PM Audun Hansen <audu...@gmail.com> wrote:
>
> This seems like a Ubuntu spesific permission problem(?)

No, it's mentioned in the manual.

Make yourself part of the dialout group to get serial line access, and
then it's not a temporary fix any more.

Something like

sudo usermod -a -G dialout <username>

or similar.

Linus

Eloy Anguiano

unread,
Sep 3, 2018, 3:20:36 PM9/3/18
to Subsurface Divelog
 Dear Linus,

I am a linux user since 1992 and have experience as a linux administrator. In fact I have been director of the Linux Reference Center UAM-IBM for 10 years. 

As soon as the error occurred (and you know, without reading the manual, hahaha), I added myself to the dialout group and yet I still can't access /dev/ttyUSB0 which is where my Mares Puck Pro is mounted. In case there were any group update problem (which I shouldn't have, but just to be sure) I ran a new bash from the bash where I ran subsurface.

It is not a protocol problem because by running as root I can access and download the dives. I don't know what other problem there might be.

Just to check it out:

eloy@amaltea:~$ cat /etc/group | grep dialout
dialout:x:20:eloy
eloy@amaltea:~$ ls /dev/ttyUSB0 -la
crw-rw------ 1 root dialout 188, 0 Sep 3 21:10 /dev/ttyUSB0

I'd appreciate any indication.

Thank you very much for your attention.

Linus Torvalds

unread,
Sep 3, 2018, 5:22:10 PM9/3/18
to Subsurface Divelog
On Mon, Sep 3, 2018 at 12:20 PM Eloy Anguiano <eloy.a...@gmail.com> wrote:
>
> As soon as the error occurred (and you know, without reading the manual, hahaha), I added myself to the dialout group and yet I still can't access /dev/ttyUSB0 which is where my Mares Puck Pro is mounted. In case there were any group update problem (which I shouldn't have, but just to be sure) I ran a new bash from the bash where I ran subsurface.

You'd need to log in anew to get the group update, since it's the
login process that gives users permissions.

> It is not a protocol problem because by running as root I can access and download the dives. I don't know what other problem there might be.

That really indicates that it is just a permission issue, since it
works as root. So subsurface works fine in theory.

You could try to do the whole "strace -f" thing and then look for
ttyUSB0 in the resulting filesystem trace.

> Just to check it out:
>
> eloy@amaltea:~$ cat /etc/group | grep dialout
> dialout:x:20:eloy
> eloy@amaltea:~$ ls /dev/ttyUSB0 -la
> crw-rw------ 1 root dialout 188, 0 Sep 3 21:10 /dev/ttyUSB0

The real check would be to run 'id':

[torvalds@i7 ~]$ id
uid=1000(torvalds) gid=1000(torvalds)
groups=1000(torvalds),10(wheel),18(dialout)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

and checking that the dialout group is listed for your current shell session.

There *might* be some odd Ubuntu apparmor rule etc that keeps even
dialout from actually opening things. Ubuntu has had those kinds of
oddities before. See for example

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/677432

and if it's apparmor you should see some kind of audit log about it in
your system logs,

audit: ...: apparmor="DENIED" operation="open" .. name="/dev/ttyUSB0" ..

but I don't run Ubuntu and don't know what their security settings are.

So if it's not the dialout thing, you need to check the ubuntu forums
for apparmor.

Linus

Linus

Eloy Anguiano

unread,
Sep 3, 2018, 7:26:04 PM9/3/18
to Subsurface Divelog
Dear Linus

Problem solved. The problem was with apparmor. 

Thank you so much for your attention.

Dirk Hohndel

unread,
Sep 3, 2018, 7:43:45 PM9/3/18
to subsurfac...@googlegroups.com

> On Sep 3, 2018, at 4:26 PM, Eloy Anguiano <eloy.a...@gmail.com> wrote:
>
>
> Problem solved. The problem was with app armor.

Can you share the solution so we can document this for others?

Thanks

/D

Reply all
Reply to author
Forward
0 new messages