Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charmcraft promote: charmcraft internal error: 1 validation error for ReleaseResult #264

Closed
carlcsaposs-canonical opened this issue Jan 29, 2025 · 4 comments
Assignees
Labels
Bug Something isn't working triaged

Comments

@carlcsaposs-canonical
Copy link

Bug Description

charmcraft promote results in charmcraft internal error: 1 validation error for ReleaseResult

To Reproduce

charmcraft promote --name test-foo-78162872490613847017 --from-channel=latest/edge --to-channel=latest/beta

Environment

Ubuntu 22.04

charmcraft.yaml

N/A

Relevant log output

ubuntu@j36-1:~$ charmcraft promote --name test-foo-78162872490613847017 --from-channel=latest/edge --to-channel=latest/beta
charmcraft promote does not have a stable CLI interface. Use with caution in scripts.
The following revisions are on the latest/edge channel:
  Revision  Platforms           Resource revisions
        17  [email protected]:amd64  mysql-router-image: 2
        18  [email protected]:arm64  mysql-router-image: 2
Do you want to promote these revisions to the latest/beta channel? [y/N]: y
charmcraft internal error: 1 validation error for ReleaseResult
resources.0.type
  Field required [type=missing, input_value={'name': 'mysql-router-image', 'revision': 2}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/missing
Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20250129-090957.815649.log'
ubuntu@j36-1:~$ cat /home/ubuntu/.local/state/charmcraft/log/charmcraft-20250129-090957.815649.log
2025-01-29 09:09:57.816 Starting charmcraft, version 3.4.0
2025-01-29 09:09:57.816 Log verbosity level set to BRIEF
2025-01-29 09:09:57.817 Preparing application...
2025-01-29 09:09:57.817 Configuring application...
2025-01-29 09:09:57.818 Setting up ConfigService
2025-01-29 09:09:57.834 Build plan: platform=None, build_for=None
2025-01-29 09:09:57.835 Running charmcraft promote on host
2025-01-29 09:09:57.835 charmcraft promote does not have a stable CLI interface. Use with caution in scripts.
2025-01-29 09:09:57.835 Setting up StoreService
2025-01-29 09:09:57.967 Falling back to file based storage
2025-01-29 09:09:58.102 Getting token from keyring
2025-01-29 09:09:58.102 Getting candid from credential storage
2025-01-29 09:09:58.102 Retrieving credentials for 'charmcraft' on 'api.charmhub.io' from keyring 'auth FileKeyring'.
2025-01-29 09:09:58.102 Adding ephemeral token to request headers
2025-01-29 09:09:58.590 The following revisions are on the latest/edge channel:
2025-01-29 09:09:58.590 Emitter: Pausing control of the terminal
2025-01-29 09:09:58.592 Emitter: Resuming control of the terminal
2025-01-29 09:09:58.592 Emitter: Pausing control of the terminal
2025-01-29 09:10:01.541 Emitter: Resuming control of the terminal
2025-01-29 09:10:01.542 Adding ephemeral token to request headers
2025-01-29 09:10:02.234 charmcraft internal error: 1 validation error for ReleaseResult
2025-01-29 09:10:02.235 resources.0.type
2025-01-29 09:10:02.235   Field required [type=missing, input_value={'name': 'mysql-router-image', 'revision': 2}, input_type=dict]
2025-01-29 09:10:02.235     For further information visit https://errors.pydantic.dev/2.9/v/missing
2025-01-29 09:10:02.238 Traceback (most recent call last):
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_application/application.py", line 673, in run
2025-01-29 09:10:02.238     return_code = self._run_inner()
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_application/application.py", line 654, in _run_inner
2025-01-29 09:10:02.238     return_code = dispatcher.run() or os.EX_OK
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 527, in run
2025-01-29 09:10:02.238     return self._loaded_command.run(self._parsed_command_args)
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/charmcraft/application/commands/store.py", line 987, in run
2025-01-29 09:10:02.238     promotion_results = store.release_promotion_candidates(
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/charmcraft/services/store.py", line 294, in release_promotion_candidates
2025-01-29 09:10:02.238     return self.release(name, requests)
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/charmcraft/services/store.py", line 235, in release
2025-01-29 09:10:02.238     return self._publisher.release(name, requests=requests)
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_store/publisher/_publishergw.py", line 261, in release
2025-01-29 09:10:02.238     return [
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_store/publisher/_publishergw.py", line 262, in <listcomp>
2025-01-29 09:10:02.238     ReleaseResult.unmarshal(rel)
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/craft_store/models/_base_model.py", line 51, in unmarshal
2025-01-29 09:10:02.238     return cls.model_validate(data)
2025-01-29 09:10:02.238   File "/snap/charmcraft/5901/lib/python3.10/site-packages/pydantic/main.py", line 596, in model_validate
2025-01-29 09:10:02.238     return cls.__pydantic_validator__.validate_python(
2025-01-29 09:10:02.238 pydantic_core._pydantic_core.ValidationError: 1 validation error for ReleaseResult
2025-01-29 09:10:02.239 resources.0.type
2025-01-29 09:10:02.239   Field required [type=missing, input_value={'name': 'mysql-router-image', 'revision': 2}, input_type=dict]
2025-01-29 09:10:02.239     For further information visit https://errors.pydantic.dev/2.9/v/missing
2025-01-29 09:10:02.239 Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20250129-090957.815649.log'
@carlcsaposs-canonical carlcsaposs-canonical added the Bug Something isn't working label Jan 29, 2025
@lucabello
Copy link

+1, I was also able to reproduce!

@lengau
Copy link
Collaborator

lengau commented Jan 29, 2025

Thanks for the report! I'm going to transfer this over to craft-store for boring technical reasons, but I can see exactly where the issue is.

@lengau lengau transferred this issue from canonical/charmcraft Jan 29, 2025
@lengau lengau added the triaged label Jan 29, 2025
@lengau lengau self-assigned this Jan 29, 2025
Copy link

Thank you for reporting your feedback to us!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-4032.

This message was autogenerated

carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Feb 5, 2025
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Feb 5, 2025
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Feb 5, 2025
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Feb 5, 2025
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Feb 5, 2025
@lengau
Copy link
Collaborator

lengau commented Feb 5, 2025

This is fixed in craft-store 3.2.1, which will be included in charmcraft 3.4.1.

@lengau lengau closed this as completed Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

3 participants