Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

"Cannot autolaunch D-Bus without X11 $DISPLAY" while running tox test on dockerfile #3758

Closed
zeitounator opened this issue Nov 29, 2022 · 0 comments
Labels

Comments

@zeitounator
Copy link
Contributor

zeitounator commented Nov 29, 2022

Issue Type

  • Bug report

Molecule and Ansible details

ansible --version && molecule --version
ansible [core 2.14.0]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/Sources/molecule/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/Sources/molecule/.venv/bin/ansible
  python version = 3.9.5 (default, Nov 23 2021, 15:27:38) [GCC 9.3.0] (/home/user/Sources/molecule/.venv/bin/python)
  jinja version = 3.1.2
  libyaml = True
INFO     Found config file /home/user/Sources/molecule/.config/molecule/config.yml
molecule 4.0.4.dev28 using python 3.9 
    ansible:2.14.0
    delegated:4.0.4.dev28 from molecule
    docker:2.1.0 from molecule_docker requiring collections: community.docker>=3.0.2 ansible.posix>=1.4.0

Molecule installation method (one of):

  • pip (editable inside a venv)

Ansible installation method (one of):

  • pip

Detail any linters or test runners used:
tox as configured in the molecule source tree

Desired Behavior

Running tox should run all tests and succeed (as long as current branch is ok). This includes dockerfile tests

Actual Behaviour

All of the below happens by simply running tox

I have the following configuration for my docker client (i.e. only relevant part) in ~/.docker/config.json

{
        "auths": {},
        "credsStore": "secretservice"
}

This instruct docker to store the credentials in my local linux keystore whenever I issue a docker login rather than in clear text inside the json file.

For a reason I did not yet understand and although none of the relevant builds require credentials for a any docker registry while running tox dockerfile tests, all image builds fail with the following error message (abridged) regardless of the origin of their base image.

TASK [Test Dockerfile template] ***********************************************************************

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.community.docker.plugins.module_utils._api.credentials.errors.StoreError: Credentials store docker-credential-secretservice exited with "Cannot autolaunch D-Bus without X11 $DISPLAY".

The workaround solution is actually trivial but I have no idea at this point if it is acceptable. I could fix by just adding a line to tox.ini, i.e.:

# do not put * in passenv as it may break builds do to reduced isolation
passenv =
    DISPLAY
    [... rest of existing env in file ...]

Let me know if this would be an acceptable change and also if you want a PR for this. Else I can give any other needed information if you need more details.

@ansible ansible locked and limited conversation to collaborators Nov 29, 2022
@zhan9san zhan9san converted this issue into discussion #3759 Nov 29, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant