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

Version 3.0 received does match expected version 3.1 #105

Closed
littleningmeng opened this issue Nov 4, 2020 · 18 comments
Closed

Version 3.0 received does match expected version 3.1 #105

littleningmeng opened this issue Nov 4, 2020 · 18 comments

Comments

@littleningmeng
Copy link

2020/11/04 15:04:09 runner.go:426: Failed to connect to master(127.0.0.1:5557) with error gomq/zmtp: Got error while receiving greeting: Version 3.0 received does match expected version 3.1

@myzhan
Copy link
Owner

myzhan commented Nov 4, 2020

Becase gomq changed the protocol version to 3.1, you can try to downgrade gomq before this commit.

https://github.com/zeromq/gomq/pull/77/files

See also: zeromq/gomq#79

@littleningmeng
Copy link
Author

copy that, thanks

@franzramadhan
Copy link

franzramadhan commented Nov 18, 2020

Hi @myzhan I tried to downgrade and pin the version of gomq to github.com/zeromq/gomq v0.0.0-20181008000130-95dc37dee5c4 // indirect - zeromq/gomq@95dc37d

But still no luck. Do you have any other suggestion?

@myzhan
Copy link
Owner

myzhan commented Nov 18, 2020

@franzramadhan If you still get the same error logs, please check the version of gomq. And I'm considering to fork gomq because of the instability.

@wssnail
Copy link

wssnail commented Nov 19, 2020

@franzramadhan If you still get the same error logs, please check the version of gomq. And I'm considering to fork gomq because of the instability.
i got the same error, and i tried go build -tags 'goczmq' -o a.out main.go, get the error

# github.com/myzhan/boomer
../../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:43:8: dealer.SetOption undefined (type *goczmq.Sock has no field or method SetOption)
../../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:43:19: undefined: goczmq.SockSetIdentity

@myzhan
Copy link
Owner

myzhan commented Nov 19, 2020

Hi guys, I'm trying to make zeromq/gomq to work with pyzmq.

zeromq/gomq#80

@myzhan
Copy link
Owner

myzhan commented Nov 19, 2020

@wssnail Hi, I coun't reproduce your errors, which version of goczmq are you using?

I have tried these commands on my MBP, and it works.

brew install zeromq
brew install czmq
brew install libsodium
go get github.com/zeromq/goczmq
go run -tags 'goczmq' examples/main.go

@wssnail
Copy link

wssnail commented Nov 19, 2020

@wssnail Hi, I coun't reproduce your errors, which version of goczmq are you using?

I have tried these commands on my MBP, and it works.

brew install zeromq
brew install czmq
brew install libsodium
go get github.com/zeromq/goczmq
go run -tags 'goczmq' examples/main.go
require (
	github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
	github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect
	github.com/go-ole/go-ole v1.2.4 // indirect
	github.com/google/uuid v1.1.2 // indirect
	github.com/myzhan/boomer v0.0.0-20201113075110-e17d364d020f
	github.com/olekukonko/tablewriter v0.0.4 // indirect
	github.com/shirou/gopsutil v3.20.10+incompatible // indirect
	github.com/stretchr/testify v1.6.1 // indirect
	github.com/ugorji/go v1.2.0 // indirect
	github.com/zeromq/goczmq v4.1.0+incompatible // indirect
	github.com/zeromq/gomq v0.0.0-20201031135124-cef4e507bb8e // indirect
	github.com/zeromq/gomq/zmtp v0.0.0-20201031135124-cef4e507bb8e // indirect
	golang.org/x/sys v0.0.0-20201117222635-ba5294a509c7 // indirect
)

@wssnail Hi, I coun't reproduce your errors, which version of goczmq are you using?

I have tried these commands on my MBP, and it works.

brew install zeromq
brew install czmq
brew install libsodium
go get github.com/zeromq/goczmq
go run -tags 'goczmq' examples/main.go
require (
	github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
	github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect
	github.com/go-ole/go-ole v1.2.4 // indirect
	github.com/google/uuid v1.1.2 // indirect
	github.com/myzhan/boomer v0.0.0-20201113075110-e17d364d020f
	github.com/olekukonko/tablewriter v0.0.4 // indirect
	github.com/shirou/gopsutil v3.20.10+incompatible // indirect
	github.com/stretchr/testify v1.6.1 // indirect
	github.com/ugorji/go v1.2.0 // indirect
	github.com/zeromq/goczmq v4.1.0+incompatible // indirect
	github.com/zeromq/gomq v0.0.0-20201031135124-cef4e507bb8e // indirect
	github.com/zeromq/gomq/zmtp v0.0.0-20201031135124-cef4e507bb8e // indirect
	golang.org/x/sys v0.0.0-20201117222635-ba5294a509c7 // indirect
)

@franzramadhan
Copy link

franzramadhan commented Nov 24, 2020

@franzramadhan If you still get the same error logs, please check the version of gomq. And I'm considering to fork gomq because of the instability.

thanks for your suggestion. However still failed with below error log

❯ go build -tags 'goczmq' -o locust-worker .
# github.com/myzhan/boomer
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:43:8: dealer.SetOption undefined (type *goczmq.Sock has no field or method SetOption)
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:43:19: undefined: goczmq.SockSetIdentity

cross compile:

❯ GOOS=linux GOARCH=amd64 go build -tags 'goczmq' -o locust-worker .
go: finding module for package github.com/zeromq/goczmq
go: found github.com/zeromq/goczmq in github.com/zeromq/goczmq v4.1.0+incompatible
go build github.com/zeromq/goczmq: build constraints exclude all Go files in /Users/franscaisarramadhan/go/pkg/mod/github.com/zeromq/[email protected]+incompatible
     
require (
        github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05 // indirect
	github.com/aws/aws-sdk-go v1.25.3
	github.com/ghodss/yaml v1.0.0 // indirect
	github.com/google/uuid v1.1.1 // indirect
	github.com/mattn/go-runewidth v0.0.4 // indirect
	github.com/myzhan/boomer v0.0.0-20190713082008-307abf52aca9
	github.com/olekukonko/tablewriter v0.0.1 // indirect
	github.com/stretchr/testify v1.4.0
	github.com/tkanos/gonfig v0.0.0-20181112185242-896f3d81fadf // indirect
	github.com/ugorji/go v1.1.7 // indirect
	github.com/zeromq/goczmq v4.1.0+incompatible // indirect
	github.com/zeromq/gomq v0.0.0-20181008000130-95dc37dee5c4 // indirect
	gopkg.in/zeromq/goczmq.v4 v4.1.0 // indirect
)

@myzhan
Copy link
Owner

myzhan commented Nov 24, 2020

@franzramadhan @wssnail I think you should use goczmq v4.2.0 or master.

@wssnail
Copy link

wssnail commented Nov 24, 2020

@myzhan @franzramadhan perfect, goczmq v4.2.0 is worked , go get github.com/zeromq/[email protected] github.com/zeromq/goczmq v0.0.0-20190622112907-4715d4da6d4b // indirect

@franzramadhan
Copy link

franzramadhan commented Nov 24, 2020

@myzhan @wssnail works perfectly for native compile. But for cross compile to Linux AMD64 for example still failing

❯ GOOS=linux GOARCH=amd64 go build -tags 'goczmq' -o locust-worker .
# github.com/myzhan/boomer
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:17:16: undefined: goczmq.Sock
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:42:12: undefined: goczmq.NewSock
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:42:27: undefined: goczmq.Dealer
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:43:19: undefined: goczmq.SockSetIdentity
../../go/pkg/mod/github.com/myzhan/[email protected]/client_czmq.go:119:52: undefined: goczmq.FlagNone

go.mod

require (
	require (
	github.com/asaskevich/EventBus v0.0.0-20180315140547-d46933a94f05 // indirect
	github.com/aws/aws-sdk-go v1.25.3
	github.com/ghodss/yaml v1.0.0 // indirect
	github.com/google/uuid v1.1.1 // indirect
	github.com/mattn/go-runewidth v0.0.4 // indirect
	github.com/myzhan/boomer v0.0.0-20190713082008-307abf52aca9
	github.com/olekukonko/tablewriter v0.0.1 // indirect
	github.com/stretchr/testify v1.4.0
	github.com/tkanos/gonfig v0.0.0-20181112185242-896f3d81fadf // indirect
	github.com/ugorji/go v1.1.7 // indirect
	github.com/zeromq/gomq v0.0.0-20181008000130-95dc37dee5c4 // indirect
	github.com/zeromq/goczmq v0.0.0-20190622112907-4715d4da6d4b // indirect
)

@franzramadhan
Copy link

franzramadhan commented Nov 24, 2020

@myzhan @wssnail I tried to compile directly in my xenial box and got below error

franzramadhan@ip-10-2-136-95:~/$ go build -tags 'goczmq' -o locust-worker .


# github.com/zeromq/goczmq
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:138:9: could not determine kind of name for C.zsock_connect_timeout
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:244:9: could not determine kind of name for C.zsock_handshake_ivl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:43:9: could not determine kind of name for C.zsock_heartbeat_ivl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:69:9: could not determine kind of name for C.zsock_heartbeat_timeout
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:56:9: could not determine kind of name for C.zsock_heartbeat_ttl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:118:9: could not determine kind of name for C.zsock_invert_matching
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:170:9: could not determine kind of name for C.zsock_multicast_maxtpdu
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:231:3: could not determine kind of name for C.zsock_set_connect_rid
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:132:3: could not determine kind of name for C.zsock_set_connect_timeout
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:238:3: could not determine kind of name for C.zsock_set_handshake_ivl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:37:3: could not determine kind of name for C.zsock_set_heartbeat_ivl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:63:3: could not determine kind of name for C.zsock_set_heartbeat_timeout
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:50:3: could not determine kind of name for C.zsock_set_heartbeat_ttl
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:112:3: could not determine kind of name for C.zsock_set_invert_matching
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:164:3: could not determine kind of name for C.zsock_set_multicast_maxtpdu
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:253:3: could not determine kind of name for C.zsock_set_socks_proxy
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:105:3: could not determine kind of name for C.zsock_set_stream_notify
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:145:3: could not determine kind of name for C.zsock_set_tcp_maxrt
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:76:3: could not determine kind of name for C.zsock_set_use_fd
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:203:3: could not determine kind of name for C.zsock_set_vmci_buffer_max_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:190:3: could not determine kind of name for C.zsock_set_vmci_buffer_min_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:177:3: could not determine kind of name for C.zsock_set_vmci_buffer_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:216:3: could not determine kind of name for C.zsock_set_vmci_connect_timeout
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:89:3: could not determine kind of name for C.zsock_set_xpub_manual
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:266:3: could not determine kind of name for C.zsock_set_xpub_nodrop
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:125:3: could not determine kind of name for C.zsock_set_xpub_verboser
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:98:3: could not determine kind of name for C.zsock_set_xpub_welcome_msg
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:259:9: could not determine kind of name for C.zsock_socks_proxy
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:151:9: could not determine kind of name for C.zsock_tcp_maxrt
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:157:9: could not determine kind of name for C.zsock_thread_safe
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:82:9: could not determine kind of name for C.zsock_use_fd
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:209:9: could not determine kind of name for C.zsock_vmci_buffer_max_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:196:9: could not determine kind of name for C.zsock_vmci_buffer_min_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:183:9: could not determine kind of name for C.zsock_vmci_buffer_size
../go/pkg/mod/github.com/zeromq/[email protected]/sock_option.go:222:9: could not determine kind of name for C.zsock_vmci_connect_timeout
franzramadhan@ip-10-2-136-95:~/$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"

Seems related with this zeromq/goczmq#292

@myzhan
Copy link
Owner

myzhan commented Nov 24, 2020

@franzramadhan goczmq depends on zeromq library written in C, so I don't think cross compiling will work. When you compile directly on Ubuntu, please make sure you have all the C dependencies installed.

@franzramadhan
Copy link

franzramadhan commented Nov 24, 2020

@myzhan ah I see. Solved by installing czmq and libczmq from source. So this means it will be dynamically linked and when we want to distribute the binary we still need to ensure the underlying OS has libczmq installed?

@littleningmeng
Copy link
Author

2020/11/04 15:04:09 runner.go:426: Failed to connect to master(127.0.0.1:5557) with error gomq/zmtp: Got error while receiving greeting: Version 3.0 received does match expected version 3.1

czmq-4.2.1 works for me, here is my operations
download czmq-4.2.1 build and install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cd examples/http && go build -tags 'goczmq' client.go

@littleningmeng
Copy link
Author

2020/11/04 15:04:09 runner.go:426: Failed to connect to master(127.0.0.1:5557) with error gomq/zmtp: Got error while receiving greeting: Version 3.0 received does match expected version 3.1

czmq-4.2.1 works for me, here is my operations download czmq-4.2.1 build and install export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cd examples/http && go build -tags 'goczmq' client.go

@joowon-byun
Copy link

gomq v0.0.0-20181008000130-95dc37dee5c4 worked for me. All you need to do is to specify the version at go.mod.

  • gomq v0.0.0-20181008000130-95dc37dee5c4 : zmtp 3.0
  • gomq v0.0.0-20201031135124-cef4e507bb8e : zmtp 3.1

Also, I found out when using locustio/locust, zmtp depends on pyzmq.
I couldn't find any reference or code for this. (If anyone finds it please share.)

  • pyzmq : 17.1.2 → zmtp : 3.0
  • pyzmq : 22.3.0 → zmtp : 3.1

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

5 participants