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

"Key Not Found" error removed in v3 #12627

Closed
Gunakk opened this issue Jan 18, 2021 · 5 comments
Closed

"Key Not Found" error removed in v3 #12627

Gunakk opened this issue Jan 18, 2021 · 5 comments
Assignees
Labels

Comments

@Gunakk
Copy link

Gunakk commented Jan 18, 2021

HI there,

I installed etcd v2 and etcd v3.4.0. Did etcdctl get for a non existing key in both. Got "Key not found" error in v2 and but, in v3 there isn't any response. May I know why this change was introduced ?

Thanks,
Guna

@ptabor
Copy link
Contributor

ptabor commented Jan 19, 2021

I don't know, but I would guess the motivation was to allow safer usage in scripting, like:

MY_KEY=$(etcdctl get mykey)

But, personally I would expect at least exit_code ~= 0 if no key matching the requirements was found.

@xiang90 What do you think about such contribution to: https://github.com/etcd-io/etcd/blob/master/etcdctl/ctlv3/command/get_command.go ? For backward compatibility it would need to be an opt-in flag.

@stale
Copy link

stale bot commented Apr 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 19, 2021
@xiang90
Copy link
Contributor

xiang90 commented Apr 19, 2021

But, personally I would expect at least exit_code ~= 0 if no key matching the requirements was found.

This should be better.

The motivation is to keep the stdout clean and consistent. So we do not print out "key not found" to stdout anymore in v3.

@stale stale bot removed the stale label Apr 19, 2021
@ptabor
Copy link
Contributor

ptabor commented Apr 19, 2021

Thank you @xiang90.
BTW: I approved similar (error-code) related contribution in: #12829

@stale
Copy link

stale bot commented Jul 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 18, 2021
@stale stale bot closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants