gustavo-iniguez-goya / opensnitch

OpenSnitch is a GNU/Linux application firewall
GNU General Public License v3.0
394 stars 20 forks source link

GUI gives NameError: name 'unicode' is not defined #97

Closed arielsboiardi closed 3 years ago

arielsboiardi commented 3 years ago

Hi, I was trying to get opensnitch to work on Fedora 33, I was able to get the daemon to log the connection, while the gui was a bit more complicated.

I was able to launch opensnitch-ui and see the log of the connections. Problem was that whenever I tried to save a rule (both manually or from the prompt) the ui crashed, with Python complaining that name 'unicode' is not defined in a call from slugify.

I found out that unicode does not exist on Python 3, so slugify does not work. Nonetheless I was able to (apparently) fix the problem installing python-slugify from pip, which is compatible with Python 3.

Some possibly useless closing comments

BTW, I almost forgot: thanks for the good work you put into this interesting project! It is awesome (now that it works).

gustavo-iniguez-goya commented 3 years ago

Hi Ariel!

Install unicode_slugify using pip3:

pip3 install unicode_slugify

and grpcio-tools

pip3 install grcpio-tools

arielsboiardi commented 3 years ago

Hi @gustavo-iniguez-goya Thanks for replying, I solved the problem installing python-slugify.

Unfortunately it took me a while to figure out the problem, so I opened this issue, I case someone has the same problem.

gustavo-iniguez-goya commented 3 years ago

ok! I've just realized that this problem is referenced on the FAQs section of the wiki. I'll update it to make it more clear.

https://github.com/gustavo-iniguez-goya/opensnitch/wiki/Known-problems#GUI-crash-exception-or-does-not-show-up

Thank you Ariel!

arielsboiardi commented 3 years ago

Oh, I'm sorry, I did not read carefully enough. Thanks for taking the time!

gustavo-iniguez-goya commented 3 years ago

No worries Ariel. I've been reading about rpm weak dependencies, and from now on the GUI rpm package will install python3-slugify package if it's available, so thank you for bring this problem up!

Installing weak dependencies:
 python3-slugify              noarch    4.0.1-4.fc33      fedora           24 k

In older fedora versions, or opensuse, python3-slugify is not available, so I didn't add i as dependency. But adding as a Weak dependency solves the problem.

The packages python3-grpcio and python3-protobuf are also available, but I need to verify that they work correctly before adding as dependencies. So maybe we can have packages fully instalables just using yum :))

arielsboiardi commented 3 years ago

Yea, I can confirm python3-slugify works, maybe the first attempt did not work because there was also slugify installed by pip. I did install also python3-grpcio and python3-protobuf with dnf and everything seems to work fine. I have also tested a not-so-up-to-date machine with a minimal Fedora 32 install and those dependencies seem to be enough.

gustavo-iniguez-goya commented 3 years ago

I can confirm that python3-grpcio does not work on OpenSuse, and as far as I can remember others (ubuntu 20, etc).

It gets stucked just after launching a simple example. I'll try to debug it, because the package is up to date. Or I'll open a new issue on gRPC repo to get help from the experts :)

Installing grpcio from pip works fine.