gh-docker-logs icon indicating copy to clipboard operation
gh-docker-logs copied to clipboard

gh-docker-logs fails to collect all docker logs

Open Trolldemorted opened this issue 4 years ago • 3 comments

gh-docker-logs does not gather all our logs under certain circumstances. We are running a container (among others) in gh actions like this:

      run: |
        cd service
        docker-compose up -d

This container crashes, but the last messages (aka the error and stacktrace) are not being collected:

grafik

Now if I do change the excerpt above to this:

      run: |
        cd service
        docker-compose up -d
        docker ps
        docker-compose logs

then the errors appear (but I think at the wrong position): grafik

As you can see, the permission error of n0t3b00k_service_n0t3b00k_1 is listed above the begin of its logs, and it is only shown if we do docker ps and docker-compose logs first. Did we do something wrong? This was very unexpected for me. In case you want to have a look at our code, it is here.

cc @ldruschk @gehaxelt

Trolldemorted avatar Apr 25 '21 22:04 Trolldemorted

I believe this might be related to the handling of stderr, since the logs which were missing/reorderer were emitted to stderr. Curiously, this seems to be working fine when writing the logs to files.

ldruschk avatar Apr 26 '21 10:04 ldruschk

I have the issue where docker-compose logs aren't being collected, any tips?

kaihendry avatar Aug 10 '23 09:08 kaihendry

does it work if you do a sleep and docker ps?

Trolldemorted avatar Oct 09 '23 19:10 Trolldemorted