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

Can not start GUI without PROTOCOL_BUFFERS option #145

Open
uclnj opened this issue Jan 23, 2023 · 8 comments
Open

Can not start GUI without PROTOCOL_BUFFERS option #145

uclnj opened this issue Jan 23, 2023 · 8 comments

Comments

@uclnj
Copy link

uclnj commented Jan 23, 2023

Hello all, was having a fun time trying to launch the GUI, found a way but may be impacting performance.

On launch the GUI presented with the following error:

greg@util1:~$ opensnitch-ui
Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 23, 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/greg/.local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 755, 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).

protobuf was already at 3.12.4 and grpcio was at latest version.

To Reproduce
Installed using DEB packages on Ubuntu 22.04 fresh out of the box on new test workstation with only one round of apt updates.

Steps to reproduce the behavior:
Downloaded and installed on fresh Ubuntu 22.04 install.

Post error logs:

Expected behavior (optional)
GUI should start.

Screenshots
No screenshot of a GUI not starting.

OS (please complete the following information):
Ubuntu 22.04.1 LTS (jammy)

Additional context
Using the PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python export allows the GUI to start and performance is relatively snappy.

@erwan1421
Copy link

Hello uclnj!
Apparently no feedback on this "old" issue, while I'm just experiencing it today, on a fresh install of Linux Mint 21.1, with fresh downloads of OpenSnitch and UI 1.6.2.1
Exactly the same error as you show, after I solved previous issues referred by the install (some Python packages and libraries). Before those steps, UI simply didn't show up with 0 message of any kind...
Discouraging, especially as I have been using OpenSnitch for +/- 2 years

@gustavo-iniguez-goya
Copy link
Owner

gustavo-iniguez-goya commented Aug 11, 2023

hey @erwan1421 ,

See if this answer helps: evilsocket#1003 (comment)

@erwan1421
Copy link

Hello Gustavo,
Sorry for the late reply, other stuff in the pipeline...
Unfortunately, it doesn't work, and this is what I get:

python3.10 -m pip install --ignore-installed grpcio==1.44.0
Defaulting to user installation because normal site-packages is not writeable
Collecting grpcio==1.44.0
Downloading grpcio-1.44.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 2.5 MB/s eta 0:00:00
Collecting six>=1.5.2
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, grpcio
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
grpcio-tools 1.57.0 requires grpcio>=1.57.0, but you have grpcio 1.44.0 which is incompatible.
Successfully installed grpcio-1.57.0 six-1.16.0

@erwan1421
Copy link

Maybe also install grpcio-tools==1.44.0??
But at the end, I'm afraid those contradictory and concurrent "downgrade" installs might have very bad side effects for the other applications using Python... But I must admit that I'm not an expert regarding Python

@gustavo-iniguez-goya
Copy link
Owner

mmh, I'd suggest to uninstall grpcio-tools. At least when I've installed opensnitch on mint 21.2 or ubuntu 22.x I've never installed it.

I don't think any of your installed programs will depend on grpcio libs, so it should not affect the other python programs.

@erwan1421
Copy link

could the fact that I'm with Mint 21.1 have any kind of impact on the situation...?
The picture: my system was completely ruined (too long to explain, the fact is that the system was lost with successive kernel panics, I succeeded to get my encrypted /home back and decided to have a fresh install of the same version of Mint).
As I'm still working to get my system back as before the accident (a lot of customization), I'm not eager to install 21.2 on top of 21.1

@erwan1421
Copy link

OK, no happy end until now:

  • uninstalled grpcio-tools
  • installed grpcio==1.44.0 with no error message as previously experienced
  • again, launched opensnitch-ui with CLI (just to get immediate feedback, as launching from "menu" has no effect)

and the result is:

Traceback (most recent call last):
File "/usr/bin/opensnitch-ui", line 42, in
from opensnitch.service import UIService
File "/usr/lib/python3/dist-packages/opensnitch/service.py", line 15, in
from opensnitch import ui_pb2
File "/usr/lib/python3/dist-packages/opensnitch/ui_pb2.py", line 32, in
_descriptor.EnumValueDescriptor(
File "/home/yves/.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).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_opensnitch-ui.1000.crash'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/opensnitch-ui", line 42, in
from opensnitch.service import UIService
File "/usr/lib/python3/dist-packages/opensnitch/service.py", line 15, in
from opensnitch import ui_pb2
File "/usr/lib/python3/dist-packages/opensnitch/ui_pb2.py", line 32, in
_descriptor.EnumValueDescriptor(
File "/home/yves/.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).

@erwan1421
Copy link

I'm just still wondering why and how OpenSnitch has been working previously with no issue for almost 2 years with the same version of Mint...
I tried to clean /home from possible "ghosts" (when initial system was working): is it possible something remains in /home that could interfere with OpenSnitch (previously installed with an older 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

No branches or pull requests

3 participants