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

Improve error messages #16

Open
neingeist opened this issue Mar 12, 2024 · 8 comments
Open

Improve error messages #16

neingeist opened this issue Mar 12, 2024 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@neingeist
Copy link

neingeist commented Mar 12, 2024

Bug description

When creating a workspace:
image

I believe I had a somewhat generic error message ("(Server error)") before.

This turned out to be:

image

What irritates me is the "Usage" printout here - could this be improved?

Steps to reproduce

Hard to reproduce, because this seems to happen when Hetzner has issues

Expected behaviour

Give a better error message.

Example repository

No response

Anything else?

No response

@neingeist neingeist added the bug Something isn't working label Mar 12, 2024
@mrsimonemms
Copy link
Owner

Unless I'm reading it wrong, the error is already printed out (the SSH key uniqueness error).

The usage error is Cobra's standard setting of outputting the usage after all errors - I think it's here in the docs.

I'm not against changing it, but it does seem like a lot of faff for not much benefit

@mrsimonemms mrsimonemms added enhancement New feature or request and removed bug Something isn't working labels Mar 12, 2024
@neingeist
Copy link
Author

Yes but this was a second error! After removing the SSH key manually via Hetzner's Web interface (probably some inconsistent state after the Hetzner problems today), I get the original error:

image

Any ideas on that?

@neingeist
Copy link
Author

neingeist commented Mar 12, 2024

Just for searchability: The screenshot says

info Error:   (server_error)

@neingeist
Copy link
Author

neingeist commented Mar 12, 2024

Ah, I had a volume from the wrong region left - after deleting that, creating the workspace worked again. And then I got confused by Hetzner's service issues.

I'm not sure if devpod-provider-hetzner can give better error messages than (server_error) in this case. Please decide if you want to keep the issue open.

@mrsimonemms
Copy link
Owner

Aaaah, now I understand the request - apologies.

It looks like it's a Hetzner error code.

I think there is an improvement that can be made, which is to put the Hetzner error into a nicer format - instead of just <err.code>, something like <err.code>: <err.message> - <err.details>. It might get a bit big, but I think I can do something better than what it is now.

Thanks for the clarification.

@neingeist
Copy link
Author

Thanks for the clarification.

Pleased to clarify ;) I had it mixed-up a bit first, due to multiple problems at once (my mistake of changing the region while not thinking about the volume, Hetzner's hickup today + the inconsistent state of the workspace/leftover SSH key).

@neingeist
Copy link
Author

neingeist commented Mar 12, 2024

I think there is an improvement that can be made, which is to put the Hetzner error into a nicer format - instead of just <err.code>, something like <err.code>: <err.message> - <err.details>. It might get a bit big, but I think I can do something better than what it is now.

That does sound like it would be an improvement, at least I would expect that Hetzner API would tell me what is wrong.

The actual problem might be easily reproducible by 1. changing the Hetzner region used in the provider and 2. rebuilding the workspace. I think this provider should then try to re-use the volume - and fail because of the region change. (I use DevPod and devpod-provider-hetzner since yesterday and might not understand the details properly.)

@mrsimonemms mrsimonemms added the good first issue Good for newcomers label Mar 15, 2024
@neingeist neingeist changed the title Improve error handling? Improve error messages Mar 15, 2024
@neingeist
Copy link
Author

A second thing I notice: The error was logged as info, should probably be at level error, if that's possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants