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

UTF-8 Issue with latest Protobuf version #177

Closed
jvsteiner opened this issue Jul 29, 2018 · 5 comments · Fixed by #183
Closed

UTF-8 Issue with latest Protobuf version #177

jvsteiner opened this issue Jul 29, 2018 · 5 comments · Fixed by #183
Assignees

Comments

@jvsteiner
Copy link

jvsteiner commented Jul 29, 2018

Hi, I have a small demo project for go-libp2p-examples that I am working on, but I am getting the following error from this library (at commit 0073e12019dfda0816c596ca03bd915e4b849d21):

09:46:42.106  INFO        dht: error writing message, trying again:  proto: invalid UTF-8 string dht_net.go:271
09:46:42.106  INFO        dht: error writing message, bailing:  proto: invalid UTF-8 string dht_net.go:268
09:46:42.107  INFO        dht: error writing message, trying again:  proto: invalid UTF-8 string dht_net.go:271
09:46:42.107  INFO        dht: error writing message, bailing:  proto: invalid UTF-8 string dht_net.go:268
09:46:42.107 WARNI        dht: Multiple errors: proto: invalid UTF-8 string, proto: invalid UTF-8 string dht_bootstrap.go:122

I believe this might have something to do with a bug fixed recently over at the go protobuf implementation: issue here

basically, go-protobuf didn't enforce strings must be UTF, new versions do, and my theory is that something in this implementation sends a non-UTF string, somewhere in a protobuf during bootstrapping.

I have protobuf v3.6.0 installed.

@jvsteiner
Copy link
Author

jvsteiner commented Jul 29, 2018

some simple investigation reveals DHT keys, though typed as string, contain unprintable characters at a minimum, and are probably just arbitrary bytes - seems like actual bytes type might be a better choice in the .proto - dunno if this is a viable approach...

@Stebalien
Copy link
Member

Yeah, we should probably change this. However, we want to use string in go because go strings are just immutable byte slices. I believe there is a way to specify the "go" type but I can't remember how.

@jvsteiner
Copy link
Author

I dont know of such an option, but then, that doesn't mean much. I get why you'd want to use a string, but not sure it's possible...

@Harrywang55666
Copy link

Protobuf with version: v1.0.0 revision: 1adfc126b41513cc696b209667c8656ea7aac67c is OK.

@gfanton
Copy link

gfanton commented Aug 4, 2018

Hello, Is there a way to hotfix this without changing the protobuf version?

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.

4 participants