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

Failed to connect to Socket #592

Closed
DidemnumVex opened this issue Feb 2, 2018 · 17 comments
Closed

Failed to connect to Socket #592

DidemnumVex opened this issue Feb 2, 2018 · 17 comments

Comments

@DidemnumVex
Copy link

DidemnumVex commented Feb 2, 2018

Hi I'm running TigerVNC on my centos server. I have 7 user accounts on the server but only ONE is not working. It was previously working just fine. Have tried connecting from multiple remote machines with vncviewer and restarted the vnc server and the physical server.

The error log from the failed account:

Xvnc TigerVNC 1.1.0 - built May 11 2016 13:01:55
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11704000, The X.Org Foundation


Thu Feb  1 13:26:32 2018
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5907
 vncext:      created VNC server for screen 0
Couldn't exec xfce-session: Permission denied
gnome-session[19706]: WARNING: Could not make bus activated clients aware of DISPLAY=:7 environment variable: Failed to connect to socket /tmp/dbus-FZpL5vLpNq: Connection refused
gnome-session[19706]: WARNING: Could not make bus activated clients aware of GNOME_DESKTOP_SESSION_ID=this-is-deprecated environment variable: Failed to connect to socket /tmp/dbus-FZpL5vLpNq: Connection refused
gnome-session[19706]: WARNING: Could not make bus activated clients aware of SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/19706,unix/unix:/tmp/.ICE-unix/19706 environment variable: Failed to connect to socket /tmp/dbus-FZpL5vLpNq: Connection refused

Error log from working account:


Xvnc TigerVNC 1.1.0 - built May 11 2016 13:01:55
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11704000, The X.Org Foundation


Thu Feb  1 13:26:11 2018
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5901
 vncext:      created VNC server for screen 0
GNOME_KEYRING_SOCKET=/tmp/keyring-lnEHz3/socket
SSH_AUTH_SOCK=/tmp/keyring-lnEHz3/socket.ssh
GNOME_KEYRING_PID=17324
Cleaned 26 files 9 still live

(process:17382): GLib-WARNING **: goption.c:2132: ignoring no-arg, optional-arg or filename flags (8) on option of type 0

(process:17382): GLib-WARNING **: goption.c:2132: ignoring no-arg, optional-arg or filename flags (8) on option of type 0

Found similar issues here:
Failed to connect to socket /tmp/dbus-xxx: Connection refused
[xfce4-session] dbus 1.10 prevents X starting correctly
vnc, Could not connect to session bus
VNC error: “Could not connect to session bus: Failed to connect to socket”

But I wasn't sure exactly which portions apply to me. Seems many of these people are using X11. I did add a line to the config file in /home/user7/.vnc/xstartup

Based on the links above, I added:
dbus-launch xfce-session
after lines

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

entire config file reads:

#!/bin/sh

[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
dbus-launch xfce-session
OS=`uname -s`
if [ $OS = 'Linux' ]; then
  case "$WINDOWMANAGER" in
    *gnome*)
      if [ -e /etc/SuSE-release ]; then
        PATH=$PATH:/opt/gnome/bin
        export PATH
      fi
      ;;
  esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
  exec /etc/X11/xinit/xinitrc
fi

Thanks. I don't often have to deal with sockets so this is outside my wheelhouse.
edit: formatting, clarification.

@CendioOssman
Copy link
Member

This is a dbus issue, so not really something we have the best expertise on. That dbus-launch line is quite clearly wrong though as you're getting errors in your log. So I would suggest removing that and then hopefully things will work fine.

@DidemnumVex
Copy link
Author

DidemnumVex commented Feb 5, 2018 via email

@CendioOssman
Copy link
Member

Not really. So we'll need a log without that line in and see if you get some other error.

@DidemnumVex
Copy link
Author

DidemnumVex commented Feb 12, 2018 via email

@CendioOssman
Copy link
Member

Is .vnc/xstartup now identical to other users?

Exactly how are you starting the VNC server? What are the steps?

@CendioOssman CendioOssman reopened this Feb 19, 2018
@DidemnumVex
Copy link
Author

DidemnumVex commented Feb 19, 2018 via email

@hubutui
Copy link

hubutui commented Mar 24, 2018

Hi, excuse me for comment on a closed issue, but I came into the same issue. My server, Ubuntu 16.04.3 LTS crashed, and after reboot, one or two user could not connect to server via vnc because of this dbus or socket error. I found that this issue might help, I run this command:

dbus-launch --sh-syntax

before

vncserver

and sucessfully to connect via vnc. But it seems that I have do that every time? I'm not familiar with dbus-daemon. It's said that systemd start dbus-daemon on boot for every user, maybe there is something wrong? I will check it later. Hope this might be help with someone who encounter same issue.

@hubutui
Copy link

hubutui commented Mar 28, 2018

Hello, I just try another way.

  • backup home dir
sudo mv /home/USER /home/USER-backup
  • create new home dir for the user:
sudo mkdir /home/USER
sudo chown USER:USER USER
  • copy everything except those files or dirs start with a dot . from backup to user home dir
  1. find out running dbus-daemon instances by this command
ps aux | grep USER | grep daemon-dbus

and kill them all.

  • finally, start vncserver as usual, everything works great.

I think just delete every files or dirs start with a dot . from user's home dir, and kill all dbus-daemon might work too, or just deleting ~/.dbus is enough. I will try it out next time I went into this problem.

@digulla
Copy link

digulla commented Mar 24, 2019

It works for me, when I start XFCE with this command:

dbus-launch /usr/bin/startxfce4 &

in .vnc/xstartup of the user which starts vncserver.

@Chuanqi-Zang
Copy link

If you use anaconda, you may try this way:

conda uninstall dbus

restart vnc and login in again.

@hubutui
Copy link

hubutui commented Jul 2, 2019

@mysteryzoz You mean conda break this? I don't see why anaconda/conda is related to this issue.

@Chuanqi-Zang
Copy link

@hubutui I think the dbus in Anaconda influence this issue. When I uninstall it, it worked.

@hubutui
Copy link

hubutui commented Jul 2, 2019

@mysteryzoz You might wanna remove anaconda installation path from you PATH environment.

@pfoser
Copy link

pfoser commented Feb 19, 2020

If you use anaconda, you may try this way:

conda uninstall dbus

That did the trick. Who would have thought...

@dbl001
Copy link

dbl001 commented Oct 23, 2020

I had the same issue. Removing Anaconda 'dbus' solved it!

@feacluster
Copy link

I was ready to pull my hair out trying to fix this issue! I didn't remove Anaconda dbus. I just typed "conda deactivate" and then it seemed to work.. If I still have more issues I will look at uninstalling dbus. But I would rather not do that unless needed.

@MaxChanger
Copy link

Thanks to this issue, I was inspired, I just tried to use conda deactivate, and then vncserver :2 can temporarily avoid this problem. 🚀

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

9 participants