Snapcraft hangs forever if a GitHub repository doesn't exist
Metadata
Current evaluation
Snapcraft hangs indefinitely on Pulling when a git source is missing/private because git prompts for credentials. Triaged by maintainers; fix identified (GIT_TERMINAL_PROMPT=0) but must be implemented in craft-parts, not yet done.
Suggested action: keep open
Reason: Maintainers actively triaged this (Status: Triaged label) and identified the fix: lengau noted 'We can set GIT_TERMINAL_PROMPT=0 in the environment, but I think that needs to be done by craft-parts.' A grep of craft-parts confirms GIT_TERMINAL_PROMPT is not yet set anywhere, so the bug remains unfixed. The issue is valid, scoped, and awaiting implementation in the upstream craft-parts dependency.
Impact:
50
Quick Win:
32.5
Staleness:
55
Complexity:
35
Confidence:
80
Support Request:
5
Issue body
### Bug Description
When source for a part is a GitHub repository which doesn't exist or is private and the user doesn't have GitHub credentials saved, snapcraft just hangs on `Pulling <part-name>....`. I tried waiting over an hour and it didn't even timeout. I'm assuming this is happening because `git` itself asks for username and password and waits for user input.
```bash
$ git clone --recursive https://github.com/somename/somerepo.git
Cloning into 'somerepo'...
Username for 'https://github.com':
```
### To Reproduce
- run `snapcraft`
### Environment
I'm running Snapcraft 8.10.2 on Ubuntu 24.04 LTS, using Multipass.
### snapcraft.yaml
```yaml
name: snapcraft-git-issue
base: core24
version: '0.1'
summary: Single-line elevator pitch for your amazing snap
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: stable
confinement: strict
parts:
my-part:
plugin: dump
source: https://github.com/somename/somerepo.git
```
### Relevant log output
```shell
:: 2025-08-01 16:10:05.219 verify plugin environment for part 'my-part'
:: 2025-08-01 16:10:05.222 Pulling my-part
:: 2025-08-01 16:10:05.224 execute action my-part:Action(part_name='my-part', step=Step.PULL, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None))
:: 2025-08-01 16:10:05.227 Executing: /snap/snapcraft/15369/libexec/snapcraft/craft.git clone --recursive https://github.com/somename/somerepo.git
:: 2025-08-01 16:10:05.466 :: Cloning into '/root/parts/my-part/src'...
:: 2025-08-01 16:15:57.636 Interrupted.
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.8-27b |
Impact:
50
Quick Win:
32.5
Staleness:
55
Complexity:
35
Confidence:
80
Support Request:
5
|
keep open | Snapcraft hangs indefinitely on Pulling when a git source is missing/private because git prompts for credentials. Triaged by maintainers; fix identified (GIT_TERMINAL_PROMPT=0) but must be implemented in craft-parts, not yet done. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
75
Complexity:
25
Confidence:
85
Support Request:
5
|
keep open | Snapcraft hangs indefinitely when cloning a non-existent or private GitHub repository without credentials. Triaged and acknowledged by maintainers, who suggest setting GIT_TERMINAL_PROMPT=0 to prevent the hang. Awaiting implementation. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
40
Confidence:
85
Support Request:
10
|
keep open | Valid bug where snapcraft hangs indefinitely when cloning non-existent or private GitHub repos without credentials. Triaged by maintainers who proposed setting GIT_TERMINAL_PROMPT=0, but remains inactive for over a year awaiting implementation. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
65
Complexity:
30
Confidence:
85
Support Request:
5
|
keep open | Snapcraft hangs indefinitely when cloning a non-existent or private GitHub repository without credentials, as git prompts for input. Triaged bug. Under discussion to implement GIT_TERMINAL_PROMPT=0 for immediate failure, likely requiring a craft-parts update. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2052928 Pulling from private repository without known_hosts hangs forever | snapcraft (launchpad) | open | SSH pull from private repo hangs when known_hosts is missing; SSH authenticity prompt is hidden by snapcraft progress bar. Untriaged, 935 days old. | |
| #2053119 Pulling from private repository with passphrase protected key fails | snapcraft (launchpad) | open | snapcraft --bind-ssh fails to prompt for passphrase when using passphrase-protected SSH keys to clone private repositories. Untriaged, no maintainer response after 933 days. | |
| #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. | |
| #2008777 timeout if doing snapcraft pull and build seperately | snapcraft (launchpad) | closed | A report detailing a hang when running snapcraft pull and build separately was closed without comments or resolution, indicating it was abandoned. No fix or workaround was provided. | |
| #2008502 mishandled private git+ssh repo url | snapcraft (launchpad) | open | Snapcraft 7.2.8 treats a git+ssh:// source URL as a local file path when cloning a private Launchpad repo, so git clone fails. No maintainer response in over 3 years; the pip-style scheme is invalid for git, which only accepts ssh:// or user@host:path forms. | |
| #2065801 Snapcraft hangs with no space left on device | snapcraft (launchpad) | open | Snapcraft hangs indefinitely when disk space runs out during shutil.copytree in craft-parts, instead of failing gracefully with an error. | |
| #1516228 missing " git://" in the source crashes the snapcraft | snapcraft (launchpad) | closed | Closed without resolution. The snapcraft crash from missing git:// source prefixes was abandoned. Modern snapcraft versions enforce explicit protocol specification or handle defaults gracefully. |