# Storj docker container fills drive with logs

**URL:** <https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519>\
**Category:** troubleshooting\
**Tags:** docker, log-rotate\
**Created:** [June 8, 2024, 7:52pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519 "2024-06-08T19:52:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![1arrcy1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/1arrcy1/32/7825_2.png) [@1arrcy1](https://forum.storj.io/u/1arrcy1)\
**Post date:** [June 8, 2024, 7:52pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/1 "2024-06-08T19:52:09Z")

</div>

![lxc](https://storj-s3.bcdn.literatehosting.net/original/3X/c/0/c0388c20b46badac6760da3ca2f7922a6f30230f.png)  
 ![lxc2](https://storj-s3.bcdn.literatehosting.net/original/3X/7/2/72c4ce99cc5208e4f26218de1d21c1014993add6.png)  
 ![lxc 3](https://storj-s3.bcdn.literatehosting.net/original/3X/6/8/682313ffe1aaa3f6c25d4ebbbb20ae346c407d1f.png)

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

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [June 8, 2024, 8:07pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/2 "2024-06-08T20:07:04Z")

</div>

> [@All my nodes keep restarting since last night: "/var/log/supervisor/supervisord.log does not exist"](https://forum.storj.io/t/all-my-nodes-keep-restarting-since-last-night-var-log-supervisor-supervisord-log-does-not-exist/18206/8):
>
> Yes, the simplest way is to configure logrotate to manage your storagenode logs. It should already be running on your system. I recommend placing a logrotate config specifically for your node(s) in the /etc/logrotate.d folder. For example, I have a file /etc/logrotate.d/storagenode (it can have any name). The file contents are: /path/to/logs/storj\*/storagenode\*.log { su username username weekly maxsize 200M rotate 52 dateext dateformat -%Y%m%d …

---

<div class="post-metadata">

**Author:** ![1arrcy1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/1arrcy1/32/7825_2.png) [@1arrcy1](https://forum.storj.io/u/1arrcy1)\
**Post date:** [June 8, 2024, 8:33pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/3 "2024-06-08T20:33:46Z")

</div>

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  
}

 ![4](https://storj-s3.bcdn.literatehosting.net/original/3X/b/8/b8e6b9355b3d8f987dc1377da7f890740a724ee8.png)

---

<div class="post-metadata">

**Author:** ![1arrcy1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/1arrcy1/32/7825_2.png) [@1arrcy1](https://forum.storj.io/u/1arrcy1)\
**Post date:** [June 8, 2024, 8:46pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/4 "2024-06-08T20:46:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![974ffa23d764cf444641](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/974ffa23d764cf444641/32/1135_2.png) [@974ffa23d764cf444641](https://forum.storj.io/u/974ffa23d764cf444641)\
**Post date:** [June 8, 2024, 8:50pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/5 "2024-06-08T20:50:25Z")

</div>

Add to /etc/docker/daemon.json

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

```

\*docker service restart needed

this settings will be your defaults for all containers

---

<div class="post-metadata">

**Author:** ![1arrcy1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/1arrcy1/32/7825_2.png) [@1arrcy1](https://forum.storj.io/u/1arrcy1)\
**Post date:** [June 8, 2024, 9:01pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/6 "2024-06-08T21:01:18Z")

</div>

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 🙂  
unfortunately it did go to 0s up time :

 ![8](https://storj-s3.bcdn.literatehosting.net/original/3X/b/8/b82f3e577bda9e3b072b2570ae2bb1876affbfd4.png)

 ![6](https://storj-s3.bcdn.literatehosting.net/original/3X/f/5/f572ef1de17d1238d2ffb9cef7ca39ac39c09533.png)  
welp that sucks ☹

---

<div class="post-metadata">

**Author:** ![agente](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/agente/32/1137_2.png) [@agente](https://forum.storj.io/u/agente)\
**Post date:** [June 8, 2024, 9:36pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/7 "2024-06-08T21:36:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![donald.m.motsinger](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/donald.m.motsinger/32/71_2.png) [@donald.m.motsinger](https://forum.storj.io/u/donald.m.motsinger)\
**Post date:** [June 8, 2024, 9:50pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/8 "2024-06-08T21:50:10Z")

</div>

> [@1arrcy1](#):
>
> Problem is i don’t want to shutdown/nuke the container because i don’t want to risk starting over.

Removing the container doesn’t remove the data.

---

<div class="post-metadata">

**Author:** ![1arrcy1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/1arrcy1/32/7825_2.png) [@1arrcy1](https://forum.storj.io/u/1arrcy1)\
**Post date:** [June 8, 2024, 10:00pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/9 "2024-06-08T22:00:44Z")

</div>

It still is not fixed Data log over 200 MB currently

 ![10](https://storj-s3.bcdn.literatehosting.net/original/3X/1/1/1135e84d3340714e7813ef9139c49cb0fb77c1aa.png)

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 9, 2024, 3:08am UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/10 "2024-06-09T03:08:23Z")

</div>

Perhaps you have other containers?

```auto
docker ps -a

```

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

```auto
--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

---

<div class="post-metadata">

**Author:** ![JoshieGarza](https://storj.bcdn.literatehosting.com/letter_avatar/joshiegarza/32/6_449c533f586939b6e5f246632a46421f.png) [@JoshieGarza](https://forum.storj.io/u/JoshieGarza)\
**Post date:** [June 9, 2024, 2:49pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/11 "2024-06-09T14:49:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [June 9, 2024, 4:05pm UTC](https://forum.storj.io/t/storj-docker-container-fills-drive-with-logs/26519/12 "2024-06-09T16:05:38Z")

</div>

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