edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

better errors in `edgedb instance create`

Open 1st1 opened this issue 2 years ago • 8 comments

cc @raddevon @fantix @tailhook @elprans

A few issues:

  1. Currently, the message says:
CleanShot 2023-03-06 at 10 39 42@2x

I suggest the following wording:

Waiting for the 1st1/test instance to be created. This operation may take a few minutes.


  1. When ^C is hit we currently show:
CleanShot 2023-03-06 at 10 40 44@2x

We should do better than that; showing a warning log entry is no good. But even the log entry should read:

Exiting due to a keyboard interrupt (Ctrl+C)

But we should print a message, clarifying that we've only stopped waiting to hear back from the cloud:

Error: aborting the wait due to Ctrl+C. The 1st1/test instance is still pending to be created.


  1. When removing an instance we show the following error:
CleanShot 2023-03-06 at 10 44 56@2x

We should interpret the HTTP status code and report back:

Error: no instance named 1st1/test found.

  1. Creating an instance with an already used name:
CleanShot 2023-03-06 at 10 42 56@2x

Again, need to do a better job with error reporting. The tool should say

Error: an instance named 1st1/test already exists.


  1. The above screenshot also shows what happens when you need to confirm instance deletion and type anything but "yes". The tool just craps out with edgedb error: Canceled. We should instead say:

Cancelling deletion of 1st1/test. The operation was not confirmed with a "yes".

1st1 avatar Mar 06 '23 23:03 1st1

the deletion prompt is case-sensitive as well - I think we should either relax that to allow yes case-insensitively, or make the prompt / cancellation message more obvious about the case-sensitivity

$ edgedb instance destroy -I zackelan/foo
Do you really want to delete instance "zackelan/foo"? (type `Yes`)
> yes
edgedb error: Canceled.
$ edgedb instance destroy -I zackelan/foo
Do you really want to delete instance "zackelan/foo"? (type `Yes`)
> YES
edgedb error: Canceled.

zackelan avatar Mar 06 '23 23:03 zackelan

I think we should either relax that to allow yes case-insensitively

I'd go for case-insensitivity all all lower-case.

1st1 avatar Mar 07 '23 00:03 1st1

This looks pretty good. One suggestion:

Error: aborting the wait due to Ctrl+C. The 1st1/test instance is still pending to be created.

I'd suggest a slight tweak to sound a bit more natural.

Error: aborting the wait due to Ctrl+C. The 1st1/test instance is still being created.

Does this change the meaning subtly, or does it still work? Are we telling the user that creation is queued or that creation is currently happening? If the former, does the distinction matter?

I suspect it probably doesn't, but if it does, maybe this alternative:

Error: aborting the wait due to Ctrl+C. Creation of the 1st1/test instance is still pending.

raddevon avatar Mar 07 '23 12:03 raddevon

Note: when you hit Ctrl+C your request might not have reached the cloud. So it's technically possible that instance is not pending.

tailhook avatar Mar 07 '23 12:03 tailhook

Note: when you hit Ctrl+C your request might not have reached the cloud. So it's technically possible that instance is not pending.

Do we know when it have reached?

1st1 avatar Mar 08 '23 00:03 1st1

Do we know when it have reached?

Sure, if we got a response from server.

elprans avatar Mar 08 '23 00:03 elprans

My point was that there is still a time window in which we don't know whether it's pending or not. Other than that, we can have more granular abort messages, but I'm not sure if it worth it.

tailhook avatar Mar 08 '23 15:03 tailhook

also when instance creation fails:

> edgedb instance create zackelan/test(date --utc +%Y%m%d%H%M)
edgedb error: HTTP error: [422] Error rendering response.

zackelan avatar Mar 23 '23 18:03 zackelan