Storj docker container fills drive with logs


lxc2

The above screeshots explain what the issue is, Docker does not have a default data limit when writing log files. The result is the drive filling up causing potential catastophic issues (corrupted storj), when Ram gets filled and there is no swap left.

My setup is having docker installed in lxc in proxmox
Proxmox>LXC>docker-Direct mount bind with host

I want to setup lograte or something similar to limit the max size of the log file. Problem is i don’t want to shutdown/nuke the container because i don’t want to risk starting over. I would gladly receive advice how i can mitigate this issue.

Best regards,
Storj operator

1 Like

i tried it, but it doesn’t work

/var/lib/docker/containers/a9b6f57e749032ab09e1192cce357fa0bbb29412c0150b241d5b15b8a1522657/a9b6f57e749032ab09e1192cce357fa0bbb29412c0150b241d5b15b8a1522657-json.log {
weekly
maxsize 200M
rotate 52
dateext
dateformat -%Y%m%d
compress
delaycompress
missingok
notifempty
copytruncate
}

i tried sh -c “truncate -s 0 /var/lib/docker/containers/a9b6f57e749032ab09e1192cce357fa0bbb29412c0150b241d5b15b8a1522657/a9b6f57e749032ab09e1192cce357fa0bbb29412c0150b241d5b15b8a1522657-json.log”

Which solved the issue because its now empty, but it continues to keep writing logs, with absurd sizes. Also im not longer able to read the logs in portainer

Add to /etc/docker/daemon.json

  "log-driver": "local",
  "log-opts": {
    "max-file": "3",
    "max-size": "500m"
  }

*docker service restart needed

this settings will be your defaults for all containers

1 Like

i ended up doing this
nano /etc/docker/daemon.json
{
“log-driver”: “json-file”,
“log-opts”: {“max-size”: “100m”, “max-file”: “3”}
}
docker stop -t 300 storagenode
reboot now
docker start storagenode
let’s wait and see :slight_smile:
unfortunately it did go to 0s up time :


welp that sucks :frowning:

I’m curious to know how long it takes to traffic back again…

Removing the container doesn’t remove the data.

1 Like

It still is not fixed Data log over 200 MB currently

Perhaps you have other containers?

docker ps -a

Also you may try to specify log options directly in your docker run command:

--log-opt max-size=100m \
--log-opt max-file=3 \

they should be provided before the image name (not after). And the max usage for these options should be 300MiB

1 Like

why dont u simply change the log level in the config.yaml file and restart the node?

the minimum log level to log

log.level: error

seems they already did so. Now they are wonder, why is it so?
(you shouldn’t reduce the log level below the info).