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

1.6.0-rc5-1 Notification errors #906

Closed
BetweenTheKeyboardAndChair opened this issue Apr 13, 2023 · 3 comments
Closed

1.6.0-rc5-1 Notification errors #906

BetweenTheKeyboardAndChair opened this issue Apr 13, 2023 · 3 comments

Comments

@BetweenTheKeyboardAndChair

I'm seeing a number of errors in the shell where I started opensnitchd and the UI of the form:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 232, in maybe_handle_message
self._handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/notify2.py", line 154, in _closed_callback
n = notifications_registry[nid]
KeyError: 160

The KeyError appears to increment. The rest is always the same.

It seems to trigger some of the time when I create a new rule in the UI as a response to something trying to open a connection. It is a small percentage of the time. I have not been able to find a pattern.

Include the following information:
opensnitch/now 1.6.0-rc.5-1 amd64
python3-opensnitch-ui/now 1.6.0-rc.5-1 all
OS: Ubuntu 20.04
WM: cinnamon-common/focal,focal,now 4.4.8-4 all
Kernel: Linux ucin 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

To Reproduce
The errors seems to trigger some of the time when I create a new rule in the UI as a response to something trying to open a connection. It is a small percentage of the time. I have not been able to find a pattern.

Looking at the logs, all I see are entries for "Added new rule", and some "Saved new rule". There are no errors.

Possibly related: Some of the forever rules seem to get lost every few days. (IP related?)

Configuration:
Database: In Memory
Nodes: Proc method: proc (ebpf gives a warning on start on ubunutu 20.04)
Rules: Don't save/Delete rules of duration is UNchecked
Pop-ups: Filter connections also by Destination IP

Anything I can enable to get you better debugging info? (Explicit instructions please.)

@gustavo-iniguez-goya
Copy link
Collaborator

This error usually appears when a desktop notification is dismissed/clicked on.

See if clicking or dimissing a desktop notification generates that exception. In any case, it's not an opensnitch functionality error, but python3-notify2' package:

File "/usr/lib/python3/dist-packages/dbus/connection.py", line 232, in maybe_handle_message
File "/usr/lib/python3/dist-packages/notify2.py", line 154, in _closed_callback

@BetweenTheKeyboardAndChair
Copy link
Author

Confirmed that it is caused by clicking dismiss notifications on the desktop.

@gustavo-iniguez-goya
Copy link
Collaborator

This was a bug in python3-notify2 package. Debian distributes version python3-notify2 0.3-5 which doesn't handle exceptions when closing notifications:

152 def _closed_callback(nid, reason):                                              
153     nid, reason = int(nid), int(reason)                                         
154     n = notifications_registry[nid]                                             
155     n._closed_callback(n)                                                       
156     del notifications_registry[nid]  

This was fixed on version 0.3.1: https://bitbucket.org/takluyver/pynotify2/commits/d4482e7169e3e9787d602d78f55c0cd74d805ff6

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

2 participants