evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
9.86k stars 488 forks source link

Can't launch opensnitch-ui unless i run it as root #918

Closed t3dium closed 1 year ago

t3dium commented 1 year ago
Traceback (most recent call last):
  File "/usr/local/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/computer/.local/lib/python3.11/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

is the result of what happens if i type opensnitch-ui in a non-root terminal, it crashes instantly. This used to be working in the past, but then it randomly stopped working and the ui was empty (it opened but no events showed), so i tried pip uninstalling grpcio and protobuf, and trying other versions out and now it doesn't launch entirely. I also tried installing the exact version i had before and it still fails.

When i do sudo opensnitch-ui it successfully launches and works, (aside from icons not displaying, but thats likely as im launching the app as root in gnome)

protobuf version: 4.22.3 - latest, installed via pip grpcio version: 1.54.0 - latest, installed via pip

OS: fedora workstation 37, gnome 43.4

gustavo-iniguez-goya commented 1 year ago

Hi @t3dium ,

Please, post the opensnitch version you're using. If it's 1.6.x, post the protobuf and grpcio versions that it uses as your regular user and as root when you launch opensnitch-ui from a shell.

If it's < 1.6.x, list the versions for grpcio and protobuf, both as your regular user and root.

Anyway, I'd suggest to remove any grpcio and protobuf pip packages, installed globally and locally, and just use what your distribution ships (and don't run the GUI as root :])

gustavo-iniguez-goya commented 1 year ago

Please, follow the recommendations mentioned above:

The problem seems to be the combination of protobuf 4.22 + grpcio 1.5x. https://github.com/evilsocket/opensnitch/issues/741#issuecomment-1523369154

t3dium commented 1 year ago

Anyway, I'd suggest to remove any grpcio and protobuf pip packages, installed globally and locally, and just use what your distribution ships (and don't run the GUI as root :])

Issues fixed now, used the protobuf and grpcio packages from the fedora repo's rather than pip, i tried using it in the past but it didn't work for some reason which why i used pip instead. But it's working now thanks