After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769715 - Tracker Fails to Start: Connection refused
Tracker Fails to Start: Connection refused
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
1.6.x
Other Linux
: Normal normal
: ---
Assigned To: tracker-general
tracker-general
Depends on:
Blocks:
 
 
Reported: 2016-08-10 22:12 UTC by jackieb
Modified: 2017-01-12 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jackieb 2016-08-10 22:12:35 UTC
1. Tracker stopped finding words
2. This is a common occurrence, and I have a script that kills, zaps and restarts for this very purpose.
this is nowadays a single command:
tracker reset --hard
3. tracker was running but ineffective, then would not start

SYMPTOM:
tracker daemon --start
Starting miners…
Could not start miners, manager could not be created, Could not connect: Connection refused

DIAGNOSE
Dbus seems to work, if I do
sudo dbus-monitor
signal time=1470866276.617907 sender=org.freedesktop.DBus -> destination=:1.0 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.0"
signal time=1470866276.617960 sender=org.freedesktop.DBus -> destination=:1.0 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.0"

these indicate normal
systemctl status dbus.service
systemctl status dbus.socket

GET AROUND
I believe tracker starts properly if gdm is restarted

dpkg --status tracker | egrep "^(V|Pa)"
Package: tracker
Version: 1.6.2-0ubuntu1

What am I supposed to do next?
Comment 1 jackieb 2016-08-10 22:23:34 UTC
What I have found in writing my own utilities is that failure messages are the most helpful when they indicate:

1. What is the error/status code response
2. What was the command/invocation that failed
3. What is a common cause or fix for that situation

In this case: how can I on the command line test the connection tracker is having refused?
Comment 2 jackieb 2016-08-10 22:27:25 UTC
tracker-control-general.c
                manager = tracker_miner_manager_new_full (TRUE, &error);
                if (!manager) {
                        g_printerr (_("Could not start miners, manager could not be created, %s"),
+                                   error ? error->message : _("No error given"));
Comment 3 jackieb 2016-08-10 23:36:51 UTC
This command works so dbus is available to the normal user
gnome-open /home/

This call fails:
 manager = g_initable_new (TRACKER_TYPE_MINER_MANAGER,
 NULL,
 &inner_error,
 "auto-start", auto_start,
 NULL);

with the gio error enum
G_IO_ERROR_CONNECTION_REFUSED: Connection refused.

So whatever is on dbus instantiating TRACKER_TYPE_MINER_MANAGER objects is no longer with us
Comment 4 jackieb 2016-08-12 23:37:02 UTC
logout/login does not fix this problem.

There seem to be something broken with dbus, in particular, the following command fail:
netstat --protocol=unix --listening --numeric --program | grep $DBUS_SESSION_BUS_ADDRESS

so programs connect using
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7s51hr6DcF,guid=ee01c17b14dbcc77065ef34657a79dfd
- this has to be checked in a terminal window under the desktop manager

but dbus.service does not listen to that socket (it does on a functional system)

Ubuntu also prevents restart of dbus
systemctl restart dbus.service 
Failed to restart dbus.service: Operation refused, unit dbus.service may be requested by dependency only.                                          
See system logs and 'systemctl status dbus.service' for details.                

and reload does not help
Comment 5 jackieb 2016-08-12 23:38:39 UTC
reboot it is
Comment 6 jackieb 2016-08-12 23:41:34 UTC
on login:
tracker prcesses are up, but no search data i available and no mining activity is taking place

things like
tracker daemon --watch
fails with the refused error message
Comment 7 jackieb 2016-08-12 23:59:19 UTC
reboot the kernel does bring the system back to normal operation.

Here is the proper command to verify that the dbus socket is available
sudo netstat --protocol=unix --listening --numeric --program | grep $(sed --silent 's/[^/]*\([^,]*\).*/\1/p' <<<$DBUS_SESSION_BUS_ADDRESS)
unix  2      [ ACC ]     STREAM     LISTENING     29658    4900/dbus-daemon
Comment 8 jackieb 2016-08-13 03:42:33 UTC
Could anybody be helpful and provide the proper troubleshooting steps for the situation:

How do you determine if the TRACKER_TYPE_MINER_MANAGER factory is dead?

How do you bring it back to life?

How do you restore dbus with something less than a full reboot?
Comment 9 jackieb 2016-09-02 01:05:36 UTC
Have this again.

I believe when the TRACKER_TYPE_MINER_MANAGER instantiator dies,

that when Tracker stops indexing
and Can no longer be restarted

Only known fix is power off
Comment 10 jackieb 2016-09-02 01:08:25 UTC
nothing is listening to $DBUS_SESSION_BUS_ADDRESS
Comment 11 jackieb 2016-09-02 22:44:11 UTC
So this is caused by dbus being broken.

SYMPTOM:
Desktop Search/tracker stops finding files and cannot be restarted
- casued by incorrect value in $DBUS_SESSION_BUS_ADDRESS

DIAGNOSE
qdbus
Could not connect to D-Bus server: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /tmp/dbus-apJquVdO08: Connection refused
- should list 100 or so apps that are listening to the user's dbus

The X session has an incorrect value in $DBUS_SESSION_BUS_ADDRESS

GETAROUND for Ubuntu 16.04 dbus 1.10.6
1. make sure dbus works
ps -fC dbus-daemon | cat
UID        PID  PPID  C STIME TTY          TIME CMD
message+  3174     1  0 Aug26 ?        00:01:24 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
foxyboy  28549     1  0 Aug26 ?        00:01:35 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
foxyboy  28592 28587  0 Aug26 ?        00:00:04 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
- there should be one with 7 in the arguments
- if that does not exist, it hould be recreated by logout/login
- in this case process id is 28549

2. find the socket name
sudo lsof -p 28549 | grep /tmp/dbus-
- prints over 100 lines all with the same socket
dbus-daem 28549 foxyboy  131u     unix 0xffff8802dd100f00      0t0 12528592 @/tmp/dbus-3bFHfv2e6Q type=STREAM
- so socket is /tmp/dbus-3bFHfv2e6Q

3. update DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-3bFHfv2e6Q

4. should now work
qdbus
org.freedesktop.DBus
- lists 300 lines of apps listening to sbud

ps -fC dbus-daemon | cat
UID        PID  PPID  C STIME TTY          TIME CMD
message+  3174     1  0 Aug26 ?        00:01:24 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
foxyboy  28549     1  0 Aug26 ?        00:01:35 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
foxyboy  28592 28587  0 Aug26 ?        00:00:04 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3

for older versions, the socket is stored in the only file in directory ~/.dbus/session-bus

for newer versions, the socket is stored in /run/user/$(id --user)/dbus-session

dpkg --status dbus | egrep "^(V|Pa)" && lsb_release --description --codename
Package: dbus
Version: 1.10.6-1ubuntu3
Description:    Ubuntu 16.04.1 LTS
Codename:       xenial
Comment 12 jackieb 2016-10-12 20:27:51 UTC
Here is the one-liner that fixes your current shell:

_PIDS=($(ps -C dbus-daemon --format pid=,ppid=,user=,args= | egrep "^ *[0-9]* *1 *$(whoami) " | sed --silent 's/^ *\([0-9]*\).*/\1/p')) && if [ ${#_PIDS[@]} -ne 1 ]; then echo >&2 "failure: found ${#_PIDS[@]} dbus pids"; false; fi && _PID=${_PIDS[0]} && _FILE=$(lsof -p $_PID 2>/dev/null | sed --silent 's/.*@\([^ ]*\) .*/\1/p' | head -1) && if [ ! $_FILE ]; then echo >&2 "Failed to find dbus-socket"; false; fi && _CMD=(export DBUS_SESSION_BUS_ADDRESS=unix:abstract=$_FILE) && echo "${_CMD[*]}" && "${_CMD[@]}"

on success it echoes like:
export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ZMtofqapHn

and then  you can do:
tracker daemon --start
Starting miners…
  ✓ Userguides
  ✓ File System
  ✓ Applications
  ✓ Extractor
Comment 13 jackieb 2017-01-12 19:01:52 UTC
fixed 3.22.2