linuxserver / docker-syslog-ng

GNU General Public License v3.0
51 stars 9 forks source link

[BUG] Error opening file for writing; filename='/var/log/messages', error='No such file or directory (2)' #24

Closed Nikolay-Ch closed 3 months ago

Nikolay-Ch commented 3 months ago

Is there an existing issue for this?

Current Behavior

I download container and run it. Container create folders config and log and starts/

But it cant log nothing. In main log I get this: "Error opening file for writing; filename='/var/log/messages', error='No such file or directory (2)'"

Restarting container not helped to me.

Expected Behavior

No response

Steps To Reproduce

Ubuntu 20.22

Environment

- OS: Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-100-generic x86_64)
- How docker service was installed: Standard docker through apt install. Docker version 26.0.0, build 2ae903e

CPU architecture

x86-64

Docker creation

docker run -d \
   --name syslog-ng \
   --restart=unless-stopped \
   -p 514:5514/udp \
   -p 601:6601/tcp \
   -p 6514:6514/tcp \
   -e TZ=Europe/Moscow \
   -v /srv/syslog-ng/config:/config \
   -v /srv/syslog-ng/log:/var/log \
   lscr.io/linuxserver/syslog-ng

Container logs

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

homerr commented 3 months ago

Make sure you follow the documentation when creating the container, specifically making sure you set the PUID and PGID variables so that the file ownership is right.

Remove down the container and recreate following these steps;

https://github.com/linuxserver/docker-daapd/pull/75