← Back to issue list

nodejs snap installed through stage-snaps is not usable in the final image

View original Github issue

Metadata

Project
rockcraft
Number
#307
Type
issue
State
open
Author
nrobinaubertin
Labels
—
Created
Updated
Closed
—

Current evaluation

Staged Node.js snaps lack their core20 dynamic loader in final Ubuntu OCI images. The lifecycle layer fix for usrmerge symlink collisions appears to resolve this.

Suggested action: close resolved

Reason: Commit 05489c80, associated with rockcraft#498, fixes lifecycle handling for usrmerge-breaking symlinks. Current rockcraft/layers.py preserves lower-layer directory symlinks and remaps staged paths, while the lifecycle documentation specifically identifies the /lib64/ld-linux-x86-64.so.2 loader failure; the report provides an exact reproducer and workaround.

Evaluated by: mr-cal-bot

Impact: 60 Quick Win: 26 Complexity: 55 Confidence: 96 Actionability: 96

Issue body

### Bug Description nodejs snap installed through stage-snaps is not usable in the final image without additional steps. For now, I need to use the following command to fix it inside the container: ``` mkdir -p /snap/core20/current/lib64/ && cp /lib64/ld-linux-x86-64.so.2 ``` ### To Reproduce ``` rockcraft pack --verbose rockfile="$(find . -name "*.rock" -printf "%f")" image_name="$(echo "$rockfile" | cut -d'_' -f1)" version="$(echo "$rockfile" | cut -d'_' -f2)" /snap/rockcraft/current/bin/skopeo --insecure-policy copy "oci-archive:$rockfile" "docker-daemon:$image_name:$version" ``` Using `docker run -it --rm --entrypoint bash localhost:32000/test:1.0` to shell-in the container allows me to try out `node --version` that fails. ### Environment uname -a ``` Linux t14 5.19.0-40-generic #41~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 31 16:00:14 UTC 2 x86_64 x86_64 x86_64 GNU/Linux ``` snap info rockcraft | tail ``` snap-id: 3mPIBn6L9IYLyBAZsaqjlnMk7huEtqlv tracking: latest/edge refresh-date: today at 11:43 EDT channels: latest/stable: – latest/candidate: – latest/beta: – latest/edge: 0+git.2148b5b 2023-06-27 (893) 86MB classic installed: 0+git.2148b5b (893) 86MB classic ``` ### rockcraft.yaml ```shell name: test summary: test description: test base: ubuntu:20.04 license: Apache-2.0 version: "1.0" platforms: amd64: parts: snap-test: plugin: nil stage-snaps: - node/18/stable ``` ### Relevant log output tty from inside the container: ```shell root@d25c34e99a0c:/# which node /usr/bin/node root@d25c34e99a0c:/# node --version bash: /usr/bin/node: No such file or directory root@d25c34e99a0c:/# ldd /usr/bin/node linux-vdso.so.1 (0x00007ffe0039e000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbf771a5000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbf76fc3000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbf76e74000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbf76e59000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbf76e36000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbf76c44000) /snap/core20/current/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007fbf7d098000) root@d25c34e99a0c:/# mkdir -p /snap/core20/current/lib64/ && cp /lib64/ld-linux-x86-64.so.2 /snap/core20/current/lib64/ld-linux-x86-64.so.2 root@d25c34e99a0c:/# node --version v18.16.1 ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 60
Quick Win: 26
Complexity: 55
Confidence: 96
Actionability: 96
close resolved Staged Node.js snaps lack their core20 dynamic loader in final Ubuntu OCI images. The lifecycle layer fix for usrmerge symlink collisions appears to resolve this.
stealth/space-bunny-alpha
Impact: 43
Quick Win: 16
Complexity: 57
Confidence: 88
Actionability: 87
needs triage A Node.js snap added through stage-snaps leaves the final rock with a missing core20 ELF loader, so /usr/bin/node cannot run; no maintainer triage or resolution is recorded.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 8
Complexity: 70
Confidence: 60
Actionability: 70
keep open Nodejs snap staged via stage-snaps fails in final rock image due to hardcoded /snap/core20/current/lib64/ld-linux-x86-64.so.2 path missing in container
qwen/qwen3.8-27b
Impact: 50
Quick Win: 18
Staleness: 75
Complexity: 65
Confidence: 55
Support Request: 10
needs triage Node.js snap staged via stage-snaps is unusable in the final rock image because the dynamic linker path /snap/core20/current/lib64/ld-linux-x86-64.so.2 is missing; reporter works around it by copying /lib64/ld-linux-x86-64.so.2. Unlabeled, no maintainer response, last activity 381 days ago.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 60
Confidence: 85
Support Request: 10
needs triage Node.js snap staged via stage-snaps fails to run in final Rockcraft image due to missing dynamic linker path. Untriaged, no maintainer response, open for over 3 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 55
Confidence: 80
Support Request: 15
needs triage Untriaged bug report regarding Node.js snap binaries failing to run in Rockcraft container images due to missing dynamic linker paths. Requires maintainer assessment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 60
Confidence: 85
Support Request: 10
needs triage Node.js snap staged via stage-snaps fails to run in final container image due to missing dynamic linker path. Unlabelled, no maintainer response, open for ~3 years.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: rockcraft#498 (confidence 96%)

    Commit 05489c80 addresses the OCI layer symlink collision that can hide the snap's dynamic loader; the current implementation matches the reported /lib64 failure mode.

Related issues

No related issues found above the similarity threshold.