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

Include missing key in error message for KV store #3779

Merged
merged 2 commits into from
Aug 22, 2018

Conversation

camelpunch
Copy link
Contributor

What does this PR do?

The generic missing-key error message that comes from valkeyrie doesn't point the operator at the key that's missing. Several folk, including myself, have spent time figuring out what that missing key is. When setting up TLS there's a further potential confusion between KV store keys and TLS keys!

See #2712 for an example issue that might have gone smoother with this more detailed logging.

Motivation

I spent several hours debugging this, and that time could've been saved by knowing what the missing key was.

More

No tests / docs updated. I don't believe this warrants a test.

I began running the tests but had to go do something else before they finished!

Additional Notes

Worth checking that the format string is safe with all possible return values.

@@ -78,7 +78,7 @@ func (d *Datastore) watchChanges() error {
stopCh := make(chan struct{})
kvCh, err := d.kv.Watch(d.lockKey, stopCh, nil)
if err != nil {
return err
return fmt.Errorf("%v: %s", err, d.lockKey)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a sentence here like error while watching key %s: %v

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@camelpunch camelpunch requested review from a team as code owners August 22, 2018 12:14
@ldez ldez added kind/bug/fix a bug fix and removed bot/no-merge labels Aug 22, 2018
@ldez ldez changed the base branch from master to v1.7 August 22, 2018 12:14
@ldez ldez removed request for a team August 22, 2018 12:14
Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@camelpunch camelpunch deleted the missing-key-in-error branch August 22, 2018 14:20
@jjsaunier
Copy link

Why not simply bootstrap etcd with lock and object when the etcd entry is present ? It's so much complicated to "pre bootstrap" etcd by playing one time script ... Don't understand this choice to throw an error that say "you need to bootstrap" rather than auto bootstrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants