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

ServiceUnknown during boot, causes daemon to crash #1

Open
wdoekes opened this issue Mar 1, 2021 · 0 comments
Open

ServiceUnknown during boot, causes daemon to crash #1

wdoekes opened this issue Mar 1, 2021 · 0 comments

Comments

@wdoekes
Copy link
Member

wdoekes commented Mar 1, 2021

Crash during boot:

> Please insert your hardware token for extra authentication. When it blinks, touch the button.
Traceback (most recent call last):
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 671, in <module>
    reread_existing()
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 656, in reread_existing
    handler.handle_askfile(os.path.join(ASK_PASSWORD_DIRECTORY, filename))
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 550, in handle_askfile
    self._handle_askinifile(pathname, data)
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 577, in _handle_askinifile
    ask.handle()
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 382, in handle
    self._handle_username_request()
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 405, in _handle_username_request
    keyhandle, timestamp, response = self._make_challenge_response(
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 501, in _make_challenge_response
    note.show()
  File "/etc/openvpn/openvpn-u2f-setup/openvpn-u2f-ask-password", line 152, in show
    self._notification.show()
gi.repository.GLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.41 was not provided by any .service files (2)
openvpn-u2f-ask-password.service: Main process exited, code=exited, status=1/FAILURE
openvpn-u2f-ask-password.service: Failed with result 'exit-code'.

Possible workaround:

--- a/openvpn-u2f-ask-password
+++ b/openvpn-u2f-ask-password
@@ -31,7 +31,7 @@ try:
     # "ValueError: Namespace Notify not available for version 0.8"
     gi.require_version('Notify', '0.7')  # hide version warning
 
-    from gi.repository import Notify as GObjectNotify
+    from gi.repository import Notify as GObjectNotify, GLib
 
     # We expect python3-dbus through these dependent apt packages:
     #   ubuntu-server -> software-properties-common -> python3-dbus
@@ -149,7 +149,15 @@ class Notification:
 
     def show(self):
         if self._notification:
-            self._notification.show()
+            try:
+                self._notification.show()
+            except GLib.Error as e:
+                # (Observed during boot.)
+                # gi.repository.GLib.Error: g-dbus-error-quark:
+                #   GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown:
+                #   The name :1.41 was not provided by any .service files (2)
+                print('ERROR showing notification: {}'.format(e))
+
         print('> [{}]\n> {}'.format(self._title, self._body))
 
 
wdoekes added a commit that referenced this issue Mar 16, 2021
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

1 participant