question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

service is_running error in Ubuntu 16.04 docker container

See original GitHub issue

I’m using molecule with testinfra. I have two contaieners: ubuntu 16.04 and ubuntu 18.04. On new version the test work, but on the older I get:

$ molecule verify
(...)

    ============================= test session starts ==============================
    platform darwin -- Python 2.7.15, pytest-4.3.0, py-1.8.0, pluggy-0.9.0
    rootdir: /Users/tomasz/ansible-playbooks/plays/haproxy/molecule/default, inifile:
    plugins: testinfra-1.19.0
collected 4 items

    tests/test_default.py ...F                                               [100%]

    =================================== FAILURES ===================================
    ______________ test_service_is_running[ansible://ladon.amana.vpn] ______________

    host = <testinfra.host.Host object at 0x107235d50>

        def test_service_is_running(host):
            service = host.service('haproxy')

    >       assert service.is_running

    tests/test_default.py:26:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <service haproxy>

        @property
        def is_running(self):
            return self.run_expect(
    >           [0, 3], "systemctl is-active %s", self.name).rc == 0
    E       AssertionError: Unexpected exit code 1 for CommandResult(command=u'systemctl is-active haproxy', exit_status=1, stdout=u'', stderr=u'Failed to connect to bus: No such file or directory')
    E       assert 1 in [0, 3]
    E        +  where 1 = CommandResult(command=u'systemctl is-active haproxy', exit_status=1, stdout=u'', stderr=u'Failed to connect to bus: No such file or directory').rc

    /usr/local/lib/python2.7/site-packages/testinfra/modules/service.py:107: AssertionError
    ===================== 1 failed, 3 passed in 50.88 seconds ======================

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
philpepcommented, Apr 1, 2019

@TomaszKlosinski it’s released as 2.1.0

0reactions
TomaszKlosinskicommented, Apr 1, 2019

Great @philpep, thanks for the fix, you’re awsome!

By the way, in which version this will be released?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Processes are running slow in docker container on ubuntu 18.04
This is a bug report This is a feature request I searched existing issues before opening this one Processes are taking time when...
Read more >
docker - Container is not running - Stack Overflow
The docker exec command runs a new command in a running container. The command started using docker exec will only run while the...
Read more >
Docker service create complete, no error, but mounted share ...
On my Ubuntu 16.04 laptop, I did a 'docker service create' with two --mount statements. the command ran to completion, and service is...
Read more >
How to Debug and Fix Common Docker Issues - DigitalOcean
To install Docker on a server, you can follow the how-to guides for CentOS 7 or for Ubuntu 16.04. You can visit the...
Read more >
Root User and Password Inside a Docker Container - Baeldung
Here, we used “ubuntu:16.04” as the base image. Let's build the image using the docker build command: $ docker build -t baeldung ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found