Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRRd won't start if the log file doesn't already exist #937

Closed
tangledhelix opened this issue Apr 24, 2024 · 1 comment · Fixed by #941
Closed

IRRd won't start if the log file doesn't already exist #937

tangledhelix opened this issue Apr 24, 2024 · 1 comment · Fixed by #941

Comments

@tangledhelix
Copy link
Member

Describe the bug
On a fresh installation, IRRd will not start if the configured logfile_path does not exist. The error emitted is similar to:

2024-04-24 17:42:36,047 irrd[7]: [root#CRITICAL] Unable to start: logfile /var/log/irrd/irrd.log not writable by UID 1000 / GID 1000

In this case, /var/log/irrd/ exists, owner:group is irrd:irrd, uid 1000, gid 1000 - but the logfile itself is missing.

This is counter to the documentation, which reads (emphasis mine):

Running as a non-privileged user
log.logfile_path, which should either exist with write permissions for the irrd user, or the irrd user should have write access to the directory. Note that if you use log rotation, you must ensure a new file with proper permissions is created before IRRd writes to it, or give write access to the directory.

To Reproduce
Start up with the logfile not existing already on disk.

Expected behaviour
Expected normal startup.

IRRd version you are running
4.4.3

Additional context
I believe this is a regression bug introduced in 4.3, probably by #666.

if staged_logfile_path and not os.access(staged_logfile_path, os.W_OK, effective_ids=True):

os.access() can only return true here if the log file exists - write access to the enclosing directory isn't sufficient to satisfy this test.

@mxsasha
Copy link
Collaborator

mxsasha commented Apr 25, 2024

Sounds like a plausible cause, yes.

mxsasha added a commit that referenced this issue Apr 25, 2024
mxsasha added a commit that referenced this issue Apr 25, 2024
mergify bot pushed a commit that referenced this issue Apr 25, 2024
mergify bot pushed a commit that referenced this issue Apr 25, 2024
mxsasha added a commit that referenced this issue Apr 25, 2024
@mxsasha mxsasha linked a pull request Apr 25, 2024 that will close this issue
mxsasha added a commit that referenced this issue Apr 25, 2024
mergify bot pushed a commit that referenced this issue Apr 25, 2024
mergify bot pushed a commit that referenced this issue Apr 25, 2024
mxsasha pushed a commit that referenced this issue Apr 25, 2024
mxsasha added a commit that referenced this issue Apr 25, 2024
Introduced in #666

(cherry picked from commit 2f4ca06)
mxsasha pushed a commit that referenced this issue Apr 25, 2024
mxsasha added a commit that referenced this issue Jan 14, 2025
mxsasha added a commit that referenced this issue Jan 14, 2025
mxsasha added a commit that referenced this issue Jan 14, 2025
mxsasha added a commit that referenced this issue Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants