Skip to content

[LOGS]: on windows, logs do not show up / are extremely slow? #4237

Open

Description

@apostasie

Description

TestLogsWithFailingContainer has been failing repeatedly on windows (for eg in #4209 )

What this test does is:

nerdctl run --name foo busybox sh -euxc "echo foo; echo bar; exit 42; echo baz"

Then:

sleep 5

Still:

nerdctl logs foo

will very often return nothing.

5 seconds feels like a very long time - even in a highly parallel context.

Also, this does not happen on linux.

There seem to be something different with Windows, where logs take much longer to show up.
Note that this also happen on other tests.

@fahedouch are we missing sync on windows, or something like that?

Any idea why windows would be different?

Steps to reproduce the issue

Describe the results you received and expected

na

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Activity

  1. added
    bug
    and removed
    kind/unconfirmed-bug-claim
    on May 9, 2025
  2. apostasie commented on May 10, 2025

    @apostasie
    ContributorAuthor

    This is also happening on TestLogsOutStreamsSeparated (and probably just any log test for windows).

    Note that none of it is about waiting for a container started with -d.
    All these failures are containers running and finishing in one command, with seemingly nothing in the logs.

  3. apostasie commented on Jun 20, 2025

    @apostasie
    ContributorAuthor

    This is not only Windows.

    #4326 just hit this.

    https://github.com/containerd/nerdctl/actions/runs/15777183949/job/44474557265?pr=4326

    Container does run AND echo what it should.

     container_logs_test.go:248: 
            
            +------------------------------------------------------------------------------------------------------------+
            | ➡️      | ⚙️ /usr/local/bin/nerdctl run --name testlogswithfailingcontainer-d19fdff4 ghcr.io/stargz-contai |
            |         | ners/alpine:3.13-org sh -euxc echo foo; echo bar; exit 42; echo baz                              |
            +------------------------------------------------------------------------------------------------------------+
            |         | 🚫 command returned a non-zero exit code                                                         |
            +------------------------------------------------------------------------------------------------------------+
            |         | ⚠️ 42                                                                                            |
            +------------------------------------------------------------------------------------------------------------+
            |         | 🟢 foo                                                                                           |
            |         | bar                                                                                              |
            +------------------------------------------------------------------------------------------------------------+
            |         | 🟠 + echo foo                                                                                    |
            |         | + echo bar                                                                                       |
            |         | + exit 42                                                                                        |
            +------------------------------------------------------------------------------------------------------------+
            | 🌱      | XDG_SESSION_TYPE=tty                                                                             |
            |         | HOME=/home/rootless                                                                              |
            |         | XDG_SESSION_CLASS=user                                                                           |
            |         | XDG_SESSION_ID=3                                                                                 |
            |         | XDG_RUNTIME_DIR=/run/user/1000                                                                   |
            |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
            |         | :/bin:/usr/games:/usr/local/games:/snap/bin                                                      |
            |         | DOCKER_CONFIG=/tmp/TestLogsWithFailingContainer1882762106/003                                    |
            |         | NERDCTL_TOML=/tmp/TestLogsWithFailingContainer1882762106/003/nerdctl.toml                        |
            +------------------------------------------------------------------------------------------------------------+
            | ⏰      | <1s (limit: 3m0s)                                                                                |
            +------------------------------------------------------------------------------------------------------------+
            | 📁      | /tmp/TestLogsWithFailingContainer1882762106/002                                                  |
            +------------------------------------------------------------------------------------------------------------+
    

    But there is nothing in the logs:

    container_logs_test.go:257: 
            
            +------------------------------------------------------------------------------------------------------------+
            | ➡️      | ⚙️ /usr/local/bin/nerdctl logs testlogswithfailingcontainer-d19fdff4                             |
            +------------------------------------------------------------------------------------------------------------+
            |         | 🟠 + echo foo                                                                                    |
            |         | + echo bar                                                                                       |
            |         | + exit 42                                                                                        |
            +------------------------------------------------------------------------------------------------------------+
            | 🌱      | XDG_SESSION_TYPE=tty                                                                             |
            |         | HOME=/home/rootless                                                                              |
            |         | XDG_SESSION_CLASS=user                                                                           |
            |         | XDG_SESSION_ID=3                                                                                 |
            |         | XDG_RUNTIME_DIR=/run/user/1000                                                                   |
            |         | PATH=/usr/local/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin |
            |         | :/bin:/usr/games:/usr/local/games:/snap/bin                                                      |
            |         | DOCKER_CONFIG=/tmp/TestLogsWithFailingContainer18[827](https://github.com/containerd/nerdctl/actions/runs/15777183949/job/44474557265?pr=4326#step:10:828)62106/003                                    |
            |         | NERDCTL_TOML=/tmp/TestLogsWithFailingContainer1882762106/003/nerdctl.toml                        |
            +------------------------------------------------------------------------------------------------------------+
            | ⏰      | <1s (limit: 3m0s)                                                                                |
            +------------------------------------------------------------------------------------------------------------+
            | 📁      | /tmp/TestLogsWithFailingContainer1882762106/002                                                  |
            +------------------------------------------------------------------------------------------------------------+
            
        container_logs_test.go:257: 	🔗 
            
            <<<<<<<<<<<<<<<<<<<<
            	🖊️ Inspecting output (equals)
            	👀 testing:		``
            	❌ FAILED!		= `foo
            bar
            `
            >>>>>>>>>>>>>>>>>>>>
    

    @fahedouch do we have some serious problem with logs?

  4. fahedouch commented on Jun 20, 2025

    @fahedouch
    Member

    Ok. I will try to find some time to check the logging workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions