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 bus: No such file or directory" on clean WSL OpenSuse (42.3) install #2941

Closed
archon810 opened this issue Feb 12, 2018 · 13 comments

Comments

@archon810
Copy link

This is a follow-up to #376, which was closed.

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.16299.192]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    zypper update

  • What's wrong / what should be happening instead:

( 58/102) Installing: logrotate-3.11.0-15.2.x86_64 .....................................................................................................................................................................................[done]Additional rpm output:
Failed to connect to bus: No such file or directory
( 68/102) Installing: exim-4.86.2-17.1.x86_64 ..........................................................................................................................................................................................[done]Additional rpm output:
Warning: running kernel does not support fscaps
copying default config file to /etc/exim/exim.conf
Updating /etc/sysconfig/exim...
Failed to connect to bus: No such file or directory
systemctl restart dbus
Failed to connect to bus: No such file or directory

etc.

@therealkenc
Copy link
Collaborator

This is #2209 #1579 #994 et al. You are getting those errors because WSL does not run systemd (or anything that systemd usually starts, like dbus-daemon) at WSL instantiation. When zypper does an update, some of the package scripts launch systemctl which in turn uses theAF_UNIX dbussocket to communicate with systemd, and that fails because it is not there.

You can try making things a little happier by starting dbus manually. On Ubuntu sudo service dbus start works but on openSUSE Leap 42 it appears to not. You can fire it up manually with:

$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system

You need the mkdir because #2530. That will probably quash the "No such file or directory" error, but you'll almost certainly get subsequent fails like this because systemd is still not on the other end listening.

Work-around for now is to pretend you didn't see the errors; which are (to a first order) going to be harmless because none of the services the postinstall scripts are trying to tweak or restart are running anyway.

I'll hold this open for a bit because we don't get a lot of SUSE traffic around here and maybe some people would like to jump in with their current best practices and workarounds with respect to starting and stopping daemons on the platform. The landing zone for systemctl/systemd is #994 and the User Voice to support daemons is here (which will be closed soon because that's how they roll) and here for systemd specifically. Bonne chance.

@archon810
Copy link
Author

Thank you for the details. If anything, this bug report will serve as an explainer for everyone who will undoubtedly run into the same issue.

@therealkenc
Copy link
Collaborator

Duping this into #994 because no SUSE enthusiasts chimed in for a few weeks, and the work-around (ignore the warnings) falls under a larger umbrella of system startup ills.

@BrianZbr
Copy link

BrianZbr commented Jan 6, 2019

You can try making things a little happier by starting dbus manually. On Ubuntu sudo service dbus start works but on openSUSE Leap 42 it appears to not. You can fire it up manually with:

$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system

FWIW, I tried this, and now sudo systemctl status just gives me Failed to read server status: Input/output error instead of Failed to connect to bus: No such file or directory.

@theAkito
Copy link

You can try making things a little happier by starting dbus manually. On Ubuntu sudo service dbus start works but on openSUSE Leap 42 it appears to not. You can fire it up manually with:

$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system
Failed to get properties: Launch helper exited with unknown return code 1

This is what I am getting.

@DeathError
Copy link

similar problem with WSL debian.

$ sudo systemctl status apache2
Failed to connect to bus: No such file or directory
$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system
$ sudo systemctl status apache2
Failed to get properties: Launch helper exited with unknown return code 1

@theAkito
Copy link

similar problem with WSL debian.

$ sudo systemctl status apache2
Failed to connect to bus: No such file or directory
$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system
$ sudo systemctl status apache2
Failed to get properties: Launch helper exited with unknown return code 1

Same 10 minutes ago, for me.

@zxymike93
Copy link

You can try making things a little happier by starting dbus manually. On Ubuntu sudo service dbus start works but on openSUSE Leap 42 it appears to not. You can fire it up manually with:

$ sudo mkdir -p /run/dbus
$ sudo dbus-daemon --system
Failed to get properties: Launch helper exited with unknown return code 1

This is what I am getting.

I think #1990 explained this failure.

@canychan
Copy link

root@K8100:# netplan apply
Failed to reload daemon: Launch helper exited with unknown return code 1
Traceback (most recent call last):
File "/usr/sbin/netplan", line 23, in
netplan.main()
File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 55, in run
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 156, in command_apply
utils.systemctl_daemon_reload()
File "/usr/share/netplan/netplan/cli/utils.py", line 143, in systemctl_daemon_reload
subprocess.check_call(['systemctl', 'daemon-reload'])
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'daemon-reload']' returned non-zero exit status 1.
root@K8100:
# service dbus start
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
root@K8100:#
root@K8100:
# mkdir -p /run/dbus
root@K8100:# dbus-daemon --system
root@K8100:
# sudo netplan apply
Failed to reload daemon: Launch helper exited with unknown return code 1
Traceback (most recent call last):
File "/usr/sbin/netplan", line 23, in
netplan.main()
File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 55, in run
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/apply.py", line 156, in command_apply
utils.systemctl_daemon_reload()
File "/usr/share/netplan/netplan/cli/utils.py", line 143, in systemctl_daemon_reload
subprocess.check_call(['systemctl', 'daemon-reload'])
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'daemon-reload']' returned non-zero exit status 1.
root@K8100:#
root@K8100:
# reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.
root@K8100:~#

@therealkenc I've tried this command on Ubuntu20.04LTS in WSL2 and still hit the same issue, is it possible we assign a static IP for Ubuntu20.04?

@ejmarten
Copy link

ejmarten commented Aug 2, 2021

@ankit15588
Copy link

Final Solution :- (100% Working) :- Failed to connect to bus: No such file or directory

1.Run systemctl daemon-reload as root user

[root@Red-Hat-8_103 ~]# systemctl daemon-reload

2.Generate the Systemd Unit File again in /home/student/.config/systemd/user/ as student user ( you can login as per your user)

student@Red-Hat-8_103 user]$ podman generate systemd --name httpd_server_site1 --files
/home/student/.config/systemd/user/container-httpd_server_site1.service

  1. Now run systemctl --user daemon-reload

[student@Red-Hat-8_103 user]$ systemctl --user daemon-reload

@OmlineEditor
Copy link

something else helped me, I just installed the program:
sudo apt install dbus-user-session

@KrishKatamaneni
Copy link

sudo apt install dbus-user-session

sudo apt install dbus-user-session
Reading package lists... Done
Building dependency tree
Reading state information... Done
dbus-user-session is already the newest version (1.12.16-2ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.

Still the issue persist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests