level=error ts=2023-08-29T03:42:05.034852437Z caller=flush.go:221 org_id=fake msg="failed to flush user" err="open /data/loki/tmp/chunks/ZmFrZS81NjgxN2YyMm: no space left on device"
This is not a limit of open files error; this is a “no space left on device” error.
Are you checking the disk space and inode usage from within your container, or from the host OS?
The ENOSPC (“No space left on device”) error will be triggered in any situation in which the data or the metadata associated with an I/O operation can’t be written down anywhere because of lack of space. This doesn’t always mean disk space – it could mean physical disk space, logical space (e.g. maximum file length), space in a certain data structure or address space. For example you can get it if there isn’t space in the directory table (vfat) or there aren’t any inodes left. It roughly means “I can’t find where to write this down”.
For me, I am running Grafana/Promtail/Loki/Syslog-ng in Docker container environment on a single vm with 32Gb mem, 8 cores with a 8Tb bind mount. Ingesting upwards of 4000 network devices.
enabling large_dir and a restart of the Loki container fixed it instantly.