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

SafeEyes won't launch on Ubuntu 16.04 #209

Open
tomoqv opened this Issue Oct 27, 2017 · 10 comments

Comments

Projects
None yet
3 participants
@tomoqv
Copy link

commented Oct 27, 2017

I have been using SafeEyes for several months on different Ubuntu machines. Suddenly, it wouldn't launch anymore on one of my PCs. I have reinstalled the uninstalled and reinstalled the program and I have reinstalled the ppa, but nothing helps. When I try to launch it, I can see the SafeEyes icon in the dock for a few seconds and then it disappears without launching.

Any logfiles that I should attach?

@slgobinath

This comment has been minimized.

Copy link
Owner

commented Oct 27, 2017

Could you please start Safe Eyes using the following command and share the console log?

safeeyes --debug

Thanks

@tomoqv

This comment has been minimized.

Copy link
Author

commented Oct 27, 2017

Certainly!

`~$ safeeyes --debug
2017-10-27 13:46:06,878 [INFO]:[MainThread] Starting Safe Eyes
2017-10-27 13:46:06,878 [INFO]:[MainThread] Reading the session file
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/Xlib/support/unix_connect.py", line 89, in get_socket
    s.connect('/tmp/.X11-unix/X%d' % dno)
FileNotFoundError: [Errno 2] Filen eller katalogen finns inte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/safeeyes", line 9, in <module>
    load_entry_point('safeeyes==2.0.0', 'console_scripts', 'safeeyes')()
  File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 132, in main
    safeeyes = SafeEyes(system_locale, config)
  File "/usr/lib/python3/dist-packages/safeeyes/SafeEyes.py", line 75, in __init__
    self.break_screen = BreakScreen(self.context, self.on_skipped, self.on_postponed, Utility.STYLE_SHEET_PATH)
  File "/usr/lib/python3/dist-packages/safeeyes/BreakScreen.py", line 47, in __init__
    self.display = Display()
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 80, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 62, in __init__
    display.Display.__init__(*(self, ) + args, **keys)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 58, in __init__
    self.socket = connect.get_socket(name, host, displayno)
  File "/usr/lib/python3/dist-packages/Xlib/support/connect.py", line 78, in get_socket
    return getattr(mod, modname).get_socket(dname, host, dno)
  File "/usr/lib/python3/dist-packages/Xlib/support/unix_connect.py", line 91, in get_socket
    raise error.DisplayConnectionError(dname, str(val))
Xlib.error.DisplayConnectionError: Can't connect to display ":0": [Errno 2] Filen eller katalogen finns inte
`
@slgobinath

This comment has been minimized.

Copy link
Owner

commented Oct 27, 2017

Looks like a problem with python3-xlib.
Could you please purge it and reinstall manually using the following command and let me know whether it resolves the problem.

sudo apt purge python3-xlib
sudo apt update
sudo apt install python3-xlib
@tomoqv

This comment has been minimized.

Copy link
Author

commented Oct 27, 2017

Unfortunately the problem persists:

~$ safeeyes --debug
2017-10-27 15:54:20,215 [INFO]:[MainThread] Starting Safe Eyes
2017-10-27 15:54:20,215 [INFO]:[MainThread] Reading the session file
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/Xlib/support/unix_connect.py", line 89, in get_socket
    s.connect('/tmp/.X11-unix/X%d' % dno)
FileNotFoundError: [Errno 2] Filen eller katalogen finns inte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/safeeyes", line 9, in <module>
    load_entry_point('safeeyes==2.0.0', 'console_scripts', 'safeeyes')()
  File "/usr/lib/python3/dist-packages/safeeyes/__main__.py", line 132, in main
    safeeyes = SafeEyes(system_locale, config)
  File "/usr/lib/python3/dist-packages/safeeyes/SafeEyes.py", line 75, in __init__
    self.break_screen = BreakScreen(self.context, self.on_skipped, self.on_postponed, Utility.STYLE_SHEET_PATH)
  File "/usr/lib/python3/dist-packages/safeeyes/BreakScreen.py", line 47, in __init__
    self.display = Display()
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 80, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/lib/python3/dist-packages/Xlib/display.py", line 62, in __init__
    display.Display.__init__(*(self, ) + args, **keys)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 58, in __init__
    self.socket = connect.get_socket(name, host, displayno)
  File "/usr/lib/python3/dist-packages/Xlib/support/connect.py", line 78, in get_socket
    return getattr(mod, modname).get_socket(dname, host, dno)
  File "/usr/lib/python3/dist-packages/Xlib/support/unix_connect.py", line 91, in get_socket
    raise error.DisplayConnectionError(dname, str(val))
Xlib.error.DisplayConnectionError: Can't connect to display ":0": [Errno 2] Filen eller katalogen finns inte

@slgobinath

This comment has been minimized.

Copy link
Owner

commented Oct 27, 2017

It is a problem with python3-xlib and faced by other applications too.
See https://stackoverflow.com/questions/31902846/how-to-fix-error-xlib-error-displayconnectionerror-cant-connect-to-display-0 and https://ubuntuforums.org/showthread.php?t=2290602.

Try this temporary solution:

xhost +
safeeyes --debug

--debug parameter is optional. If this works, please do let me know.

Thanks

@tomoqv

This comment has been minimized.

Copy link
Author

commented Oct 27, 2017

I tried xhost + but no cigar. Same error message with safeeyes --debug

@slgobinath

This comment has been minimized.

Copy link
Owner

commented Oct 31, 2017

I tried with my Ubuntu 16.04 VM but could not produce this problem. Could you please check whether you have /tmp/.X11-unix/X0 file.
You can use the following command to check whether this file exists:

ls /tmp/.X11-unix

If it is already there, try to delete it and restart the system. If the file is not available, try to create the file and restart the system.

@tomoqv

This comment has been minimized.

Copy link
Author

commented Nov 1, 2017

I didn't have the file, so I created it with the command below and rebooted.

...:/tmp/.X11-unix$ touch X0
...:/tmp/.X11-unix$ ls
X0
...:/tmp/.X11-unix$ 

File is gone after reboot. Still can't launch SafeEyes.

@slgobinath slgobinath added the bug label Nov 7, 2017

@Microndgt

This comment has been minimized.

Copy link

commented Apr 7, 2019

@slgobinath It also does work in my ubuntu 18.04.2, but the error info is different

2019-04-08 07:25:11,175 [INFO]:[MainThread] Starting Safe Eyes
2019-04-08 07:25:11,209 [INFO]:[MainThread] Initialize the break screen
2019-04-08 07:25:11,209 [INFO]:[MainThread] Load all the plugins
2019-04-08 07:25:11,210 [INFO]:[MainThread] Initialize the core
2019-04-08 07:25:11,210 [INFO]:[MainThread] Successfully loaded <module 'donotdisturb.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/donotdisturb/plugin.py'>
2019-04-08 07:25:11,212 [INFO]:[MainThread] Successfully loaded <module 'notification.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/notification/plugin.py'>
2019-04-08 07:25:11,213 [INFO]:[MainThread] Successfully loaded <module 'audiblealert.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/audiblealert/plugin.py'>
2019-04-08 07:25:11,214 [INFO]:[MainThread] Successfully loaded <module 'trayicon.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/trayicon/plugin.py'>
2019-04-08 07:25:11,214 [INFO]:[MainThread] Successfully loaded <module 'smartpause.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/smartpause/plugin.py'>
2019-04-08 07:25:11,215 [INFO]:[MainThread] Successfully loaded <module 'screensaver.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/screensaver/plugin.py'>
2019-04-08 07:25:11,216 [INFO]:[MainThread] Successfully loaded <module 'healthstats.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/healthstats/plugin.py'>
2019-04-08 07:25:11,217 [INFO]:[MainThread] Successfully loaded <module 'mediacontrol.plugin' from '/usr/lib/python3/dist-packages/safeeyes/plugins/mediacontrol/plugin.py'>
2019-04-08 07:25:11,217 [DEBUG]:[MainThread] Initialize Skip Fullscreen plugin
2019-04-08 07:25:11,217 [DEBUG]:[MainThread] Initialize Notification plugin
2019-04-08 07:25:11,217 [DEBUG]:[MainThread] Initialize Audible Alert plugin
2019-04-08 07:25:11,217 [DEBUG]:[MainThread] Initialize Tray Icon plugin
2019-04-08 07:25:11,221 [DEBUG]:[MainThread] Initialize Smart Pause plugin
2019-04-08 07:25:11,221 [DEBUG]:[MainThread] Initialize Screensaver plugin
2019-04-08 07:25:11,221 [DEBUG]:[MainThread] Initialize Health Stats plugin
2019-04-08 07:25:11,223 [INFO]:[MainThread] Setting up an RPC server on port 7200
2019-04-08 07:25:11,224 [INFO]:[MainThread] Start the RPC server
2019-04-08 07:25:11,224 [DEBUG]:[MainThread] Start Smart Pause plugin
2019-04-08 07:25:11,224 [INFO]:[MainThread] Start Safe Eyes core
2019-04-08 07:25:11,225 [INFO]:[WorkThread] Waiting for 15 minutes until next break
2019-04-08 07:25:11,226 [INFO]:[MainThread] Update next break information
2019-04-08 07:25:20,173 [INFO]:[WorkThread] Take a break due to external request
2019-04-08 07:25:20,173 [INFO]:[WorkThread] Stop the scheduler
2019-04-08 07:25:20,174 [INFO]:[WorkThread] Pre-break waiting is over
2019-04-08 07:25:21,176 [INFO]:[MainThread] Searching for full-screen application
2019-04-08 07:25:21,189 [INFO]:[MainThread] Close pre-break notification
2019-04-08 07:25:46,220 [ERROR]:[MainThread] Introspect error on :1.86:/org/mpris/MediaPlayer2: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
2019-04-08 07:25:46,221 [DEBUG]:[MainThread] Executing introspect queue due to error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/safeeyes/SafeEyesCore.py", line 257, in __fire_start_break
    self.start_break.fire(self.break_queue.get_break())
  File "/usr/lib/python3/dist-packages/safeeyes/model.py", line 227, in fire
    if not handler(*args, **keywargs):
  File "/usr/lib/python3/dist-packages/safeeyes/SafeEyes.py", line 259, in start_break
    actions = self.plugins_manager.get_break_screen_tray_actions(break_obj)
  File "/usr/lib/python3/dist-packages/safeeyes/PluginManager.py", line 193, in get_break_screen_tray_actions
    action = plugin['module'].get_tray_action(break_obj)
  File "/usr/lib/python3/dist-packages/safeeyes/plugins/mediacontrol/plugin.py", line 73, in get_tray_action
    players = __active_players()
  File "/usr/lib/python3/dist-packages/safeeyes/plugins/mediacontrol/plugin.py", line 46, in __active_players
    status = str(interface.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus')).lower()
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
2019-04-08 07:26:11,298 [INFO]:[MainThread] Show Settings dialog
@slgobinath

This comment has been minimized.

Copy link
Owner

commented Apr 8, 2019

@Microndgt please disable the Media Control plugin and see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.