Upgrade instructions fail to mention creating /opt/netbox/logs #7210

Closed
opened 2025-12-29 20:20:30 +01:00 by adam · 6 comments
Owner

Originally created by @PenelopeFudd on GitHub (Nov 10, 2022).

Change Type

Correction

Area

Installation/upgrade

Proposed Changes

On the page https://docs.netbox.dev/en/stable/installation/upgrading/#5-restart-the-netbox-services , it should have a step "4.5" that says:

Create a new log directory:

sudo install -o netbox -g netbox -m 755 -d /opt/netbox/logs

Or you could move or copy the old log directory, YMMV.

If this is not done, step 5 will cause netbox to break!
Error message:

Server Error

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'FileNotFoundError'>

[Errno 2] No such file or directory: '/opt/netbox/logs/django-ldap-debug.log'

Python version: 3.8.10
NetBox version: 3.3.7

If further assistance is required, please post to the NetBox discussion forum on GitHub.

Originally created by @PenelopeFudd on GitHub (Nov 10, 2022). ### Change Type Correction ### Area Installation/upgrade ### Proposed Changes On the page https://docs.netbox.dev/en/stable/installation/upgrading/#5-restart-the-netbox-services , it should have a step "4.5" that says: > Create a new log directory: ``` sudo install -o netbox -g netbox -m 755 -d /opt/netbox/logs ``` Or you could move or copy the old log directory, YMMV. **If this is not done, step 5 will cause netbox to break!** Error message: > Server Error > > There was a problem with your request. Please contact an administrator. > > The complete exception is provided below: > > <class 'FileNotFoundError'> > > [Errno 2] No such file or directory: '/opt/netbox/logs/django-ldap-debug.log' > > Python version: 3.8.10 > NetBox version: 3.3.7 > > If further assistance is required, please post to the [NetBox discussion forum](https://github.com/netbox-community/netbox/discussions) on GitHub.
adam added the type: documentation label 2025-12-29 20:20:30 +01:00
adam closed this issue 2025-12-29 20:20:30 +01:00
Author
Owner

@PenelopeFudd commented on GitHub (Nov 10, 2022):

Alternative code:

sudo mkdir /opt/netbox/logs
sudo chown netbox:netbox /opt/netbox/logs
sudo chmod 755 /opt/netbox/logs

Or put an empty netbox-X.Y.X/logs directory in the tarball, then you'd only need:

sudo chown netbox:netbox /opt/netbox/logs

Or cram all of this into the update.sh script and call it a day. :-)

@PenelopeFudd commented on GitHub (Nov 10, 2022): Alternative code: ``` sudo mkdir /opt/netbox/logs sudo chown netbox:netbox /opt/netbox/logs sudo chmod 755 /opt/netbox/logs ``` Or put an empty netbox-X.Y.X/logs directory in the tarball, then you'd only need: ``` sudo chown netbox:netbox /opt/netbox/logs ``` Or cram all of this into the `update.sh` script and call it a day. :-)
Author
Owner

@PieterL75 commented on GitHub (Nov 14, 2022):

Better place for the logs is
/opt/netbox/netbox/local/logs/
That folder is excluded from git.

@PieterL75 commented on GitHub (Nov 14, 2022): Better place for the logs is /opt/netbox/netbox/local/logs/ That folder is excluded from git.
Author
Owner

@PenelopeFudd commented on GitHub (Nov 15, 2022):

Just remembered that git doesn't work with directories, only files. If we want it to create a log directory, we have to put a placeholder file in it.

After that, we can add (e.g.) logs/*.log in .gitignore, and have the best of both worlds: git will auto-create the log directory and won't accidentally commit log files.

@PenelopeFudd commented on GitHub (Nov 15, 2022): Just remembered that git doesn't work with directories, only files. If we want it to create a log directory, we have to put a placeholder file in it. After that, we can add (e.g.) `logs/*.log` in `.gitignore`, and have the best of both worlds: git will auto-create the log directory and won't accidentally commit log files.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 15, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jan 15, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@PenelopeFudd commented on GitHub (Jan 17, 2023):

What would the next step be?

@PenelopeFudd commented on GitHub (Jan 17, 2023): What would the next step be?
Author
Owner

@jeremystretch commented on GitHub (Feb 17, 2023):

Nothing should be logging to /opt/netbox/logs; there is no action to take here. You may want to evaluate your django-auth-ldap configuration. Please consider starting a discussion if you need further assistance.

@jeremystretch commented on GitHub (Feb 17, 2023): Nothing should be logging to `/opt/netbox/logs`; there is no action to take here. You may want to evaluate your `django-auth-ldap` configuration. Please consider starting a [discussion](https://github.com/netbox-community/netbox/discussions/new/choose) if you need further assistance.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7210