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

UI does not work in Ubuntu 22.04 (fixed on 23.04) / LinuxMint 21 (temp fix available) #647

Open
ghost opened this issue Apr 6, 2022 · 56 comments
Labels
3rd party Error related to a third-party lib/app/... bug

Comments

@ghost
Copy link

ghost commented Apr 6, 2022

Hi. It's UI bug.

UI app stuck and interface never appear. I see it load my CPU for about 15%.
Tray icon of opensnitch appear as blank area and does not open even menu by click.

I tried to start it from source using cd ui/bin && mv opensnitch-ui opensnitch-ui.py && python3 opensnitch-ui.py and there was some errors with theme module.

I guess it may be somehow related to new libadwaita and that they dropped ability to use user themes.

I don't know how to get you more info. Please tell me how and I will do it.

@gustavo-iniguez-goya
Copy link
Collaborator

hey @ergsolo , thank you for reporting this.

What version are you running? gnome, kde?

@ghost
Copy link
Author

ghost commented Apr 6, 2022

@gustavo-iniguez-goya
Gnome, Ubuntu 22.04 latest

@ghost
Copy link
Author

ghost commented Apr 6, 2022

Actually I told about ubuntu DE
did you ask about version of ui? I thought its qt based only

@gustavo-iniguez-goya
Copy link
Collaborator

ok, reproduced. I'll try to find the problem.

@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Apr 6, 2022

ok, the problem seems to be the python3-grpcio version that is shipped with ubuntu 22, 1.30.2-3build6

As a workaround install grpcio version from pip as your regular user: $ pip3 install --ignore-installed grpcio==1.44.0

Note: if it keeps failing (opensnitch-ui is using 100%CPU), be sure that you install it for your python version. for example:

$ python3 -V
Python 3.10.9
$ python3.10 -m pip install --ignore-installed grpcio

@ghost
Copy link
Author

ghost commented Apr 6, 2022

@gustavo-iniguez-goya
Thank you, workaround works!

@gustavo-iniguez-goya gustavo-iniguez-goya pinned this issue Apr 6, 2022
@gustavo-iniguez-goya gustavo-iniguez-goya changed the title UI does not work in Ubuntu 22.04 UI does not work in Ubuntu 22.04 (solved) Apr 6, 2022
@Ahmed-E-86
Copy link

I have the same issue.

@convolutionbbs
Copy link

I have the same issue since Pop_OS 22.04 (gnome 42) LTS. I tried the $ pip3 install --ignore-installed grpcio and it still does not work. When I launch the sopensnitch-ui pegs one of the CPUs.

@gustavo-iniguez-goya
Copy link
Collaborator

I'll take a look , thank you @convolutionbbs

@gustavo-iniguez-goya
Copy link
Collaborator

It seems to work fine for me:

image

Maybe you had it running in backgroud? try killing opensnitch-ui before launching it again.

@convolutionbbs
Copy link

Yes, I've tried that. I was launching from the gui icon via Pop_OS. I just tried from the shell:

$ opensnitch-ui
Loading translations: /usr/lib/python3/dist-packages/opensnitch/i18n locale: en_US
None setQuery() exception: int() argument must be a string, a bytes-like object or a real number, not 'QVariant'

and the opensnitch-ui process pegs cpu

@gustavo-iniguez-goya
Copy link
Collaborator

mmh, what version are you using? did you install the GUI from sources or using the deb packages?

@convolutionbbs
Copy link

Just for fun, I removed all references to opensnitch and opensnitch-ui via dpkg (even using --purge). I was using the x86_64 debian builds for both. I re-installed using Eddy (right click on the .deb file install) using the latest version 1.5.1-1.

python3-opensnitch-ui_1.5.1-1_all.deb
opensnitch_1.5.1-1_amd64.deb

Still get no GUI - pegs CPU. Slightly different otuput - likely because I had an older opensnitch-ui installed when I ran the command before. It's likely not relevant, but I did install: pip install pyasn but it still doesn't find it (maybe there's another version I need).

$ opensnitch-ui
Themes not available. Install qt-material if you want to change GUI's appearance: pip3 install qt-material.
Loading translations: /usr/lib/python3/dist-packages/opensnitch/i18n locale: en_US
exception loading ipasn db: No module named 'pyasn'
Install python3-pyasn to display IP's network name.

@gustavo-iniguez-goya
Copy link
Collaborator

ok, the previous error exception: int() looked suspicious, that's why asked you for the version :)

Unfortunately I have no idea why it's not working on your system :/
Try uninstalling python3-grpcio, it'll also remove python3-opensnitch-ui. Then install this deb package without the python3-grpcio dependency: https://github.com/evilsocket/opensnitch/releases/download/v1.5.1/python3-opensnitch-ui_1.5.1-1_all.PIP.deb

Regarding the pyasn package: installing it from pip doesn't install the needed DB, no idea why. On Pop_OS the package is available from apt: apt install python3-pyasn

@convolutionbbs
Copy link

that did it - thanks!

@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Apr 29, 2022

After rebuilding our grpcio files with latest grpcio version, this problem is fixed for Ubuntu 22 and derivatives.
I'll test it out on the rest of versions and distributions, and if everything works fine I'll rebuild the GUI packages.

nah, false alarm.

@convolutionbbs
Copy link

Just wanted to say thank you for your support of this great project - the ease of use and capability is outstanding.

@gustavo-iniguez-goya
Copy link
Collaborator

I opened a bug report with Ubuntu detailing the steps to reproduce this problem . Hopefully they'll reproduce the same behaviour. A simple grpcio example fails as well:

https://bugs.launchpad.net/ubuntu/+source/grpc/+bug/1971114

@impredicative
Copy link

impredicative commented May 12, 2022

Requirements have always been a major thorn for this project, and seem like they will continue to plague this project, disallowing it from being too successful. Any modern project would be fully compiled or packaged without a single one of these unbundled requirements. These days standalone various packagers exist even for Python, so I don't know what the hangup is.


To summarize, here are the extras that I had to run to get the v1.5.1-1 UI running on Ubuntu 22.04:

sudo apt install python3-pip python3-pyasn
pip3 install --user qt-material
pip3 install --user --ignore-installed grpcio

I think python3-pyasn could be documented in the Installation page, or otherwise it could perhaps be installed automatically.

@gustavo-iniguez-goya
Copy link
Collaborator

Hi @impredicative , nor python3-pyasn, nor qt-material are mandatories. The GUI works just fine without them. Otherwise file a bug specifying what's wrong.

The problematic requirements have always been grpcio, unicode_slugify and protobuf, because they were not shipped with many distributions (min18/19, ubuntu <= 18, etc). And now, there's a bug with python3-grpcio.

The deb/rpm packages has worked flawlessly until now, just with apt -f install ./python3-opensnitch-ui**.deb ./opensnitch*.deb

On the other hand, the workaround to this specific problem was documented here #647 (comment) more than 1 month ago.

I also filed a bug for the python3-grpcio problem here https://bugs.launchpad.net/ubuntu/+source/grpc/+bug/1971114 where you can drop a comment to let them know that this problem affects you. This bug also affects warpinator (mint 22.04): linuxmint/warpinator#127

@ghost
Copy link

ghost commented Jun 28, 2022

I can confirm it works for me in Pop-Os! 22.04.

@BillDietrich
Copy link

Recently the UI stopped working on openSUSE Tumbleweed KDE. Running opensnitch-ui on CLI gives "ModuleNotFoundError: No module named 'grpc'". "zypper search grpc" says the only grpc thing installed is "python38-grpcio".

Tried doing "pip3 install --user --ignore-installed grpcio", and now running opensnitch-ui on CLI gives "ModuleNotFoundError: No module named 'google'".

@gustavo-iniguez-goya
Copy link
Collaborator

@BillDietrich that's weird, maybe an upgrade uninstalled the package python3-grpcio? but it'd have also uninstalled the GUI.. so, no idea.

You also need protobuf to solve the error "No module named google": $ sudo zypper install python3-protobuf (or with pip: $ pip3 install protobuf

But anyway, try to install both python3-grpcio and python3-protobuf from SuSe's repositories.

@temporarium
Copy link

Just to inform, since I recently had issues with the UI on openSUSE Tumbleweed as well: it appears the system Python was changed from 3.8 to 3.10. As a result, I had to zypper install the corresponding (python310) modules of grpcio, protobuff and slugify.

Now it's working normally.

@gustavo-iniguez-goya
Copy link
Collaborator

Thank you very much @temporarium ! @BillDietrich , it looks like that's also the problem on your case.

@temporarium
Copy link

No, thank you @gustavo-iniguez-goya for an excellent application and all the hard work!!

@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Jan 16, 2023

I realized yesterday that the opensnitch-ui process was consuming 6% of the CPU doing nothing. It turns out that it's a bug in the grpc lib:
grpc/grpc#30428

Installing grpcio==1.44.0 solves this problem: $ pip3 install --user --ignore-installed grpcio==1.44.0

@temporarium
Copy link

Which are the buggy versions? Mine is v1.51.1 and CPU load is 0.

@gustavo-iniguez-goya
Copy link
Collaborator

it seems to be >= 1.45.0 and < 1.48

@IrIougER
Copy link

Solved the issue on Mint 21 thanks.

@wp-coin
Copy link

wp-coin commented Jan 23, 2023

why is he using python for the gui, even electron will be better

@MikeGrace
Copy link

Thank you. The workaround resolved my issue running Ubuntu 22.04.1 LTS.

@burritoOverflow
Copy link

burritoOverflow commented Mar 16, 2023

Carelessly installed a grpc related update on Ubuntu 22.04 and broke it--the following worked for me:

 pip3 install --ignore-installed grpcio==1.44.0

Note: I had to manually kill the opensnitch-ui process and re-launch for it to work again.

Thanks!

@Ileca
Copy link

Ileca commented Apr 9, 2023

I lost the interface when upgrading to Ubuntu 22.10 and got it back by doing pip3 install --ignore-installed grpcio==1.44.0 but now I have a version mismatch error about me running the 1.6.0rc5 version of the daemon while the UI is at version 1.5.0rc2. And it makes OpenSnitch bugs indeed as I installed that app spamming connections but it still ask me for permission for every new website even after I allowed the executable. I tried to look at the rules but the UI finally crashed.

@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Apr 9, 2023

@Ileca , grpcio version should not affect installed opensnitch version. Open a new issue or Discussion question, but be sure your packages versions are correct (dpkg -l | grep opensnitch) . It looks like you upgraded the daemon, but no the GUI.

@Ileca
Copy link

Ileca commented Apr 10, 2023

Yeah, that's completely on me. Forget what I said, I will crawl into a hole now.

@gustavo-iniguez-goya gustavo-iniguez-goya changed the title UI does not work in Ubuntu 22.04 / LinuxMint 21 (temp fix available) UI does not work in Ubuntu 22.04 (fixed on 23.04) / LinuxMint 21 (temp fix available) Apr 12, 2023
@vibescartel1
Copy link

vibescartel1 commented Apr 15, 2023

Daemon runs but attempting to run opensnitch-ui gives the following error on Ubuntu 22.04:

Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 40, in <module>
    from opensnitch.service import UIService
  File "/usr/lib/python3/dist-packages/opensnitch/service.py", line 13, in <module>
    from opensnitch import ui_pb2
  File "/usr/lib/python3/dist-packages/opensnitch/ui_pb2.py", line 32, in <module>
    _descriptor.EnumValueDescriptor(
  File "/home/vibescartel1/.local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 796, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

I seem to have all the required packages installed, but version might be causing issues?

python3.10 -m pip install grpcio protobuf slugify

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: grpcio in ./.local/lib/python3.10/site-packages (1.53.0)
Requirement already satisfied: protobuf in ./.local/lib/python3.10/site-packages (4.22.1)
Requirement already satisfied: slugify in ./.local/lib/python3.10/site-packages (0.0.1)

@nettybun
Copy link

@vibescartel1 You need 3.20.x or lower, as said in the error message. I got the same error and fixed it like this:

python3.10 -m pip uninstall protobuf
Found existing installation: protobuf 4.21.5
Uninstalling protobuf-4.21.5:
  Would remove:
    /home/today/.local/lib/python3.10/site-packages/google/_upb/_message.abi3.so
    /home/today/.local/lib/python3.10/site-packages/google/protobuf/*
    /home/today/.local/lib/python3.10/site-packages/protobuf-4.21.5.dist-info/*
Proceed (Y/n)? 
  Successfully uninstalled protobuf-4.21.5

python3.10 -m pip install protobuf==3.20
Defaulting to user installation because normal site-packages is not writeable
Collecting protobuf==3.20
  Downloading protobuf-3.20.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 1.5 MB/s eta 0:00:00
Installing collected packages: protobuf
Successfully installed protobuf-3.20.0

@hesoler
Copy link

hesoler commented Apr 24, 2023

runnig on Ubuntu 22.04. Great job!! Thanks

@Flimm
Copy link

Flimm commented Apr 25, 2023

runnig on Ubuntu 22.04. Great job!! Thanks

Do you mean Ubuntu 23.04, the Ubuntu version that was just released?

@snivlle
Copy link

snivlle commented May 17, 2023

I realized yesterday that the opensnitch-ui process was consuming 6% of the CPU doing nothing. It turns out that it's a bug in the grpc lib: grpc/grpc#30428

Installing grpcio==1.44.0 solves this problem: $ pip3 install --user --ignore-installed grpcio==1.44.0

Thanks very much! This worked for me on Kubuntu 22.04.2.
I had been really, really wanting an application-level firewall and "OpenSnitch" fits the bill perfectly. I sincerely hope that you can get it all sorted out so that it is regularly bundled into the official Ubuntu (and variants) releases. I'm very far removed from being a qualified, experienced Linux user - I'm still very much learning. I'm sure that there are many thousands upon thousands more like me. As such, it would be so HUGELY appreciated if the program could be a wee bit more easily installed -- without having to muddle about with CLI commands that I have absolutely no idea are actually doing to my system . . .LOL.

Thanks so much for all your hard work and efforts in maintaining this all-too-important Linux application! I am totally surprised that such a commonly used type of app (within both Windows and OSX) hasn't long since been 'built in' to most Linux distributions. Another sorely lacking net app is something similar to **NetLimiter", which I rely on a great deal within Windows to manage bandwidth (both globally and per application).

@gustavo-iniguez-goya
Copy link
Collaborator

Thank you @snivlle for the kind words, truly appreciated.

Thanks to Peter Reinholdtsen finally opensnitch is in Debian 12, and due to this it'll also be available on Ubuntu 23.04:
https://packages.ubuntu.com/lunar/opensnitch
https://packages.ubuntu.com/lunar/python3-opensnitch-ui

But besides this, we'll no longer have this issue with grpcio/protobuf on Ubuntu 23.x (we'll have others....), it seems to be fixed with the new packages uploaded.

@impredicative
Copy link

it would be so HUGELY appreciated if the program could be a wee bit more easily installed -- without having to muddle about with CLI commands

@gustavo-iniguez-goya For what it's worth, Nuitka is a well-known Python "compiler". Of course there is more to packaging opensnitch than just the Python bits, but something like Nuitka could handle all the Python bits.

@gustavo-iniguez-goya
Copy link
Collaborator

That's interesting @impredicative , thank you!

@B4rabbas
Copy link

Hello, open snitch don't work, even with the workaround here on Linux Mint 21.3 x86_64.

@Lynx-Express
Copy link

Installing grpcio==1.44.0 solves this problem: $ pip3 install --user --ignore-installed grpcio==1.44.0

Fixed "GUI not showing up" -problem in Pop!_OS 22.04. Thanks.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Jun 13, 2024

how it sorted it out on centos 9:

# opensnitchd
wget https://github.com/evilsocket/opensnitch/releases/download/v1.6.5/opensnitch-1.6.5-1.x86_64.rpm

sudo dnf install libnetfilter_queue
sudo rpm -i opensnitch-1.6.5-1.x86_64.rpm
opensnitchd -check-requirements
sudo systemctl enable --now opensnitch.service


# UI (1.6.5.1 is bugfix only for ui, not for daemon)
wget https://github.com/evilsocket/opensnitch/releases/download/v1.6.5.1/opensnitch-ui-1.6.5.1-1.noarch.rpm

sudo dnf remove python36
sudo dnf install python3-inotify python-notify2 python3-qt5
sudo dnf install python3 python3-devel # or else pyasn fails to install (build)
sudo rpm -i opensnitch-ui-1.6.5.1-1.noarch.rpm

# as user (no sudo)
pip install --upgrade pip
pip install grpcio-tools grpcio protobuf slugify qt-material pyasn
pip install --user --ignore-installed grpcio==1.44.0 grpcio-tools==1.44.0
	# downgrade grpc version https://github.com/evilsocket/opensnitch/issues/647

opensnitch-ui # launch opensnitch UI

// ISSUES ON FIRST LAUNCH:
2.1
#795
using IPASN DB: /usr/lib/python3/dist-packages/data/ipasn_20140513_v12.dat.gz
exception loading ipasn db: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/data/ipasn_20140513_v12.dat.gz'
Install python3-pyasn to display IP's network name.

> FIX:
pyasn_util_download.py --latest # connects to port 21 and creates file rib.20240613.2200.bz2
pyasn_util_convert.py --single ./rib.*.bz2 ipasn_db.dat
gzip ipasn_db.dat

2.2 WARNING: system tray not available. On GNOME you need the extension gnome-shell-extension-appindicator.
Read more: https://github.com/evilsocket/opensnitch/wiki/GUI-known-problems#gui-does-not-show-up
If you want to start OpenSnitch GUI in background even if tray not available, use --background argument.

> FIX:
sudo dnf install gnome-extensions-app gnome-shell-extension-appindicator
sudo reboot

gustavo-iniguez-goya added a commit that referenced this issue Jul 1, 2024
Ubuntu jammy package python3-grpcio, version 1.30.2-3build6, has a bug
which causes applications to use 100% of the CPU.

If after installing we detect that the buggy version is installed,
display a warning to the user with instructions on how to solve the
problem and links to the bug reports.

More information:
 - https://bugs.launchpad.net/ubuntu/+source/grpc/+bug/1971114
 - #647
gustavo-iniguez-goya added a commit that referenced this issue Jul 1, 2024
Ubuntu jammy package python3-grpcio, version 1.30.2-3build6, has a bug
which causes applications to use 100% of the CPU.

If after installing we detect that the buggy version is installed,
display a warning to the user with instructions on how to solve the
problem and links to the bug reports.

More information:
 - https://bugs.launchpad.net/ubuntu/+source/grpc/+bug/1971114
 - #647

(cherry picked from commit c89b490)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Error related to a third-party lib/app/... bug
Projects
None yet
Development

No branches or pull requests