Charmcraft crashes with internal error when uploading outside of project directory
Metadata
Current evaluation
Charmcraft crashes with a RuntimeError after a successful upload when executed outside the project directory, and remains open awaiting a fix.
Suggested action: keep open
Reason: The issue is clearly labeled as triaged and represents a valid regression bug with clear reproduction steps and logs. Although inactive for over 6 months, it remains relevant and scoped, so it should be kept open for future implementation rather than closed.
Staleness:
68
Complexity:
45
Confidence:
90
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 |
|---|---|---|---|---|
| 2026-06-15 13:34:35.262697+00:00 | qwen3.6-35b-a3b-mtp-q6 |
Staleness:
68
Complexity:
45
Confidence:
90
Support Request:
0
|
keep open | Charmcraft crashes with a RuntimeError after a successful upload when executed outside the project directory, and remains open awaiting a fix. |
| 2026-06-15 13:32:00.310349+00:00 | pending | — | — | — |