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

systemctl command: Failed to connect to bus: No such file or directory #26

Open
kozicpetar opened this issue Jan 27, 2022 · 3 comments
Open

Comments

@kozicpetar
Copy link

Hi,
I'm using this image for a while for my ansible roles and now I have issue which I didn't get before.

I get error:

fatal: [Ubuntu-18.04]: FAILED! => {"changed": false, "cmd": "/bin/systemctl", "msg": "Failed to connect to bus: No such file or directory", "rc": 1, "stderr": "Failed to connect to bus: No such file or directory\n", "stderr_lines": ["Failed to connect to bus: No such file or directory"], "stdout": "", "stdout_lines": []}

This is my molecule file, with privileged and ro cgroup:

platforms:
  - name: Ubuntu-18.04
    image: geerlingguy/docker-ubuntu1804-ansible:latest
    command: ${MOLECULE_DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true

When I login to container and run systemctl I get error:

Failed to connect to bus: No such file or directory

Same error I get for container geerlingguy/docker-debian10-ansible:latest

@kozicpetar
Copy link
Author

Looks like that is related with this issue for 20.04 also:
geerlingguy/docker-ubuntu2004-ansible#6

and if I understood that is related with new version of Docker.

Can we do something on image to bypass this problem?

@p3l1
Copy link

p3l1 commented Feb 23, 2022

What version of Docker are you using?
I've got the same problem on macOS with Docker Desktop 4.5.0 on Apple Silicon. Its currently the latest version.

@p3l1
Copy link

p3l1 commented Feb 23, 2022

For now I found another solution using docker-systemctl-replacement. It's quite easy to integreate in an existing Molecule test.
Here are the documentation and the instructions i followed.

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

2 participants