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

argument 3 has unexpected type 'PingRequest' #450

Closed
random29 opened this issue Jul 6, 2021 · 16 comments
Closed

argument 3 has unexpected type 'PingRequest' #450

random29 opened this issue Jul 6, 2021 · 16 comments

Comments

@random29
Copy link

random29 commented Jul 6, 2021

Hi there, dear developer UwU

Describe the bug
UI is not refreshing. No captured packages, no refreshing of rules.

To Reproduce
Just start opensnitch-ui

Post error logs:
Ping exception: UIService._update_stats_trigger[str, str, PingRequest].emit(): argument 3 has unexpected type 'PingRequest'
Ping exception: UIService._update_stats_trigger[str, str, PingRequest].emit(): argument 3 has unexpected type 'PingRequest'
Ping exception: UIService._update_stats_trigger[str, str, PingRequest].emit(): argument 3 has unexpected type 'PingRequest'
When I start opensnitch-ui

OS (please complete the following information):

  • OS: Manjaro
  • Window Manager: xfce4
  • Kernel version: 5.12.9-1-MANJARO
    Installed from aur ofc
@emansom
Copy link

emansom commented Jul 7, 2021

Observing same behavior on Arch, package opensnitch-git from AUR.

@gustavo-iniguez-goya
Copy link
Collaborator

Hi,

Please, see: #442 (comment)

@random29
Copy link
Author

random29 commented Jul 7, 2021

Hi,

Please, see: #442 (comment)

Sorry, but person in aur updated to last commit and I still get this thing

@gustavo-iniguez-goya
Copy link
Collaborator

ping @shollingsworth

@shollingsworth
Copy link
Contributor

I'll spin up a VM or container and see if I can reproduce.

@shollingsworth
Copy link
Contributor

This patch seems to have fixed the build.
Tested on arch:latest

it does seem to add one more package as a build dep qt5-tools

diff --git a/PKGBUILD b/PKGBUILD
index fb8f390..92abb5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,13 +3,13 @@
 # Contributor: lsf
 # Contributor: Adam Hose <adis@blad.is>
 pkgname=opensnitch-git
-pkgver=1.4.0.rc.1.r2.148526e
+pkgver=1.4.0.rc.2.r27.8580281
 pkgrel=1
 pkgdesc="A GNU/Linux port of the Little Snitch application firewall"
 arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
 url="https://github.com/evilsocket/opensnitch"
 license=('GPL3')
-makedepends=('git' 'go' 'python-setuptools' 'python-grpcio-tools')
+makedepends=('git' 'go' 'python-setuptools' 'python-grpcio-tools' 'qt5-tools')
 depends=('libnetfilter_queue' 'libpcap' 'python-grpcio' 'python-protobuf'
          'python-pyinotify' 'python-slugify' 'python-pyqt5')
 optdepends=('logrotate: for logfile rotation support')
@@ -36,7 +36,6 @@ prepare() {
 build() {
   cd "$srcdir/${pkgname%-git}"
 
-  pushd proto
   export GOPATH="$srcdir/gopath"
   export CGO_CPPFLAGS="${CPPFLAGS}"
   export CGO_CFLAGS="${CFLAGS}"
@@ -45,7 +44,8 @@ build() {
   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=mod"
   export PATH=${PATH}:${GOPATH}/bin
   go get github.com/golang/protobuf/protoc-gen-go
-  # make ../daemon/ui/protocol/ui.pb.go
+
+  pushd proto
   make
   popd
 
@@ -53,20 +53,21 @@ build() {
   make
   popd
 
-  # Clean mod cache for makepkg -C
-  go clean -modcache
-
   pushd ui
+
   pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
-  python setup.py build
+  sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2*
+
   popd
+
+  go clean -modcache
 }
 
 package() {
   cd "$srcdir/${pkgname%-git}"
   pushd ui
   export PYTHONHASHSEED=0
-  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
+  python setup.py install --root="$pkgdir/"
   popd
 
   install -d "$pkgdir/etc/${pkgname%-git}d/rules"

@gustavo-iniguez-goya
Copy link
Collaborator

Thank you @shollingsworth !

If it's fixed, please @random29 close it. Or if you can confirm @emansom that it's fixed, let me know and I'll close it as fixed.

@emansom
Copy link

emansom commented Jul 8, 2021

With patched PKGBUILD from @shollingsworth above, the UI shows up as expected again. However there's an error when trying to save/apply the node configuration.
afbeelding

@shollingsworth
Copy link
Contributor

With patched PKGBUILD from @shollingsworth above, the UI shows up as expected again. However there's an error when trying to save/apply the node configuration.
afbeelding

I'm not able to duplicate that behavior on a fresh install. I can't even find a reference to that file in the source :
Settings seem to apply fine in my testing.

also you can put in --optimize=1 but the --skip-build flag does break the install.

@gustavo-iniguez-goya
Copy link
Collaborator

The file /etc/opensnitchd/opensnitch.o is the eBPF compiled module. I compile it when I build the DEB and RPM packages, so if you want to use the "ebpf" proc monitor method you or the AUR package's maintainer should compile and distribute it.

You can always get it from the DEB package ($ wget https://github.com/evilsocket/opensnitch/releases/download/v1.4.0-rc.2/opensnitch_1.4.0.rc2-1_amd64.deb ; dpkg -x opensnitch_1.4.0.rc2-1_amd64.deb xxx ; sudo cp xxx/etc/opensnitchd/opensnitch.o /etc/opensnitchd/opensnitch.o)

To get rid of that message change the "Process monitor method" to "proc" (ui -> preferences -> nodes)

@gustavo-iniguez-goya
Copy link
Collaborator

https://aur.archlinux.org/packages/opensnitch-ebpf-module-git/

someone created this AUR today :)

@shollingsworth
Copy link
Contributor

Still working out the kinks with the AUR package maintainer.

@lsfxz
Copy link

lsfxz commented Jul 8, 2021

https://aur.archlinux.org/packages/opensnitch-ebpf-module-git/

someone created this AUR today :)

That was me as well ;)

I just wanted to chime in to say: Feel free to @ me directly on here if (packaging related) issues with the AUR packages crop up; might be a bit more "comfortable" than always having to head over to the AUR and leave a comment there :)

@shollingsworth
Copy link
Contributor

Looks like that last patch worked. Thanks @lsfxz :)

@gustavo-iniguez-goya I think we can close this issue.

@gustavo-iniguez-goya
Copy link
Collaborator

👍 thank you very much @shollingsworth @lsfxz

@shollingsworth
Copy link
Contributor

BTW, if anybody is interested, I made a repo for the arch testing I did.
https://github.com/shollingsworth/opensnitch-docker-testing

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