jesseduffield / lazydocker

The lazier way to manage everything docker
MIT License
36.93k stars 1.18k forks source link

Logs tab is always empty #218

Open benjamin-feron opened 4 years ago

benjamin-feron commented 4 years ago

Describe the bug The Logs tab is empty for each containers but when I press "m" key, logs appears as well.

To Reproduce Steps to reproduce the behavior:

  1. Launch lazydocker
  2. Navigate in different containers -> Logs tab is still empty
  3. Press "m" key -> GUI disappears, logs are shown
  4. Press Ctrl+c -> GUI re-appears, Logs tab is still empty

Expected behaviour Logs tab should display content !

Desktop (please complete the following information):

docker-compose.yml

version: '3'
services:
  lazydocker:
    container_name: lazydocker
    image: lazyteam/lazydocker:version-0.9.1
    build:
      context: https://github.com/jesseduffield/lazydocker.git
      args:
        BASE_IMAGE_BUILDER: golang
        GOARCH: amd64
        GOARM:
    stdin_open: true
    tty: true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/local/lazydocker/:/.config/jesseduffield/lazydocker
    restart: always
firefox360 commented 4 years ago

Same problem here. Did you find any solution?

benjamin-feron commented 4 years ago

No solution found... an upgrade to version-0.9.1 had no effect :(

austingg commented 4 years ago

same problem here。

iangregsondev commented 4 years ago

I am using macOS and just installed via brew and the same here, services doesn't seem to activate the logs, its empty, clicking on the container does show though

iangregsondev commented 4 years ago

Actual maybe mine is more serious :-(

Stats, Config and Top are all blank also.

I am using docker-machine, I assume that should not matter?

I can see the logs by clicking the container but not services.

tylerstillwater commented 4 years ago

Same here - none of the tabs show output.

frqnck commented 4 years ago

Same issue, no outputs in any of the tabs, this since the last upgrade of Docker for Mac.

tylerstillwater commented 4 years ago

I'd be happy to help debug this, but I can't find a way to spit out errors from lazydocker, assuming it can do that.

Is there a way for me to make lazydocker spit out any errors it encounters? I'm assuming something changed with the latest Docker release that caused whatever pipe is in use to fail in some unexpected way.

I've tried the -d=true flag, but it didn't seem to do anything.

tylerstillwater commented 4 years ago

Ok, so the NewTickerTask in renderContainerLogs never sends the notifyStopped <- struct{}{} message, because the cmd.Wait() never returns, because the child process com.docker.cli logs --timestamps --follow --since=60m 65b3bf998bdeb0ad48ab59e6f7fc9954cf324e5192657163795b8ac5d83dd57 never exits.

if err := gui.OSCommand.Kill(cmd); err != nil {
    gui.Log.Warn(err)
}

That block finishes, does not spit out an error, but the log process continues to run. I have about 30 of them running right now, since I've been restarting lazydocker over and over.

tylerstillwater commented 4 years ago

Found the fix. Simply add gui.OSCommand.PrepareForChildren(cmd) on line 188 of containers_panel.go

jacobgoh101 commented 4 years ago

Thanks @tylerstillwater

I hope that the fix will be merged and released soon.

europ commented 4 years ago

Same problem when using container.

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock lazyteam/lazydocker
metronidazole commented 2 years ago

Does anyone still have this issue when using the docker container on synology?

jwesemann commented 2 years ago

@metronidazole : Having exactly this old behavior on a synology 718+

KostaGorod commented 2 years ago

having this behavior on dockerized version on rocky 8.6

xeruf commented 1 year ago

Did everybody here check https://github.com/jesseduffield/lazydocker#why-cant-i-see-my-containers-logs ?

As for me, I adjusted the command but the logs are still not shown for some containers :/

jesseduffield commented 1 year ago

I'm reopening cos it sounds like we're still having issues. On my machine sometimes container logs won't show until I hit enter to focus the logs panel. So that's clearly an issue on our side.

Let me know if you see the same behaviour @metronidazole @jwesemann @KostaGorod @xeruf (but also see if https://github.com/jesseduffield/lazydocker#why-cant-i-see-my-containers-logs helps you)

jwesemann commented 1 year ago

I just updated on my raspi (ARM64) to the latest version native & running a docker build.

I see all expected log entries directly without further key presses for native binary and docker-based lazydocker. "Expected" means containers which produced logs recently because documentation mentions that lazydocker shows only logs from the last 24 hour if I remember right.

The only thing I observe is that the docker variant does not show a version info in the bottom righ area.

I tested remotely using ssh in a standard terminal and a tmux session. Afterwards in a VNC GUI session with & without tmux.

I found no issues at all.

turbcool commented 2 months ago

Experienced this bug on Debian 12 (x64), both in binary installation and running inside a docker container.

Kenya-West commented 3 weeks ago

I think it is relative to logs that were not been updated since some time.

For example, I have logs from first container, the logs been spawned just now because I touched the container:

Details

![image](https://github.com/user-attachments/assets/e1f18481-54cb-40b3-bc19-0f373533d0d6)

While this one (the second) has the last log record on yesterday and does not display anything (even if I press M):

Details

![image](https://github.com/user-attachments/assets/d4bf51b9-db28-46ec-a424-0e1a58cf7152)

I checked logs of the second container manually and see they are exist:

Details

![image](https://github.com/user-attachments/assets/a9a41707-3069-4959-b387-595ff3a5b795)

All the containers are 2 days old.

My OS is always Ubuntu on any server:

Details

![image](https://github.com/user-attachments/assets/b8a46ed0-120f-49f8-a400-55dbabed7b3d)