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

something wrong with decode json kv.value #126

Open
findmark opened this issue Mar 24, 2021 · 3 comments · May be fixed by #176
Open

something wrong with decode json kv.value #126

findmark opened this issue Mar 24, 2021 · 3 comments · May be fixed by #176

Comments

@findmark
Copy link

hi, I use the newest version but I got the following issue:

2021/03/24 09:25:19 [error] 6112#54059: *13 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/resty/etcd/v3.lua:487: attempt to index field 'serializer' (a nil value)

I believe serializer default is json as the doc mention in v3.md. Nvm, I set it to json manually, but I got error message instead , I believe is the same issue.

2021/03/24 09:20:19 [error] 5976#50240: *13 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/resty/etcd/v3.lua:487: attempt to call field 'deserialize' (a nil value)

Could you help look into this? Thanks in advance

@findmark
Copy link
Author

I just figure this out by looking into the source code, require this when new etcd instance, not sure is the correct way to handle this.
image
Also, the option here maybe need a little bit ajust or give a brief example would be much better.

@spacewander
Copy link
Contributor

@Yiyiyimu
Would you take a look at this issue? Thanks!

@Yiyiyimu
Copy link
Contributor

Hi @findmark sorry I lost track on this issue, hope it's not too late 😬

Actually, the accepted option for serializer is json and raw. As you could find in the test code

local etcd, err = require("resty.etcd").new({
protocol = "v3",
serializer = "raw"
})

And yes the documentation is a bit confusing 🤦 If you got time, welcome draft a PR to refine it~

u5surf added a commit to u5surf/lua-resty-etcd that referenced this issue Oct 11, 2022
* Fix api7#126
* cause to conform to v3.md

Signed-off-by: u5surf <u5.horie@gmail.com>
@u5surf u5surf linked a pull request Oct 11, 2022 that will close this issue
u5surf added a commit to u5surf/lua-resty-etcd that referenced this issue Oct 11, 2022
* Fix api7#126
* cause to conform to v3.md

Signed-off-by: u5surf <u5.horie@gmail.com>
u5surf added a commit to u5surf/lua-resty-etcd that referenced this issue Oct 12, 2022
* Fix api7#126
* cause to conform to v3.md

Signed-off-by: u5surf <u5.horie@gmail.com>
u5surf added a commit to u5surf/lua-resty-etcd that referenced this issue Oct 12, 2022
* Fix api7#126
* cause to conform to v3.md

Signed-off-by: u5surf <u5.horie@gmail.com>
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

Successfully merging a pull request may close this issue.

3 participants