"PermissionError: [Errno 13] Permission denied" executing a snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Expired
|
Undecided
|
Unassigned |
Bug Description
I got the following error executing http-prompt as a snap in devmode on 16.04 on x86 64 bits desktop:
Traceback (most recent call last):
File "/snap/
load_
File "/home/
return self.main(*args, **kwargs)
File "/home/
_verify_
File "/home/
stderr=
File "/home/
restore_
File "/home/
raise child_exception
PermissionError: [Errno 13] Permission denied
The syslog shows this info:
sudo vim /var/log/syslog
Jun 30 15:24:43 haswell16 kernel: [218483.711411] audit: type=1400 audit(146729668
Jun 30 15:24:43 haswell16 kernel: [218483.712330] audit: type=1400 audit(146729668
Jun 30 15:24:43 haswell16 kernel: [218483.716641] audit: type=1400 audit(146729668
Jun 30 15:24:43 haswell16 kernel: [218483.868717] audit: type=1400 audit(146729668
When executing the http-prompt snap created with snapcraft (devmode):
name: http-prompt
version: "1.0"
summary: An interactive command-line HTTP client
description: An interactive command-line HTTP client featuring autocomplete and syntax highlighting
confinement: devmode
apps:
http-prompt:
command: http-prompt
plugs: [home, network, network-bind]
parts:
http-prompt:
source: https:/
plugin: python3
stage-packages: [libpython3.
"sudo /snap/http-
Will run the snap with no issues.
tags: | added: snapd-interface |
Changed in snappy: | |
status: | New → Incomplete |
The 'mounts' denial is likely just noise and can be ignored, but you can plug the 'mount-observe' interface to get rid of that denial.
I looked at the 'locale' command and see no reason why it couldn't be allowed in the default policy. I'll add that.
For ldconfig, it might be a harmless denial, but you may want to adjust your program to not use this.
Since the locale denial was last, I suggest you adjust /var/lib/ snapd/apparmor/ profiles/ snap.http- prompt. http-prompt to have before the final '}':
/usr/bin/locale ixr,
Then run: sudo apparmor_parser -r /var/lib/ snapd/apparmor/ profiles/ snap.http- prompt. http-prompt
You will still see the mounts and ldconfig denials, but perhaps your program will start to work.
Also, to unblock yourself while developing the snap, remember you can install with --devmode which disables the sandbox until such time that your snap is made to work under strict mode.