vmorganp / Lazytainer

Docker container lazy loading
MIT License
576 stars 20 forks source link

No packets being detected, but puts the container to sleep #41

Closed BackedUpBooty closed 9 months ago

BackedUpBooty commented 9 months ago

I've managed to spin up lazytainer and the target container (in this case carlogger) where LT can and does pause CL after 60 seconds if inactivity. During those 60 seconds I can access CL as you'd expect, but LT doesn't detect any packets (running VERBOSE=true, it's showing 0 packets). This is with me clicking around different pages and accessing the GUI for the CL service.

I'm obviously missing something here but can't figure it out. I've spun up the examples separately for satisfactory and minecraft practically verbatim (changed the volumes for those two services only) and the same kind of behaviour persists. It's not a firewall issue, the subnet is wide open for testing this, and LT does put these containers on pause/stop (whichever is specified).

Any idea what (probably really simple thing) I could be missing?

services:
  ## CarLogger (lubelogger)
  carlogger:
    image: ghcr.io/hargata/lubelogger:latest
    container_name: carlogger
    restart: unless-stopped
    network_mode: service:lazytainer
    mem_limit: 4g
    cpu_shares: 1024
    security_opt:
      - no-new-privileges:true    
    volumes:
      - ./carlogger/config:/App/config
      - ./carlogger/data:/App/data
      - ./carlogger/documents:/App/wwwroot/documents
      - ./carlogger/images:/App/wwwroot/images
      - ./carlogger/temp:/App/wwwroot/temp
      - ./carlogger/log:/App/log
      - ./carlogger/keys:/root/.aspnet/DataProtection-Keys
    #ports:
    #  - 9099:8080
    depends_on:
      - lazytainer
    labels:
      - "lazytainer.group=ytdl"

  lazytainer:
    container_name: lazytainer
    image: ghcr.io/vmorganp/lazytainer:master
    environment:
      - VERBOSE=true # probably set this to false unless you're debugging or doing the initial demo
    ports:
      - 9099:8080 #carlogger
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      - "lazytainer.group.carlogger.pollRate=1"
      - "lazytainer.group.carlogger.inactiveTimeout=60"
      - "lazytainer.grou.carlogger.minPacketThreshold=1"
      - "lazytainer.group.carlogger.ports=9099"
      - "lazytainer.group.carlogger.sleepMethod=pause" # can be either "stop" or "pause", or left blank for stop
vmorganp commented 9 months ago

The port specified in this line: - "lazytainer.group.carlogger.ports=9099" should be the internal port, so in your case 8080

Once you change that, you're also going to run into an issue with these:

  1. Missing the p in group in this line, which should still work because of the default, but not as you'd expect.
        - "lazytainer.grou.carlogger.minPacketThreshold=1"
                          ^
  2. The group you're using on your carlogger container is ytdl instead of carlogger
vmorganp commented 9 months ago

Port explanation has been updated in 02a005d620b2b05e0b4648363ccf7eb1e8bd39b4 Investigating the other examples that you mentioned don't work.

vmorganp commented 9 months ago

I'm unable to reproduce the issues you mentioned with mc and satisfactory aside from the particular image tag for minecraft apparently not working anymore.

The lazytainer part is fine though. I guess it could be a "wOrKs oN mY mAcHiNe" situation, but I'd be curious what your logs/config/system are like.

BackedUpBooty commented 9 months ago

so the internal port thing... that went over my head, didn't realise it needed to be that. I'm pretty sure I checked with internal port too, but missing the p in group was a bit silly, well spotted. the ytdl thing - i'd actually changed the group.ytdl to group.carlogger just for this and forgot to update.

So... it works - it now detects packets! No idea why the mc and satisfactory weren't working - I tried them specifically to see if I was doing something dumb but couldn't get them to work either. looks like I might have to be one of those 'i didn't touch a thing and it just started working all of a sudden' type of people this time round. really appreciate the quick replies.

Just to give something back... I like that this also works through the socket proxy so I don't have to expose the docker.sock.