Hi
I’m trying to update the Node-RED snap to use nodejs14 - but when it runs the same code as under node10 we get a write permissions error
11 Feb 08:55:59 - [warn] Error saving flows: EPERM: operation not permitted, copyfile '/root/snap/node-red/671/flows.json' -> '/root/snap/node-red/671/.flows.json.backup'
11 Feb 08:55:59 - [warn] Error: EPERM: operation not permitted, copyfile '/root/snap/node-red/671/flows.json' -> '/root/snap/node-red/671/.flows.json.backup'
The node10 version is in the node-red stable channel and the node14 version is in beta channel. The env var SNAP_USER_DATA=/root/snap/node-red/671 is set so why can the snap running as root no longer write to it’s own directory ?
Interesting. Can you attach the last 100 lines of dmes when the problem happens? Also which version of snapd is the system running (the output of snap version) and what is the output of snap debug sandbox-features
Given how the error message is worded, I suspect it’s using something like uv_fs_copyfile which tries copy_file_range under the hood, where the latter is not allowed in the seccomp template.
I’ll prepare a PR with a fix. In the meantime, you try to reinstall the snap in devmode. or patch the profile manually by editing /var/lib/snapd/seccomp/bfp/snap.node-red.node-red.src adding copy_file_range and then compile it by calling sudo /usr/lib/snapd/snap-seccomp compile /var/lib/snapd/seccomp/bfp/snap.node-red.node-red.{src,bin}.
err - not sure what that means… I use online snapcraft tool to build everything.
How long will it take for patch to filter through to there ?
(not a desperate problem as node10 in stable is ok for a while yet)
EDIT - aha - yes found them under …/bpf/… and yes now works locally - Thanks. Will wait for snapcraft fix before updating stable.
Once it lands, it should be available in snapd edge the following day at the latest. We have just released 2.49, but there will likely be 2.49.1 and I’ll make sure that it includes the fix too.
@mborzecki I am also facing the same issue once I changed confinement to strict from devmode.And its a custom node-red snap. As you pointed out I was checking the logs and saw the same syscall.