gh-docker-logs
gh-docker-logs copied to clipboard
gh-docker-logs fails to collect all docker logs
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:

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):

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
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.
I have the issue where docker-compose logs aren't being collected, any tips?
does it work if you do a sleep and docker ps?