opensnitch
opensnitch copied to clipboard
Build error: ui/protocol/ui_grpc.pb.go: undefined: grpc.StaticMethod
On Archlinux I'm trying to build and install opensnitch (UI) from AUR as I've done lots of times before
I'm using latest and greatest opensnitch-git PKGBUILD from AUR:
https://aur.archlinux.org/packages/opensnitch-git
...
==> Starting build()...
go: finding module for package github.com/golang/protobuf/protoc-gen-go
go: downloading github.com/golang/protobuf v1.5.4
go: downloading google.golang.org/protobuf v1.33.0
go: finding module for package google.golang.org/grpc/cmd/protoc-gen-go-grpc
go: downloading google.golang.org/grpc v1.64.0
go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.4.0
go: downloading google.golang.org/protobuf v1.34.1
~/.cache/yay/opensnitch-git/src/opensnitch/proto ~/.cache/yay/opensnitch-git/src/opensnitch
protoc -I. ui.proto --go_out=../daemon/ui/protocol/ --go-grpc_out=../daemon/ui/protocol/ --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative
python3 -m grpc_tools.protoc -I. --python_out=../ui/opensnitch/ --grpc_python_out=../ui/opensnitch/ ui.proto
~/.cache/yay/opensnitch-git/src/opensnitch
~/.cache/yay/opensnitch-git/src/opensnitch/daemon ~/.cache/yay/opensnitch-git/src/opensnitch
go: downloading github.com/google/gopacket v1.1.19
go: downloading github.com/iovisor/gobpf v0.2.0
go: downloading github.com/varlink/go v0.4.0
go: downloading github.com/vishvananda/netlink v1.1.1-0.20220115184804-dd687eb2f2d4
go: downloading golang.org/x/sys v0.13.0
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading golang.org/x/net v0.17.0
go: downloading google.golang.org/grpc v1.32.0
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/golang/protobuf v1.5.0
go: downloading github.com/google/nftables v0.1.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading github.com/mdlayher/netlink v1.4.2
go: downloading golang.org/x/text v0.13.0
go: downloading github.com/google/go-cmp v0.5.6
go: downloading github.com/josharian/native v0.0.0-20200817173448-b6b71def0850
go: downloading github.com/mdlayher/socket v0.0.0-20211102153432-57e3fa563ecb
go: downloading honnef.co/go/tools v0.2.2
go: downloading golang.org/x/tools v0.6.0
go: downloading github.com/BurntSushi/toml v0.4.1
go: downloading golang.org/x/mod v0.8.0
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
# github.com/evilsocket/opensnitch/daemon/ui/protocol
ui/protocol/ui_grpc.pb.go:19:16: undefined: grpc.SupportPackageIsVersion8
ui/protocol/ui_grpc.pb.go:49:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:59:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:69:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:79:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:111:41: undefined: grpc.StaticMethod
make: *** [Makefile:21: opensnitchd] Error 1
Same here on Manjaro Unstable (opensnitch-git on AUR).
hey @UffeJakobsen @MrNanook ,
could you install v1.3.0 of the grpc generator , recompile the proto + daemon and see if it works?
~ $ cd opensnitch-git/
~ $ go install google.golang.org/grpc/cmd/[email protected]
~ $ cd proto/; make clean; make
~ $ cd daemon; go build -o opensnitchd .
could you install v1.3.0 of the grpc generator , recompile the proto + daemon and see if it works?
I had the same problem on arch. That fixes the build for me. I added a comment on the AUR package referencing this work around.
The temporary workaround also works here
hey folks,
I've realized that with latest AUR package, if the daemon starts before the GUI, it never establishes the connection. I'm not sure if this is due to generating the protobuffers with latest versions.
The connection is in IDLE state and closing the connection in this situation solves the problem. But I wanted to know if you're also having this issue.
On the other hand, is any of you filtering connections by md5 checksums? it's only available on the opensnitch-git AUR package (Preferences -> Nodes -> Rules -> [ ] Enable checksums verification), just to know if it works fine or if it causes any problem.
On the other hand, is any of you filtering connections by md5 checksums? it's only available on the opensnitch-git AUR package (Preferences -> Nodes -> Rules -> [ ] Enable checksums verification), just to know if it works fine or if it causes any problem.
FYI: I'm the original creator of this issue - and I have actually setup my preferences to verify md5 checksums...
thank you for the feedback @UffeJakobsen :+1:
did anyone notice the issue connecting with the GUI? does the daemon connect to the GUI as expected on your systems?
@gustavo-iniguez-goya daemon does connect with GUI as expected here (manjaro unstable).
Just a quick question (sorry for taking so long to update the AUR opensnitch-git package btw: I just plainly forgot), as I've just been wanting to update the PKGBUILD: is it intentional that the 1.6.0 branch and master have diverged?
(If I "just keep building" with the -git package as is, it would then build from the (also recently updated) master branch, but would not "really" pull in the "real latest version" (which is usually what one would "expect" an AUR -git package to do).
I could, of course, point the PKGBUILD to use a separate branch, but that way another future branch change might get missed for a while, too.)
hey @lsfxz , sorry for the late reply. And thank you for maintaining the AUR package! I use it regularly to test fixes or features.
Right now the "latest" version is the master branch. Whenever a "risky" new feature or change has been added, I've created a branch from latest release, to add only bug fixes there.
The master branch has some new features that will impact performance (checksums checking, getting process' tree, a new process cache, etc), and at the same time I needed/wanted to release a new version with improvements (reloading and applying configuration without having to restart the daemon, an easier way of writing rules manually..., this was a pain when you are managing remote nodes). That's why the v1.6.0 branch has received more changes than expected.
This does not work.
ALT Linux Sisyphus 05 June 2025
[builder@localhost opensnitch-1.7.0.0]$ make
make[1]: Entering directory '/usr/src/RPM/BUILD/opensnitch-1.7.0.0/proto'
python3 -m grpc_tools.protoc -I. --python_out=../ui/opensnitch/proto/ --grpc_python_out=../ui/opensnitch/proto/ ui.proto
make[1]: Leaving directory '/usr/src/RPM/BUILD/opensnitch-1.7.0.0/proto'
make[1]: Entering directory '/usr/src/RPM/BUILD/opensnitch-1.7.0.0/daemon'
go: downloading google.golang.org/grpc v1.32.0
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/google/gopacket v1.1.19
go: downloading github.com/vishvananda/netlink v1.3.0
go: downloading golang.org/x/sys v0.20.0
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading golang.org/x/net v0.23.0
go: downloading github.com/cilium/ebpf v0.16.0
go: downloading github.com/golang/protobuf v1.5.0
go: downloading github.com/vishvananda/netns v0.0.4
go: downloading github.com/varlink/go v0.4.0
go: downloading github.com/google/nftables v0.2.0
go: downloading github.com/google/uuid v1.3.0
go: downloading golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
go: downloading github.com/mdlayher/netlink v1.7.2
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading golang.org/x/text v0.14.0
go: downloading github.com/josharian/native v1.1.0
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/mdlayher/socket v0.5.0
go: downloading golang.org/x/sync v0.6.0
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
# github.com/evilsocket/opensnitch/daemon/ui/protocol
ui/protocol/ui_grpc.pb.go:19:16: undefined: grpc.SupportPackageIsVersion9
ui/protocol/ui_grpc.pb.go:36:68: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:49:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:59:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:69:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:78:86: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:89:36: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:108:21: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:129:49: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:215:36: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:69:41: too many errors
make[1]: *** [Makefile:23: opensnitchd] Error 1
make[1]: Leaving directory '/usr/src/RPM/BUILD/opensnitch-1.7.0.0/daemon'
make: *** [Makefile:11: opensnitch_daemon] Error 2
[builder@localhost opensnitch-1.7.0.0]$
I tried this and nothing changed:
[builder@localhost opensnitch-1.7.0.0]$ go install google.golang.org/grpc/cmd/[email protected]
go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
go: downloading google.golang.org/grpc v1.3.0
go: downloading google.golang.org/protobuf v1.28.1
[builder@localhost opensnitch-1.7.0.0]$ cd proto/; make clean; make
protoc -I. ui.proto --go_out=../daemon/ui/protocol/ --go-grpc_out=../daemon/ui/protocol/ --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative
python3 -m grpc_tools.protoc -I. --python_out=../ui/opensnitch/proto/ --grpc_python_out=../ui/opensnitch/proto/ ui.proto
[builder@localhost proto]$ cd ../daemon; go build -o opensnitchd .
# github.com/evilsocket/opensnitch/daemon/ui/protocol
ui/protocol/ui_grpc.pb.go:19:16: undefined: grpc.SupportPackageIsVersion9
ui/protocol/ui_grpc.pb.go:36:68: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:49:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:59:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:69:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:78:86: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:89:36: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:108:21: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:129:49: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:215:36: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:69:41: too many errors
[builder@localhost daemon]$
Please tell me what to do.
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
ui/protocol/ui_grpc.pb.go:36:87: syntax error: unexpected [, expecting comma or )
ui/protocol/ui_grpc.pb.go:78:6: missing function body
ui/protocol/ui_grpc.pb.go:78:105: syntax error: unexpected [, expecting comma or )
ui/protocol/ui_grpc.pb.go:89:55: syntax error: unexpected [ after top level declaration
ui/protocol/ui_grpc.pb.go:108:40: syntax error: unexpected [, expecting comma or )
ui/protocol/ui_grpc.pb.go:129:6: missing function body
ui/protocol/ui_grpc.pb.go:129:68: syntax error: unexpected [, expecting comma or )
ui/protocol/ui_grpc.pb.go:211:81: syntax error: unexpected comma, expecting :
ui/protocol/ui_grpc.pb.go:215:55: syntax error: unexpected [ after top level declaration
If anyone is interested, I added this to the package spec file and the build worked.
# Opensnitch requires a very specific version of protoc-gen-go-grpc
# See https://github.com/evilsocket/opensnitch/issues/1142
# Build the protoc-gen-go-grpc
pushd protoc-gen-go-grpc.d/grpc-go-8ba23be9613c672d40ae261d2a1335d639bdd59b/cmd/protoc-gen-go-grpc
%golang_build .
popd
# Add the compiled version of the protoc-gen-go-grpc to PATH
export PATH=$PATH:$PWD/.build/bin
If anyone is interested, I added this to the package spec file and the build worked.
# Opensnitch requires a very specific version of protoc-gen-go-grpc # See https://github.com/evilsocket/opensnitch/issues/1142 # Build the protoc-gen-go-grpc pushd protoc-gen-go-grpc.d/grpc-go-8ba23be9613c672d40ae261d2a1335d639bdd59b/cmd/protoc-gen-go-grpc %golang_build . popd # Add the compiled version of the protoc-gen-go-grpc to PATH export PATH=$PATH:$PWD/.build/bin
Can you be more specific? Which file
You should download this version of protoc-gen-go-grpc and add it to your PATH. OpenSnitch is pinned to a specific version protoc-gen-go-grpc. You can get the binary right away using go:
go install google.golang.org/grpc/cmd/[email protected]
Or compile it yourself from the source code. The required version is located on this commit in this directory.
git clone https://github.com/grpc/grpc-go.git
git checkout 8ba23be9613c672d40ae261d2a1335d639bdd59b
cd cmd/protoc-gen-go-grpc/
go build .
You should download this version of protoc-gen-go-grpc and add it to your PATH. OpenSnitch is pinned to a specific version protoc-gen-go-grpc. You can get the binary right away using go:
go install google.golang.org/grpc/cmd/[email protected]Or compile it yourself from the source code. The required version is located on this commit in this directory.
git clone https://github.com/grpc/grpc-go.git git checkout 8ba23be9613c672d40ae261d2a1335d639bdd59b cd cmd/protoc-gen-go-grpc/ go build .
You didn't actually try this... did you...
Do you think repeating the same instructions that's failing for everyone else, is going to suddenly make it work?
Either give the proper instructions that you used to get it working, or don't waste our time.
Why is everyone jumping through hoops, rather than doing a pull request?? This has been ongoing for like a year.
Let's be polite. Everyone in this chat is a volunteer, and we do this in our free time. Basically, this is a working instruction, it fixes the build problem that the Issue is open for. And I didn't come up with this solution. See above in this thread https://github.com/evilsocket/opensnitch/issues/1142#issuecomment-2159450207. I confirmed that it works and attached more detailed instructions for you.
Let's be polite. Everyone in this chat is a volunteer, and we do this in our free time. Basically, this is a working instruction, it fixes the build problem that the Issue is open for. And I didn't come up with this solution. See above in this thread #1142 (comment). I confirmed that it works and attached more detailed instructions for you.
No. It used to. But not anymore.
The dependencies for the version of grpc you mention requires go v1.22 or above. opensnitch is locked on v1.17
ui/protocol/ui_grpc.pb.go:19:16: undefined: grpc.SupportPackageIsVersion9
ui/protocol/ui_grpc.pb.go:36:68: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:49:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:59:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:69:41: undefined: grpc.StaticMethod
ui/protocol/ui_grpc.pb.go:78:86: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:89:36: undefined: grpc.BidiStreamingClient
ui/protocol/ui_grpc.pb.go:108:21: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:129:49: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:215:36: undefined: grpc.BidiStreamingServer
ui/protocol/ui_grpc.pb.go:69:41: too many errors
Not to mention you're pulling files from version 1.7.1 that's running on a more recent version of go.
option go_package = "github.com/evilsocket/opensnitch/daemon/ui/protocol";
You specifically mentioned how you fixed it. Yet apparently nobody but you is deemed competent enough by you to copy and paste that into a file. Stop being so arrogant and just direct us to the specific file. Why be so difficult???
This entire project is an absolute mess. No versions are compatible with each other. Nothing works. Every commit breaks the last. And to even get it running, everyone has to manually jump through 20 hoops, every single commit.
Man, I am not the developer of this project. Don't talk to me like that. I am the maintainer of the ALT distribution, and I told you how I built this project. You can read the spec. https://packages.altlinux.org/en/sisyphus/srpms/opensnitch/specfiles/ Or see how it is built in Arch. https://gitlab.archlinux.org/archlinux/packaging/packages/opensnitch/-/blob/main/PKGBUILD?ref_type=heads
Man, I am not the developer of this project. Don't talk to me like that. I am the maintainer of the ALT distribution, and I told you how I built this project. You can read the spec. https://packages.altlinux.org/en/sisyphus/srpms/opensnitch/specfiles/ Or see how it is built in Arch. https://gitlab.archlinux.org/archlinux/packaging/packages/opensnitch/-/blob/main/PKGBUILD?ref_type=heads
It's fine. I already added it to PKGBUILD. It would have been a 2 second reply...