gustavo-iniguez-goya / opensnitch

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

GUI crash with "NameError: name 'unicode' is not defined" #11

Closed CrashTD closed 4 years ago

CrashTD commented 4 years ago

Hi there, thanks for keeping this project alive. It is a very useful and long overdue tool.

Describe the bug

opensnitchd seems to be running fine. however opensnitch-ui crashes as soon i get the a request window for a connection and confirm it.

qt5ct: using qt5ct plugin
qt5ct: D-Bus system tray: no
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/opensnitch/dialogs/prompt.py", line 362, in _on_apply_clicked
    self._rule.name = slugify("%s %s %s" % (self._rule.action, self._rule.operator.type, self._rule.operator.data))
  File "/usr/lib/python3.8/site-packages/slugify.py", line 24, in slugify
    unicode(
NameError: name 'unicode' is not defined
zsh: abort (core dumped)  opensnitch-ui

To Reproduce Steps to reproduce the behavior:

  1. Wait until a connection windows pop up (e.g. start browser)
  2. Confirm that connection is allowed

Expected behavior Not crash :)

OS (please complete the following information):

Additional context I don't know if it is relevant, but systemctl status shows

systemd[1]: Starting OpenSnitch is a GNU/Linux port of the Little Snitch application firewall....
systemd[1]: Started OpenSnitch is a GNU/Linux port of the Little Snitch application firewall..
opensnitchd[1189]: ERROR: path=/usr/bin/iptables args=[-D INPUT --protocol udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass] err=exit status 1 out='iptables: No chain/target/match by that name.
opensnitchd[1189]: '
opensnitchd[1189]: ERROR: path=/usr/bin/iptables args=[-D OUTPUT -t mangle -m conntrack --ctstate NEW -j NFQUEUE --queue-num 0 --queue-bypass] err=exit status 1 out='iptables: No chain/target/match by that name.
opensnitchd[1189]: '
opensnitchd[1189]: ERROR: path=/usr/bin/iptables args=[-D OUTPUT -m mark --mark 101285 -j DROP] err=exit status 1 out='iptables: Bad rule (does a matching rule exist in that chain?).
opensnitchd[1189]: '
gustavo-iniguez-goya commented 4 years ago

Hey @CrashTD , thank you for the report!

A few more questions: Did you have a previous installation of opensnitch before installing this fork? Did you installed the latest AUR package? What version of unicode_slugify do you have installed?

It looks like a problem with slugify package, but I can't tell for sure. See if you can determine what package distributes the file "slugify.py"

CrashTD commented 4 years ago

slugify was in fact the problem. installed was from AUR python-unicode-slugify-git r43.b696c37-1 removed it and installed python-unicode-slugify 0.1.3-1. that fixed it. thanks!

gustavo-iniguez-goya commented 4 years ago

great, I'll add it to the docs. Thank you :)