Caffeine not working in Ubuntu 16.04

Bug #1699898 reported by Sharan Duggirala on 2017-06-22
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Trying to make caffeine run on my Ubuntu 16.04, and it doesn't seem to work.

`lsb_release -a` gives me:

Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

When I invoke the command `caffeine`:

/usr/bin/caffeine:25: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import GObject, Gtk, GLib

Reuben Thomas (rrt) wrote :

Please can you try the latest version from the PPA (2.9.4) if you're not using it already?

If you are, which flavour/desktop are you using?

Sharan Duggirala (sd12832) wrote :

Could you please guide me on how to get the latest version from PPA 2.9.4?

I am currently using gnome on Ubuntu?

Reuben Thomas (rrt) wrote :

You can find instructions on the PPA page:

I'm using Caffeine 2.9.4 with Ubuntu GNOME, so it should be OK!

Sharan Duggirala (sd12832) wrote :
Download full text (4.0 KiB)

I get the error below:

Traceback (most recent call last):
  File "/usr/lib/python3.5/urllib/", line 1254, in do_open
    h.request(req.get_method(), req.selector,, headers)
  File "/usr/lib/python3.5/http/", line 1106, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/", line 1151, in _send_request
  File "/usr/lib/python3.5/http/", line 1102, in endheaders
  File "/usr/lib/python3.5/http/", line 934, in _send_output
  File "/usr/lib/python3.5/http/", line 877, in send
  File "/usr/lib/python3.5/http/", line 1252, in connect
  File "/usr/lib/python3.5/http/", line 849, in connect
    (,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.5/", line 693, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.5/", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/", line 102, in _get_https_content_py3
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
  File "/usr/lib/python3.5/urllib/", line 163, in urlopen
    return, data, timeout)
  File "/usr/lib/python3.5/urllib/", line 466, in open
    response = self._open(req, data)
  File "/usr/lib/python3.5/urllib/", line 484, in _open
    '_open', req)
  File "/usr/lib/python3.5/urllib/", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/", line 1297, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.5/urllib/", line 1256, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/", line 327, in get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
  File "/usr/lib/python3/dist-packages/softwareproperties/", line 92, in get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/", line 88, in get_info_from_lp
    return _get_https_content_py3(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/", line 108, in _get_https_content_py3
    raise PPAException("Error reading %s: %s" % (lp_url, reason), e)
softwareproperties.ppa.PPAException: 'Error reading [Errno -3] Temporary failure in name resolution'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/li...


Sharan Duggirala (sd12832) wrote :

Should I go about manually adding the deb package?

Reuben Thomas (rrt) wrote :

Or, given the temporary DNS failure, you could simply try again.

Sharan Duggirala (sd12832) wrote :

Okay, I have the latest caffeine installed. However, it doesn't work now either. This time I don't get any errors on the command line either!

Reuben Thomas (rrt) wrote :

Thanks. Can you next, in a terminal, run

xdg-screensaver suspend `xwininfo | grep "Window id" | cut -d " " -f 4`

and click on the terminal window background. This should suspend the screensaver. Wait for the screensaver delay to check whether the screen goes off.

Note that the message you got before was just a warning, in any case.

Sharan Duggirala (sd12832) wrote :

I get:

Protocol error: bad 3 (Window); Sequence Number 13
 Opcode (20, 0) = GetProperty
 Bad resource 0 (0x0)
 at -e line 15.

Reuben Thomas (rrt) wrote :

It looks like the bug is not in Caffeine.

Please could you just run the command:

xwininfo | grep "Window id" | cut -d " " -f 4

and paste its output here?

Ed B (kde35) wrote :

I had the same issue (with TDE as desktop environment), and solved as follows,

Step 1. I purged gnome-screensaver (that was the only screen saver package installed
other than xscreensaver). This step alone wasn't enough.

Step 2. I rebooted. (Maybe restarting xserver would have been enough, but I didn't think
about it). Now caffeine works.

This is a bit strange because the screensaver running was the one from xscreensaver package,
so I don't see why purging gnome-screensaver should have any incidence, but it solved the problem for me.

Ed B (kde35) wrote :

Actually the above was a little hasty. For some reason the screen saver got deactivated,
and it had nothing to do with caffeine.

So here is what happens: when I issue the command

xdg-screensaver suspend anexistingwindownumber

I get the following error

org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager wa
s not provided by any .service files

Reuben Thomas (rrt) wrote :

Thanks very much for these tests. As you can see, the problem is at the xdg-screensaver level, so please follow it up with xdg-utils.

Reuben Thomas (rrt) on 2018-11-12
Changed in caffeine:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers