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

confusing error from flux-kvs watch -d when key is not a directory #1625

Closed
grondo opened this issue Aug 22, 2018 · 3 comments
Closed

confusing error from flux-kvs watch -d when key is not a directory #1625

grondo opened this issue Aug 22, 2018 · 3 comments

Comments

@grondo
Copy link
Contributor

grondo commented Aug 22, 2018

$ flux kvs watch -d foo &
[1] 154993
$ flux kvs put foo=bar
flux-kvs: foo: invalid token near 'bar' (line 1 column 3)
[1]+  Exit 1                  flux kvs watch -d foo

flux-kvs should return a sensible error when -d is used and the returned key is not a directory.

(Actually the docs just say "if -d is specified, do not output key values", so I could be mistaken and this has nothing to do with foo being a directory and not a normal key)

@chu11
Copy link
Member

chu11 commented Aug 22, 2018

I think you found a really strange corner case, which at this moment I have no idea how it's occurring.

This works

>flux kvs watch -d foo &
[1] 43545
>flux kvs put foo=1
1

but this doesn't.

>flux kvs watch -d foo &
[1] 43545
>flux kvs put foo=be
flux-kvs: foo: invalid token near 'be' (line 1 column 2)

this works

>flux kvs watch -d foo &
[1] 48363
>flux kvs put foo.a=bar
foo.a
======================

but this doesn't

>flux kvs watch -d foo.a &
[1] 49347
>flux kvs put foo.a=bar
flux-kvs: foo.a: invalid token near 'bar' (line 1 column 3)

@chu11
Copy link
Member

chu11 commented Sep 1, 2018

This bug was annoying me so decided to look into it. The issue has to do with the fact that the watch code still assumes all data is json formatted. With flux-kvs get & put we have options like --json or --raw. But it appears flux-kvs watch still only assumes json. So we probably need to copy the get options over to watch. So for example, this works:

>flux kvs watch -d foo &
[1] 86747
>flux kvs put --json foo=bar
bar

@chu11
Copy link
Member

chu11 commented Sep 12, 2018

once #1556 and possibly a few other issues (#1651 , #1653) are complete, this bug may likely be fixed.

Although we should add tests for this specific scenario.

chu11 added a commit to chu11/flux-core that referenced this issue Feb 13, 2019
chu11 added a commit to chu11/flux-core that referenced this issue Feb 13, 2019
chu11 added a commit to chu11/flux-core that referenced this issue Feb 13, 2019
chu11 added a commit to chu11/flux-core that referenced this issue Feb 14, 2019
@grondo grondo closed this as completed in dc57ae5 Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants