"PermissionError: [Errno 13] Permission denied: 'node'" with container builds

Bug #1740269 reported by Alan Pope 🍺🐧🐱 🦄
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Cris Dywan

Bug Description

I have been building a node application (yaml below). I have set SNAPCRAFT_CONTAINER_BUILDS=1. Whenever I 'snapcraft clean' I get the following error:-

I'm using 2.38 (1008) from edge.

PermissionError: [Errno 13] Permission denied: 'node'

Seems snapcraft can't clean up it's own stuff when done with container builds due to permission issues?

name: twine
version: '2.2.1'
summary: Twine
description: |
  Twine is an open-source tool for telling interactive, nonlinear stories.

grade: stable
confinement: strict

parts:
  twine:
    plugin: nodejs
    source: https://bitbucket.org/klembot/twinejs
    source-type: hg
    build: |
      npm run nw
    install: |
      cp -a dist/nw $SNAPCRAFT_PART_INSTALL

description: updated
Revision history for this message
Leo Arias (elopio) wrote :

I thought that this would be fixed by https://github.com/snapcore/snapcraft/pull/1904, but I just saw a very similar error.

I was building this one: https://github.com/elopio/branch-diff/blob/snapcraft/snap/snapcraft.yaml
with SNAPCRAFT_CONTAINER_BUILDS=local

When I tried to run snapcraft clean, it failed with:
PermissionError: [Errno 13] Permission denied: 'node.1'

The permissions on the install directory are not correct:

ubuntu@juju-27a3d4-remote-devel-0:~/workspace/nodejs/branch-diff$ ls -lah parts/branch-diff/install/
total 180K
drwxr-xr-x 9 ubuntu ubuntu 4.0K Sep 25 18:06 .
drwxr-xr-x 8 ubuntu ubuntu 4.0K Feb 13 00:59 ..
drwxrwxr-x 2 1000500 1000500 4.0K Feb 13 01:00 bin
-rw-rw-r-- 3 1000500 1000500 55K Oct 3 16:50 CHANGELOG.md
drwxr-xr-x 6 ubuntu ubuntu 4.0K May 31 2017 etc
drwxrwxr-x 3 1000500 1000500 4.0K Oct 3 16:50 include
drwxrwxr-x 4 1000500 1000500 4.0K Oct 3 16:50 lib
-rw-rw-r-- 3 1000500 1000500 59K Oct 3 16:50 LICENSE
-rw-rw-r-- 3 1000500 1000500 26K Oct 3 16:50 README.md
drwxrwxr-x 5 1000500 1000500 4.0K Oct 3 16:50 share
drwxr-xr-x 5 ubuntu ubuntu 4.0K Sep 25 18:06 usr
drwxr-xr-x 3 ubuntu ubuntu 4.0K Oct 4 18:22 var

Changed in snapcraft:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Christian Dywan (kalikiana)
Revision history for this message
Leo Arias (elopio) wrote :

kalikiana, can you please take a look at this one?

I have my machine still available if you want me to collect some more info or try something.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Some general observations:
- Upstream has moved to https://github.com/klembot/twinejs
- nwjs-sdk-0.25.4-*.zip is pulled for every available platform

Indeed something about the permissions is off:

> ls -lA parts/twine/install
total 192K
drwxrwxr-x 2 1000500 1000500 4,0K Okt 3 18:50 bin
drwxr-xr-x 2 rumo rumo 4,0K Feb 20 13:28 etc
drwxrwxr-x 3 1000500 1000500 4,0K Okt 3 18:50 include
drwxrwxr-x 3 1000500 1000500 4,0K Okt 3 18:50 lib
drwxr-xr-x 3 rumo rumo 4,0K Feb 20 14:01 nw
drwxrwxr-x 5 1000500 1000500 4,0K Okt 3 18:50 share
-rw-rw-r-- 3 1000500 1000500 55K Okt 3 18:50 CHANGELOG.md
-rw-rw-r-- 3 1000500 1000500 59K Okt 3 18:50 LICENSE
-rw-rw-r-- 3 1000500 1000500 26K Okt 3 18:50 README.md

Changed in snapcraft:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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