← Back to issue list

Charmcraft crashes with internal error when uploading outside of project directory

View original Github issue

Metadata

Project
charmcraft
Number
#2492
Type
issue
State
open
Author
morphis
Labels
Status: Triaged Type: Bug
Created
Updated
Closed
—

Current evaluation

Charmcraft 4.x uploads successfully outside a project directory, then crashes because post-upload project checks assume configuration; attempted fix PR #2497 was closed unmerged.

Suggested action: keep open

Reason: UploadCommand.needs_project correctly permits operation without charmcraft.yaml, but run() unconditionally calls project.get() after upload, causing the reported RuntimeError and preventing the release step. PR #2497 attempted the fix but was closed unmerged with CI failures and no resolving commit.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 36 Complexity: 30 Confidence: 97 Actionability: 93

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description When performing an upload of a charm with `charmcraft upload` outside of a directory with a `charmcraft.yaml`, then the upload succeeds but charmcraft crashes at the end with `RuntimeError("Project not configured yet.")`. This was not present with earlier versions (< 4.x) ### Steps to reproduce Take a `.charm` and run `charmcraft upload ./my.charm` from outside the directory where the `charmcraft.yaml` is located ### Environment Running on Ubuntu 25.10 ### charmcraft.yaml ```yaml n/a ``` ### Log output ```shell simon@ersa ~/W/anbox-cloud-charms (main)> charmcraft upload --release 1.28/edge --name aar ./aar_ubuntu@22.04-amd64.charm charmcraft internal error: RuntimeError('Project not configured yet.') Full execution log: '/home/simon/.local/state/charmcraft/log/charmcraft-20251126-161538.963709.log' simon@ersa ~/W/anbox-cloud-charms (main) [70]> cat '/home/simon/.local/state/charmcraft/log/charmcraft-20251126-161538.963709.log' 2025-11-26 16:15:38.964 Starting charmcraft, version 4.0.1 .... 2025-11-26 16:15:45.461 Setting up ProjectService 2025-11-26 16:15:45.461 charmcraft internal error: RuntimeError('Project not configured yet.') 2025-11-26 16:15:45.465 Traceback (most recent call last): 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/craft_application/application.py", line 663, in run 2025-11-26 16:15:45.465 return_code = self._run_inner() 2025-11-26 16:15:45.465 ^^^^^^^^^^^^^^^^^ 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/charmcraft/application/main.py", line 143, in _run_inner 2025-11-26 16:15:45.465 return super()._run_inner() 2025-11-26 16:15:45.465 ^^^^^^^^^^^^^^^^^^^^ 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/craft_application/application.py", line 640, in _run_inner 2025-11-26 16:15:45.465 return_code = dispatcher.run() or os.EX_OK 2025-11-26 16:15:45.465 ^^^^^^^^^^^^^^^^ 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 564, in run 2025-11-26 16:15:45.465 return self._loaded_command.run(self._parsed_command_args) 2025-11-26 16:15:45.465 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/charmcraft/application/commands/store.py", line 586, in run 2025-11-26 16:15:45.465 if project := self._services.get("project").get(): 2025-11-26 16:15:45.465 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-11-26 16:15:45.465 File "/snap/charmcraft/7517/lib/python3.12/site-packages/craft_application/services/project.py", line 605, in get 2025-11-26 16:15:45.465 raise RuntimeError("Project not configured yet.") 2025-11-26 16:15:45.466 RuntimeError: Project not configured yet. 2025-11-26 16:15:45.466 Full execution log: '/home/simon/.local/state/charmcraft/log/charmcraft-20251126-161538.963709.log' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 36
Complexity: 30
Confidence: 97
Actionability: 93
keep open Charmcraft 4.x uploads successfully outside a project directory, then crashes because post-upload project checks assume configuration; attempted fix PR #2497 was closed unmerged.
~deepseek/deepseek-pro-latest
Impact: 55
Quick Win: 35
Complexity: 25
Confidence: 90
Actionability: 85
keep open Upload outside a project directory crashes with RuntimeError('Project not configured yet.') after the upload succeeds; triaged, fix PR #2497 was closed unmerged.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 90
Actionability: 80
close resolved Charmcraft crashes with RuntimeError when running upload outside project directory. Fixed by PR #2497.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 28
Staleness: 65
Complexity: 30
Confidence: 70
Support Request: 0
close stale charmcraft upload crashes with RuntimeError('Project not configured yet.') when run outside a project directory; regression in 4.x from charmlibs warning feature. PR #2497 closed as fix.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 40
Confidence: 85
Support Request: 5
keep open Charmcraft crashes with RuntimeError after successful upload when run outside a project directory. Triaged bug, inactive for ~230 days, awaiting fix.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 5
keep open Charmcraft upload crashes with RuntimeError after successful upload when run outside the project directory. Triaged bug, inactive for ~7 months with only a Jira sync comment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 45
Confidence: 85
Support Request: 5
keep open Charmcraft v4.x crashes with RuntimeError after successful upload when run outside the project directory. Triaged bug, awaiting fix.

Update history

No update history recorded yet.

Related work

  • Related To: charmcraft#2497 (confidence 99%)

    PR #2497 attempted to fix this upload crash but was closed unmerged due to CI failures.

Related issues

No related issues found above the similarity threshold.