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

bug: "snapcraft register foo" prints unfriendly error #4930

Closed
popey opened this issue Jul 19, 2024 · 2 comments · Fixed by #5035
Closed

bug: "snapcraft register foo" prints unfriendly error #4930

popey opened this issue Jul 19, 2024 · 2 comments · Fixed by #5035
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged

Comments

@popey
Copy link
Contributor

popey commented Jul 19, 2024

Bug Description

I want to register a snap. So I run snapcraft register foo. Snapcraft prints some boilerplate, asks for confirmation and then contacts the store, then prints an internal error full of \n and a couple of URLs. This could be a lot prettier.

To Reproduce

snapcraft register example-$(date +%Y%m%d)

Environment

$ snapcraft --version
snapcraft 8.3.1
$  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

snapcraft.yaml

N/A

Relevant log output

 snapcraft register example-$(date +%Y%m%d)
We always want to ensure that users get the software they expect
for a particular name.

If needed, we will rename snaps to ensure that a particular name
reflects the software most widely expected by our community.

For example, most people would expect 'thunderbird' to be published by
Mozilla. They would also expect to be able to get other snaps of
Thunderbird as '$username-thunderbird'.

Would you say that MOST users will expect 'example-20240719' to come from
you, and be the software you intend to publish there? [y/N]: y
snapcraft internal error: StoreServerError('Store operation failed:\n- name-review-required: All snap names are currently subject to a review. Please see https://forum.snapcraft.io/t/manual-review-of-all-new-snap-name-registrations/39440 for details.\nFollow this link to submit a name request for your snap: https://dashboard.snapcraft.io/register-snap')
Full execution log: '/home/alan/.local/state/snapcraft/log/snapcraft-20240719-215118.776921.log'

Additional context

Perhaps just printing the return from the store as a section might look nicer.

$ snapcraft register example-$(date +%Y%m%d)
We always want to ensure that users get the software they expect
for a particular name.

If needed, we will rename snaps to ensure that a particular name
reflects the software most widely expected by our community.

For example, most people would expect 'thunderbird' to be published by
Mozilla. They would also expect to be able to get other snaps of
Thunderbird as '$username-thunderbird'.

Would you say that MOST users will expect 'example-20240719' to come from
you, and be the software you intend to publish there? [y/N]: y

Store error:
Store operation failed:
All snap names are currently subject to a review. 
Please see https://forum.snapcraft.io/t/manual-review-of-all-new-snap-name-registrations/39440 for details.
Follow this link to submit a name request for your snap: https://dashboard.snapcraft.io/register-snap

Full execution log: '/home/alan/.local/state/snapcraft/log/snapcraft-20240719-215118.776921.log'
@mr-cal
Copy link
Collaborator

mr-cal commented Jul 22, 2024

Thanks for the report. I think we need to do 2 things here:

  1. Instead of a SnapcraftInternalError, we should capture and raise a Store error
  2. Parse newlines and ensure the formatting looks good for store errors

@mr-cal mr-cal added bug Actual bad behavior that don't fall into maintenance or documentation triaged labels Jul 22, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants