You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Regression in v1.2.0] nerdctl logs exits silently for nerdctl run w/o -d #1946
nerdctl run --name=foo alpine echo foo
nerdctl logs foo
v1.1.0 fails as expected (because -d is not specified and the logging driver is not enabled)
FATA[0000] open /home/suda/.local/share/nerdctl/1935db59/containers/default/ed96e51c4c5f9b3d64cae624cba6b33ff3b9db3ed3b0224cc4bb02d1cbfc1a5c/log-config.json: no such file or directory
@AkihiroSuda We have an other issue here nerdctl run --name=foo alpine echo foo is not printing foo to stdout. Looks like nerdctl logs is not triggered behind the scene. Is it normal ?
The regression isn't critical, so we can defer fixing this to v1.3 or later.
Maybe even no need to fix it, as long as we mention this behavior in nerdctl logs --help
changed the title [-][Regression in main] `nerdctl logs` exits silently for `nerdctl run` w/o `-d`[/-][+][Regression in v1.2.0] `nerdctl logs` exits silently for `nerdctl run` w/o `-d`[/+]on Jan 31, 2023
Hi @fahedouch, I had a look at the purposed fix in the draft PR above and it looked like you are attempting to build a feature similar to Docker's dual logging. For the purpose of this issue, if the goal is to restore previous behavior, then the change would be to restore the line here: c67b102#diff-21f959b0a9d34cee85c5c25014fe6cef81d7c30c93c5294231cf6ea80f0f65c9L495
Currently an empty file is being created for containers run without -d which causes the os.Stat to succeed on nerdctl logs walk.
Dual logging is a nice to have but is likely much more involved and can be covered by #1657.
restore the the above line means no log persistance for nerdctl run w/o -d, that means we lost logs when restart container. I believe that we can accept this regression as is not critical and focus on how to complete the log flow by attempting to make a dual logging for nerdctl run w/o -d.
restore the the above line means no log persistance for nerdctl run w/o -d, that means we lost logs when restart container
Not quite, log persistence is not supported for containers ran without -d. See here. Also restart container uses detached so that case is covered. Reference here.
Not quite, log persistence is not supported for containers ran without -d.
You are right. it is a non complete fix introduced by this commit. the log persistence need this change to be ok, but this change needs the dual logging to satisfy CI tests. So we have two option:
Activity
fahedouch commentedon Jan 28, 2023
Because of this c67b102#diff-464b1e1a904b2f79ca04e2202190403c19f87a135b6a9e1ef2e65fa52772a221R85
Condition should be replaced by
if logURI != ""AkihiroSuda commentedon Jan 28, 2023
Thanks, would you like to open a PR?
fahedouch commentedon Jan 28, 2023
Sure
fahedouch commentedon Jan 28, 2023
@AkihiroSuda We have an other issue here
nerdctl run --name=foo alpine echo foois not printingfooto stdout. Looks likenerdctl logsis not triggered behind the scene. Is it normal ?AkihiroSuda commentedon Jan 28, 2023
Can't repro on my side
fahedouch commentedon Jan 28, 2023
@AkihiroSuda Yes sorry, it is fine until this fix
AkihiroSuda commentedon Jan 30, 2023
The regression isn't critical, so we can defer fixing this to v1.3 or later.
Maybe even no need to fix it, as long as we mention this behavior in
nerdctl logs --help[-][Regression in main] `nerdctl logs` exits silently for `nerdctl run` w/o `-d`[/-][+][Regression in v1.2.0] `nerdctl logs` exits silently for `nerdctl run` w/o `-d`[/+]austinvazquez commentedon Feb 23, 2023
Hi @fahedouch, I had a look at the purposed fix in the draft PR above and it looked like you are attempting to build a feature similar to Docker's dual logging. For the purpose of this issue, if the goal is to restore previous behavior, then the change would be to restore the line here: c67b102#diff-21f959b0a9d34cee85c5c25014fe6cef81d7c30c93c5294231cf6ea80f0f65c9L495
Currently an empty file is being created for containers run without
-dwhich causes theos.Statto succeed onnerdctl logswalk.Dual logging is a nice to have but is likely much more involved and can be covered by #1657.
fahedouch commentedon Feb 23, 2023
hi @austinvazquez,
restore the the above line means no log persistance for
nerdctl runw/o-d, that means we lost logs when restart container. I believe that we can accept this regression as is not critical and focus on how to complete the log flow by attempting to make a dual logging fornerdctl runw/o-d.austinvazquez commentedon Feb 23, 2023
Not quite, log persistence is not supported for containers ran without -d. See here. Also restart container uses detached so that case is covered. Reference here.
fahedouch commentedon Feb 24, 2023
@austinvazquez
You are right. it is a non complete fix introduced by this commit. the log persistence need this change to be ok, but this change needs the dual logging to satisfy CI tests. So we have two option:
cc @AkihiroSuda WDYT ?
AkihiroSuda commentedon Feb 24, 2023
No need to rollback the commit, this is a non-critical.
austinvazquez commentedon Feb 24, 2023
Sounds good thanks folks @fahedouch @AkihiroSuda. Will focus efforts on dual logging design.
apostasie commentedon Apr 20, 2025
Hey folks.
Wondering if this is still a problem here?
With nerdctl v2 what we get is:
AkihiroSuda commentedon Apr 21, 2025
Thanks, this seems closable now, and the current behavior corresponds to Docker