← 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 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.

Suggested action: close stale

Reason: PR #2497 ('Fix upload crash when run outside project directory') is closed and explicitly addresses this exact RuntimeError by adding configuration checks for the unconfigured project service. The issue is 275 days old with only a bot comment as activity, and the fix has been merged, making the issue no longer applicable.

Impact: 40 Quick Win: 28.0 Staleness: 65 Complexity: 30 Confidence: 70 Support Request: 0

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
qwen/qwen3.8-27b
Impact: 40
Quick Win: 28.0
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 30
Confidence: 85
Support Request: 5
keep open charmcraft upload crashes with RuntimeError after a successful upload when run outside the project directory. Introduced in v4.x. The bug is triaged, has an internal Jira ticket, and remains unassigned after 194 days of inactivity.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: charmcraft#2497 (confidence 80%)

    PR title and summary directly match this issue: 'Fixed charmcraft upload crash when run outside a project directory. Added configuration checks, unit tests, and a spread test to prevent RuntimeError when accessing an unconfigured project service.'

Related issues

Issue Project State Summary Similarity
#2497 Fix upload crash when run outside project directory charmcraft closed Fixed charmcraft upload crash when run outside a project directory. Added configuration checks, unit tests, and a spread test to prevent RuntimeError when accessing an unconfigured project service.
77%
#2707 Charmcraft confuses the current directory with the project directory when both has a charmcraft.yaml charmcraft open Regression in charmcraft 4.2.1 where 'charmcraft pack -p' fails if both CWD and project directory contain charmcraft.yaml. Untriaged, 101 days old.
71%