ubuntu IoT - webcam-demo 1.0.2 - apparmor="DENIED" operation="open" profile="webcam-demo.canonical_webcam-demo_1.0.2" name="/dev/video0" pid=3898 comm="fswebcam" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0

Bug #1583975 reported by Marc de Wit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Undecided
Unassigned

Bug Description

Installed the webcam-demo from the Snappy store.

Result: does not work

When trying to put it into complain mode:
sudo apparmor_parser -C /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2
AppArmor parser error for /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 in /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 at line 45: syntax error, unexpected TOK_MODE, expecting TOK_OPEN

System info
===========

# Hardware
raspberry pi 2

# Software
snappy info
release: ubuntu-core/15.04/stable
architecture: armhf
frameworks: webdm.canonical
apps: webcam-demo.canonical

snappy list -v
Name Date Version Developer
ubuntu-core 2016-02-25 10 ubuntu*
ubuntu-core 2016-01-28 7 ubuntu
webcam-demo 2016-05-20 1.0.2 canonical*
webdm 2016-01-28 0.11 canonical*
pi2 2016-01-28 0.16 canonical
pi2 2016-05-18 0.17 canonical*

# Error from dmegs log
dmesg
...
Linux video capture interface: v2.00
gspca_main: v2.14.0 registered
gspca_main: STV06xx-2.14.0 probing 046d:08f6
gspca_stv06xx: st6422 sensor detected
input: STV06xx as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/input/input0
usbcore: registered new interface driver STV06xx
usbcore: registered new interface driver snd-usb-audio
...
audit: type=1400 audit(1463569585.615:10): apparmor="DENIED" operation="capable" profile="webcam-demo.canonical_webcam-demo_1.0.2" pid=820 comm="golang-static-h" capability=12 capname="net_admin"
[Fri May 20 08:05:11 2016] audit: type=1400 audit(1463731511.984:11): apparmor="DENIED" operation="open" profile="webcam-demo.canonical_webcam-demo_1.0.2" name="/dev/video0" pid=821 comm="fswebcam" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
...

# System
ls -l /dev/video0
crw-rw---- 1 root video 81, 0 May 18 11:05 /dev/video0

systemctl status
...
<E2><94><82> <E2><94><9C><E2><94><80>webcam-demo_webcam-demo_1.0.2.service
           <E2><94><82> <E2><94><82> <E2><94><9C><E2><94><80> 817 /bin/sh /apps/webcam-demo.canonical/1.0.2/bin/webcam-webui
           <E2><94><82> <E2><94><82> <E2><94><9C><E2><94><80> 820 golang-static-http
           <E2><94><82> <E2><94><82> <E2><94><94><E2><94><80>4291 sleep 10
...

How can I fix this? Thank you.

Changed in snappy:
assignee: nobody → Marc de Wit (marc-de-wit)
assignee: Marc de Wit (marc-de-wit) → nobody
description: updated
Revision history for this message
Zygmunt Krynicki (zyga) wrote : Re: [Bug 1583975] [NEW] ubuntu IoT - webcam-demo 1.0.2 - apparmor="DENIED" operation="open" profile="webcam-demo.canonical_webcam-demo_1.0.2" name="/dev/video0" pid=3898 comm="fswebcam" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
Download full text (6.2 KiB)

Hi

Can you please install the snap using: snap install --devmode instead
(don't manipulate apparmor rules manually, that's not enough for
"devmode")

Best regards
ZK

On Fri, May 20, 2016 at 10:57 AM, Marc de Wit <email address hidden> wrote:
> Public bug reported:
>
> Installed the webcam-demo from the Snappy store.
>
> Result: does not work
>
> When trying to put it into complain mode:
> sudo apparmor_parser -C /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2
> AppArmor parser error for /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 in /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 at line 45: syntax error, unexpected TOK_MODE, expecting TOK_OPEN
>
> System info
> ===========
>
> # Hardware
> raspberry pi 2
>
> # Software
> snappy info
> release: ubuntu-core/15.04/stable
> architecture: armhf
> frameworks: webdm.canonical
> apps: webcam-demo.canonical
>
> snappy list -v
> Name Date Version Developer
> ubuntu-core 2016-02-25 10 ubuntu*
> ubuntu-core 2016-01-28 7 ubuntu
> webcam-demo 2016-05-20 1.0.2 canonical*
> webdm 2016-01-28 0.11 canonical*
> pi2 2016-01-28 0.16 canonical
> pi2 2016-05-18 0.17 canonical*
>
> # Error from dmegs log
> dmesg
> ...
> Linux video capture interface: v2.00
> gspca_main: v2.14.0 registered
> gspca_main: STV06xx-2.14.0 probing 046d:08f6
> gspca_stv06xx: st6422 sensor detected
> input: STV06xx as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/input/input0
> usbcore: registered new interface driver STV06xx
> usbcore: registered new interface driver snd-usb-audio
> ...
> audit: type=1400 audit(1463569585.615:10): apparmor="DENIED" operation="capable" profile="webcam-demo.canonical_webcam-demo_1.0.2" pid=820 comm="golang-static-h" capability=12 capname="net_admin"
> [Fri May 20 08:05:11 2016] audit: type=1400 audit(1463731511.984:11): apparmor="DENIED" operation="open" profile="webcam-demo.canonical_webcam-demo_1.0.2" name="/dev/video0" pid=821 comm="fswebcam" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
> ...
>
> # System
> ls -l /dev/video0
> crw-rw---- 1 root video 81, 0 May 18 11:05 /dev/video0
>
> systemctl status
> ...
> <E2><94><82> <E2><94><9C><E2><94><80>webcam-demo_webcam-demo_1.0.2.service
> <E2><94><82> <E2><94><82> <E2><94><9C><E2><94><80> 817 /bin/sh /apps/webcam-demo.canonical/1.0.2/bin/webcam-webui
> <E2><94><82> <E2><94><82> <E2><94><9C><E2><94><80> 820 golang-static-http
> <E2><94><82> <E2><94><82> <E2><94><94><E2><94><80>4291 sleep 10
> ...
>
> How can I fix this? Thank you.
>
> ** Affects: snappy
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> Installed the webcam-demo from the Snappy store.
>
> Result: does not work
>
> When trying to put it into complain mode:
> sudo apparmor_parser -C /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2
> AppArmor parser error for /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 in /var/lib/snappy/seccomp/profiles/webcam-demo.canonical_webcam-demo_1.0.2 at line 45: syntax error, unexpected TOK_MO...

Read more...

Revision history for this message
Marc de Wit (marc-de-wit) wrote :
Download full text (3.2 KiB)

Ok, i found this webpage, https://developer.ubuntu.com/en/snappy/guides/appliance-builder-guide-webcam/.

# This command
sudo snappy hw-assign webcam-demo.canonical /dev/video0
'webcam-demo.canonical' is now allowed to access '/dev/video0'

Unplugged the logitech webcam, and plugged in in again.

# RESULT
Now it works, but its not working perfect.

I have to do some debugging on the system

# dmesg log
[ 771.583689] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
[ 771.677621] usb 1-1.4: New USB device found, idVendor=046d, idProduct=08f6
[ 771.677648] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 771.677664] usb 1-1.4: Product: Camera
[ 771.679323] gspca_main: STV06xx-2.14.0 probing 046d:08f6
[ 771.679356] gspca_stv06xx: st6422 sensor detected
[ 771.948525] input: STV06xx as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/input/input1
[ 779.056919] Transfer to device 5 endpoint 0x2 frame 1291 failed - FIQ reported NYET. Data may have been lost.
[ 779
...
[ 810.523626] gspca_main: ISOC data error: [0] len=0, status=-63
...
[ 1378.697621] Transfer to device 5 endpoint 0x1 frame 788 failed - FIQ timed out. Data may have been lost.
[ 1378.728381] gspca_main: ISOC data error: [0] len=0, status=-63
[ 1389.183261] dwc_otg_hcd_handle_hc_fsm: 3 callbacks suppressed
[ 1389.183289] Transfer to device 5 endpoint 0x2 frame 1032 failed - FIQ reported NYET. Data may have been lost.
[ 1389.199272] Transfer to device 5 endpoint 0x2 frame 1048 failed - FIQ reported NYET. Data may have been lost.
[ 1389.215509] Transfer to device 5 endpoint 0x2 frame 1065 failed - FIQ reported NYET. Data may have been lost.

sudo systemctl status -l webcam-demo_webcam-demo_1.0.2.service
● webcam-demo_webcam-demo_1.0.2.service - webcam service that provides a webserver and takes snapshots every 10 seconds
   Loaded: loaded (/etc/systemd/system/webcam-demo_webcam-demo_1.0.2.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-05-20 12:14:54 UTC; 2min 41s ago
 Main PID: 2646 (webcam-webui)
   CGroup: /system.slice/webcam-demo_webcam-demo_1.0.2.service
           ├─2646 /bin/sh /apps/webcam-demo.canonical/1.0.2/bin/webcam-webui
           ├─2647 golang-static-http
           └─2935 sleep 10

May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: /dev/video0 opened.
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: No input was specified, using the first.
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: Adjusting resolution from 384x288 to 324x240.
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: --- Capturing frame...
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: Captured frame in 0.00 seconds.
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: --- Processing captured image...
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: Fontconfig error: Cannot load default config file
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: Unable to load font 'sans': fontconfig: Couldn't find font.
May 20 12:17:31 localhost.localdomain ubuntu-core-launcher[2646]: Disabling the the banner....

Read more...

Revision history for this message
Marc de Wit (marc-de-wit) wrote :

I think some parameters are wrong for my webcam. See picture.

Changed in snappy:
status: New → Invalid
Changed in snappy:
status: Invalid → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

This is "in-progress" for a long time, is this status still valid?

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The device /dev/video0 will be available to snaps that connect the camera interface plug. I'm marking this bug as fix released on the premise that the interface exist, it grants the permission and I don't expect this bug to see more activity.

Please feel free to reopen and engage with us. We are very sorry for not responding to this issue earlier.

Changed in snappy:
status: In Progress → Fix Released
affects: snappy → snapd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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