← Back to issue list

Failed to pull source: unable to determine source type of '/usr/share/snapcraft/extensions/ros2'

View original Github issue

Metadata

Project
snapcraft-rocks
Number
#109
Type
issue
State
open
Author
jkbeg
Labels
Type: Bug Status: Triaged
Created
Updated
Closed

Current evaluation

Snapcraft 8 Docker image (ghcr.io/canonical/snapcraft:8_core22) fails to resolve ros2 extension: get_extensions_data_dir() returns /usr/share/snapcraft/extensions but extensions live in site-packages. Triaged, acknowledged by maintainer, workaround shared, still open.

Suggested action: keep open

Reason: Maintainer @lengau acknowledged on 2025-10-10 that 'we're not organizing the extension scripts to somewhere where they'd be expected' and created internal ticket SNAPCRAFT-1249, so the issue is triaged and valid. The code still hardcodes Path(sys.prefix)/'share'/'snapcraft'/'extensions' in extension.py, and a community workaround (symlink) was posted 2026-01-29, confirming the bug persists. The Dockerfile was removed in #5063 in favor of the snapcraft-rocks registry, so the fix likely belongs in snapcraft-rocks image packaging, but the underlying path mismatch remains unfixed.

Impact: 50 Quick Win: 30.0 Staleness: 55 Complexity: 40 Confidence: 80 Support Request: 10

Issue body

Initially opened this issue https://github.com/canonical/snapcraft/issues/5721 Since I did not get any response I suspect it was the wrong repository to address the docker issue. ### Bug Description Snapcraft fails to find its own extensions: ``` 2025-08-22T07:04:11.745Z [snapcraft] Initializing parts lifecycle 2025-08-22T07:04:13.827Z [snapcraft] **Failed to pull source: unable to determine source type of '/usr/share/snapcraft/extensions/ros2'.** 2025-08-22T07:04:13.828Z [snapcraft] Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20250822-070411.734995.log' 2025-08-22T07:04:13.956Z [pebble] Service "snapcraft" stopped unexpectedly with code 1 ``` extensions path is hardcoded here: `usr/share/snapcraft/extensions` https://github.com/canonical/snapcraft/blob/df4ec6775a28d4a345c93d9f83a1193c0abc1c9d/snapcraft/extensions/extension.py#L135 but in latest docker container for snapcraft 8, ghcr.io/canonical/snapcraft:8_core22 (24050a02f9fe) extensions are located here: `/usr/lib/python3.10/site-packages/extensions/ros2` ### To Reproduce ```bash git clone https://github.com/snapcraft-docs/ros2-talker-listener-core22.git cd ros2-talker-listener-core22 docker run -v $(pwd):/project ghcr.io/canonical/snapcraft:8_core22 ``` ### Environment Ubuntu 22.04 LTS, Docker 28.3.1 ### snapcraft.yaml ```yaml name: ros2-talker-listener version: '0.1' summary: ROS 2 Talker/Listener Example description: | This example launches a ROS 2 talker and listener. confinement: devmode base: core22 parts: ros-demos: plugin: colcon source: https://github.com/ros2/demos.git source-branch: humble source-subdir: demo_nodes_cpp stage-packages: [ros-humble-ros2launch] apps: ros2-talker-listener: command: opt/ros/humble/bin/ros2 launch demo_nodes_cpp talker_listener.launch.py extensions: [ros2-humble] ``` ### Relevant log output ```shell docker run -v $(pwd):/project ghcr.io/canonical/snapcraft:8_core22 2025-08-22T07:04:05.252Z [pebble] Started daemon. 2025-08-22T07:04:05.284Z [pebble] POST /v1/services 16.330855ms 202 (http+unix) 2025-08-22T07:04:05.300Z [pebble] Service "snapcraft" starting: /bin/run-snapcraft.sh [ pack ] 2025-08-22T07:04:05.305Z [snapcraft] 2025-08-22T07:04:05.305Z [snapcraft] WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 2025-08-22T07:04:05.305Z [snapcraft] 2025-08-22T07:04:05.777Z [snapcraft] Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] 2025-08-22T07:04:05.922Z [snapcraft] Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] 2025-08-22T07:04:05.938Z [snapcraft] Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] 2025-08-22T07:04:05.981Z [snapcraft] Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] 2025-08-22T07:04:06.031Z [snapcraft] Get:5 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB] 2025-08-22T07:04:06.080Z [snapcraft] Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB] 2025-08-22T07:04:06.249Z [snapcraft] Get:7 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB] 2025-08-22T07:04:06.272Z [snapcraft] Get:8 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB] 2025-08-22T07:04:06.298Z [snapcraft] Get:9 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [48.5 kB] 2025-08-22T07:04:06.317Z [pebble] GET /v1/changes/1/wait 1.032101461s 200 (http+unix) 2025-08-22T07:04:06.318Z [pebble] Started default services with change 1. 2025-08-22T07:04:06.408Z [snapcraft] Get:10 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1271 kB] 2025-08-22T07:04:06.948Z [snapcraft] Get:11 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [5235 kB] 2025-08-22T07:04:07.779Z [snapcraft] Get:12 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [3253 kB] 2025-08-22T07:04:08.583Z [snapcraft] Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [5430 kB] 2025-08-22T07:04:09.285Z [snapcraft] Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1575 kB] 2025-08-22T07:04:09.452Z [snapcraft] Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [75.9 kB] 2025-08-22T07:04:09.465Z [snapcraft] Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3569 kB] 2025-08-22T07:04:09.856Z [snapcraft] Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [83.2 kB] 2025-08-22T07:04:09.860Z [snapcraft] Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [35.2 kB] 2025-08-22T07:04:09.986Z [snapcraft] Fetched 40.9 MB in 5s (8818 kB/s) 2025-08-22T07:04:09.986Z [snapcraft] Reading package lists... 2025-08-22T07:04:10.683Z [snapcraft] Building dependency tree... 2025-08-22T07:04:10.813Z [snapcraft] Reading state information... 2025-08-22T07:04:10.827Z [snapcraft] 8 packages can be upgraded. Run 'apt list --upgradable' to see them. 2025-08-22T07:04:11.745Z [snapcraft] Initializing parts lifecycle 2025-08-22T07:04:13.827Z [snapcraft] Failed to pull source: unable to determine source type of '/usr/share/snapcraft/extensions/ros2'. 2025-08-22T07:04:13.828Z [snapcraft] Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20250822-070411.734995.log' 2025-08-22T07:04:13.956Z [pebble] Service "snapcraft" stopped unexpectedly with code 1 2025-08-22T07:04:13.956Z [pebble] Service "snapcraft" on-failure action is "shutdown", triggering failure shutdown 2025-08-22T07:04:13.956Z [pebble] Server exiting! Reason: <nil> ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 30.0
Staleness: 55
Complexity: 40
Confidence: 80
Support Request: 10
keep open Snapcraft 8 Docker image (ghcr.io/canonical/snapcraft:8_core22) fails to resolve ros2 extension: get_extensions_data_dir() returns /usr/share/snapcraft/extensions but extensions live in site-packages. Triaged, acknowledged by maintainer, workaround shared, still open.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 27.0
Staleness: 50
Complexity: 40
Confidence: 75
Support Request: 10
keep open Snapcraft 8 Docker image (snapcraft-rocks) installs extensions under site-packages but code expects /usr/share/snapcraft/extensions, breaking all extension usage. Triaged, acknowledged by maintainer, workaround via symlink provided, no fix yet.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 20
Confidence: 85
Support Request: 0
keep open Bug report for snapcraft Docker image where extension paths are misconfigured, causing build failures. Triaged and acknowledged by maintainers, with a community workaround provided but no official fix yet.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 30
Confidence: 85
Support Request: 10
keep open Snapcraft fails to locate extensions in Docker due to a hardcoded path mismatch. Triaged and acknowledged by maintainers, with a community workaround provided but no official fix yet.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 25
Confidence: 90
Support Request: 0
keep open Snapcraft fails to locate extensions in Docker due to a hardcoded path mismatch. Triaged and acknowledged. A symlink workaround exists, but a permanent fix remains pending.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/snapcraft#5721 (confidence 90%)

    Same error message and root cause; this issue explicitly states it was initially opened as #5721 and moved here because the Docker image is built in this repo.

  • Related To: canonical/snapcraft#5063 (confidence 75%)

    Removed the in-repo Dockerfile in favor of the snapcraft-rocks registry, shifting where the image packaging (and thus the extensions directory layout) is controlled.

Related issues

Issue Project State Summary Similarity
#5721 Failed to pull source: unable to determine source type of '/usr/share/snapcraft/extensions/ros2'. snapcraft open Snapcraft 8 Docker image fails to resolve ros2 extension: get_extensions_data_dir() returns /usr/share/snapcraft/extensions but extensions are installed under site-packages/extensions. Untriaged, no maintainer activity in 374 days; same bug tracked in snapcraft-rocks#109.
94%
#1968303 remote-build: support for snap relative sources snapcraft (launchpad) open Remote build fails when a part uses a snapcraft extension path ($SNAPCRAFT_EXTENSIONS_DIR/ros2) as its source, because the remote builder cannot determine the source type. Open since ~2021 with no labels, comments, or maintainer response.
71%