Electron snap works on Pi4 but throws mkdir error on Pi3

Hi,

We built an electron snap and it’s working 100% on the Pi4 running Core 18. When we try to run it on the Pi3 we get a mkdir error.

We are compiling the snap on a Pi4, but the build architecture in the yaml is snapcraft --target-arch=armhf which afaik should work for both the Pi3 and the Pi4?

The electron-hello-world-kiosk example also exhibits the same behaviour.

This is the output of the snap logs:

example@localhost:~$ snap logs “example-player”

2021-01-26T08:52:00Z example-player.example-player[2106]: mkdir: cannot create directory ‘/run/user/0’: Permission denied

2021-01-26T08:52:00Z example-player.example-player[2106]: mkdir: cannot create directory ‘/run/user/0’: Permission denied

2021-01-26T08:52:00Z systemd[1]: snap.example-player.example-player.service: Main process exited, code=exited, status=1/FAILURE

2021-01-26T08:52:00Z systemd[1]: snap.example-player.example-player.service: Failed with result ‘exit-code’.

2021-01-26T08:52:01Z systemd[1]: snap.example-player.example-player.service: Service hold-off time over, scheduling restart.

2021-01-26T08:52:01Z systemd[1]: snap.example-player.example-player.service: Scheduled restart job, restart counter is at 8.

2021-01-26T08:52:01Z systemd[1]: Stopped Service for snap application example-player.example-player.

2021-01-26T08:52:01Z systemd[1]: snap.example-player.example-player.service: Start request repeated too quickly.

2021-01-26T08:52:01Z systemd[1]: snap.example-player.example-player.service: Failed with result ‘exit-code’.

2021-01-26T08:52:01Z systemd[1]: Failed to start Service for snap application example-player.example-player.

–target-arch is kind of deprecated in favour of adding something like the below to your snapcraft.yaml:

if you want it to be able to run on arm64 too, you need to put libc6 into your stage-packages (else you can drop the “run-on” line)… also make sure you really build inside an armhf container …