Apparmor DENIED for library module

My snap fails on access to library module.

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/core/6132/lib/arm-linux-gnueabihf/libc-2.23.so" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/core/6132/lib/arm-linux-gnueabihf/libc-2.23.so (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/core/6132/lib/arm-linux-gnueabihf/libpthread-2.23.so" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/core/6132/lib/arm-linux-gnueabihf/libpthread-2.23.so (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/core/6132/lib/arm-linux-gnueabihf/libdl-2.23.so" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/core/6132/lib/arm-linux-gnueabihf/libdl-2.23.so (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/core/6132/lib/arm-linux-gnueabihf/libutil-2.23.so" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/core/6132/lib/arm-linux-gnueabihf/libutil-2.23.so (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/core/6132/lib/arm-linux-gnueabihf/libm-2.23.so" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/core/6132/lib/arm-linux-gnueabihf/libm-2.23.so (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Jan 1 03:59:46
Log: apparmor=“DENIED” operation=“open” profile=“snap.python2-jamesh.python” name="/snap/python-helloworld/x1/usr/bin/python-helloworld.py" pid=4361 comm=“python” requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0
File: /snap/python-helloworld/x1/usr/bin/python-helloworld.py (read)
Suggestion:

  • adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

Your snap is trying to access another snap’s libraries (in this case core). It should instead access the files from /lib.

? how could the path be adjusted

The called script is python2-helloworld.py, with contents:
#!/snap/bin/python2-jamesh.python

print(“python2-helloworld”)

And the snapcraft.yaml, has contents:
name: python2-helloworld
version: ‘0.1’
summary: A python2 helloWorld
description: |
python2 helloWorld
Used to test how this app would run as a snap

grade: devel # must be ‘stable’ to release into candidate/stable channels
confinement: devmode # use ‘strict’ once you have the right plugs and slots

parts:
python2-helloworld:
source: ‘/home/amodster/JavadAndTanny/python2-helloworld.tar’
source-type: tar
# See ‘snapcraft plugins’
plugin: dump
organize:
‘*.py’ : usr/bin/

apps:
python2-helloworld:
command: usr/bin/python2-helloworld.py
plugs:
- network-bind
- network-control
- home

Thanks

It’s something in your runtime environment. Perhaps @sergiusens or someone else can shed more light on it.

It might just be something in there is hardcoding some paths considering the dump plugin is used.