← Back to issue list

SCP formatted git source cause infinite loading when packing

View original Github issue

Metadata

Project
craft-parts
Number
#1058
Type
issue
State
open
Author
alesancor1
Labels
Created
Updated
Closed

Current evaluation

Git source with SCP-style URL (github.com:user/repo) hangs forever during pull when the clone would fail, because ssh prompts for host-key confirmation in the managed instance. Untriaged, no maintainer activity for ~17 months; code path still present.

Suggested action: needs triage

Reason: No labels, no comments, no maintainer interaction in 516 days, so it has never been triaged. The bug is still reproducible in current code: GitSource._clone_new() runs git clone via process_run() (craft_parts/utils/os_utils.py:339) which pipes stdout but leaves stdin interactive, so ssh's host-key prompt ('Are you sure you want to continue connecting?') blocks forever in the managed instance instead of failing fast; the log in the issue shows exactly that prompt followed by an endless 'Pulling test'. A fix (e.g. GIT_SSH_COMMAND with BatchMode=yes or stdin=DEVNULL) is small but needs maintainer acknowledgement first.

Impact: 55 Quick Win: 35.75 Staleness: 80 Complexity: 35 Confidence: 70 Support Request: 5

Issue body

### Bug Description When trying to use a SCP formatted string as the `source` with `git` as the `source-type`, it hangs during pull stage. This happen when the clone operation is expected to fail, for example: ```yaml source-type: git source: github.com:user/repo ``` will cause an infinite loading, while running `git clone github.com:user/repo` on the host will produce the following error: ``` Cloning into 'repo'... user@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` I would expect `pack` operation to fail as well, since the `source` repo could not be cloned due to permission error. > [!NOTE] > All the [git url formats](https://git-scm.com/docs/git-clone#_git_urls) are expected to work, according to the comment here: https://github.com/canonical/craft-parts/blob/c3104da15e84f103f0a62549edfd660b2c2cb295/craft_parts/sources/git_source.py#L309-L317 ### To Reproduce Tested with `Rockcraft`, using this `rockcraft.yaml`: ```yaml name: git-test version: "latest" summary: test-git-source description: test git source base: bare build-base: ubuntu@24.04 platforms: amd64: parts: test: plugin: nil source-type: git source: github.com:alesancor1/api-requester ``` Then running `rockcraft pack` ### part yaml ```shell parts: test: plugin: nil source-type: git source: github.com:alesancor1/api-requester ``` ### Relevant log output ```shell Starting rockcraft, version 1.9.0.post5+gadb3031.d20250319 Logging execution to '/home/alex/.local/state/rockcraft/log/rockcraft-20250402-124504.680382.log' Launching managed ubuntu 24.04 instance... Creating instance from base instance Starting instance Starting rockcraft, version 1.9.0.post5+gadb3031.d20250319 Logging execution to '/tmp/rockcraft.log' Extracting bare:latest Extracted bare:latest Initialising lifecycle Installing build-packages Pulling pebble The authenticity of host 'github.com (140.82.121.4)' can't be established. ED25519 key fingerprint is SHA256:+DiYvvV6TuJJhbF/zDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Pulling test / (326.0s) ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 55
Quick Win: 35.75
Staleness: 80
Complexity: 35
Confidence: 70
Support Request: 5
needs triage Git source with SCP-style URL (github.com:user/repo) hangs forever during pull when the clone would fail, because ssh prompts for host-key confirmation in the managed instance. Untriaged, no maintainer activity for ~17 months; code path still present.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 5
close stale Bug where SCP-formatted git URLs cause an infinite hang during the pull stage instead of failing with a permission error. Untriaged and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 75
Support Request: 10
needs triage SCP-formatted git URLs cause infinite hangs during pack instead of failing with permission errors. Unlabeled, no maintainer response, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 30
Confidence: 90
Support Request: 10
needs triage SCP-formatted git URLs hang indefinitely during pack instead of failing on clone errors. Unlabeled, unassigned, and inactive for over a year. Needs triage and proper error handling implementation in the git source parser.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#933 pulling repository can hang execution indefinitely craft-parts open Git source pull hangs indefinitely when repo is private/nonexistent because git prompts for credentials with no way to provide them. Reported Dec 2024, no maintainer response, no fix found in current code.
71%