[Support] Linuxserver.io - Netbox


Recommended Posts

For me, I found that my netbox configuration.py file was not being properly updated with the variables passed.  To take a look, console in to your netbox container, and view /app/netbox/netbox/netbox/configuration.py.  I simply edited that file directly, saved, and then restarted the docker container.

Link to comment

I looked up my installation notes... not sure if this is helpful, but these are the steps I used to get netbox up and running:

 

First install Postgres11 docker container, enter POSTGRES_PASSWORD, keep other default values 

 

Console in to postgres container 

 

su postgres 

psql 

 

CREATE DATABASE netbox; 

\l to verify it was created 

 

GRANT ALL PRIVILEGES ON DATABASE netbox TO postgres; 

\l to verify permissions 

 

\q and exit console. 

 

Next install Redis container, keep default values. 

 

Next install netbox container, username for admin account, admin. specify admin password.  allowed host *.  database name netbox. Database user postgres. Database password. Database host <<unraid IP>>. database port 5432.  redis host <<unraid IP>>.  leave all other values as defaults.

 

Netbox container will start, but with errors. 

 

Bring up log of netbox console from docker tab in unraid interface... I saw errors related to deprecated usage of DEFAULT_TIMEOUT for redis server 

 

Console in to the netbox container 

 

cd into /app/netbox/netbox/netbox and edit the configuration.py file 

 

Change all values (should be two of them)  of DEFAULT_TIMEOUT to RQ_DEFAULT_TIMEOUT 

 

Save file, exit console, and then restart container from the docker tab in unraid 

 

Console in again to netbox container, run the following commands 

 

cd /app/netbox/netbox 

python3 ./manage.py createsuperuser 

 

Open the the webGUI for netbox from the docker tab in unraid 

 

Log in as admin 

Edited by DarkHorse
  • Like 1
  • Thanks 2
Link to comment
On 11/7/2020 at 12:51 PM, DarkHorse said:

For me, I found that my netbox configuration.py file was not being properly updated with the variables passed.  To take a look, console in to your netbox container, and view /app/netbox/netbox/netbox/configuration.py.  I simply edited that file directly, saved, and then restarted the docker container.

The config looked good on my end with my latest changes. But something escaped me and I noticed about it only later...more after the next quote.

On 11/7/2020 at 1:57 PM, DarkHorse said:

Console in to the netbox container 

 

cd into /app/netbox/netbox/netbox and edit the configuration.py file 

 

Change all values (should be two of them)  of DEFAULT_TIMEOUT to RQ_DEFAULT_TIMEOUT 

 

Save file, exit console, and then restart container from the docker tab in unraid 

 

Console in again to netbox container, run the following commands 

 

cd /app/netbox/netbox 

python3 ./manage.py createsuperuser 

 

Open the the webGUI for netbox from the docker tab in unraid 

 

Log in as admin

With your steps, I've been able to figure a few things I forgot about when trying to run this.
Database names are always in lowercase. Dunno why I wrote it in uppercase. Creating the database reminded me of this after the database was listed as « netbox » even though I supplied « Netbox ». Oops. That resolved the Python exceptions I was getting.

After that, I was still getting the 400 HTTP error. At this point, I was thinking maybe it was borked and so, I removed the container and repulled it with all the right environment variables.

Once that was done, I basically only had to correct the deprecated Redis command and I was greeted with Netbox' web panel! (Hooray!)

 

I'll check if there's a way I can contribute to the container for correcting the deprecated Redis command and the database name that could be automatically converted in lowercase before being written to the config. Just in case another noob like me does that mistake too. Especially since the library/postgre container does that by itself already (so, the noob me never noticed he had put capitalized letters upon runtime because hey, everything's fine on the database's creation part still).

 

Anyway, thank you lots for these helpful details!

Edited by campfred
Forgot to add a very important thank you. Sorry!
Link to comment
  • 6 months later...

For anyone else having any issues with an error of

"invalid http request size max 4096 skip"

Drove me mad, but turns out you simply cant access this using an ip address, it must have a domain. easy fix i guess would be to chuck your server ip in as a dns record on your router and just navigate to servername:port
 

Edited by fwark
Link to comment
  • 1 month later...

Anyone willing to walk me through how to get this going properly?  Took me a minute to figure out that this had some pre-reqs, but wasn't mentioned on the template until you install. 

 

Any particular postgres or redis installations recommended?  Just want to get up and running quickly.

Link to comment
  • 1 month later...

I'm getting "Bad Request (400)" and have this error in the log. Unless I completely missed it, I couldn't find an answer to the FATAL hook failed error.

 

240 static files copied to '/app/netbox/netbox/static'.
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py clearsessions" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py invalidate all" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
Unknown command: 'invalidate'
Type 'manage.py help' for usage.
command "/usr/bin/python3 ./manage.py invalidate all" exited with non-zero code: 1
Sun Sep 12 21:53:10 2021 - FATAL hook failed, destroying instance

 

I have postgres11 and redis installed using their own IPs with the netbox container configured to point to those. Any ideas?

 

Link to comment
  • 3 months later...
On 9/12/2021 at 8:58 PM, jburgon said:

I'm getting "Bad Request (400)" and have this error in the log. Unless I completely missed it, I couldn't find an answer to the FATAL hook failed error.

 

240 static files copied to '/app/netbox/netbox/static'.
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py clearsessions" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py invalidate all" (pre app)...
/app/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:54: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
Unknown command: 'invalidate'
Type 'manage.py help' for usage.
command "/usr/bin/python3 ./manage.py invalidate all" exited with non-zero code: 1
Sun Sep 12 21:53:10 2021 - FATAL hook failed, destroying instance

 

I have postgres11 and redis installed using their own IPs with the netbox container configured to point to those. Any ideas?

 

 

Same issue for me: It used to work fine.

 

Python version: 3.9.7 (default, Nov 24 2021, 21:15:59) [GCC 10.3.1 20211027]
Python main interpreter initialized at 0x14ca7d482bf0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(

0 static files copied to '/app/netbox/netbox/static', 240 unmodified.
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(

0 static files copied to '/app/netbox/netbox/static', 240 unmodified.
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py clearsessions" (pre app)...
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
running "exec:/usr/bin/python3 ./manage.py invalidate all" (pre app)...
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
Unknown command: 'invalidate'
Type 'manage.py help' for usage.
command "/usr/bin/python3 ./manage.py invalidate all" exited with non-zero code: 1
Wed Dec 15 14:52:40 2021 - FATAL hook failed, destroying instance
SIGINT/SIGQUIT received...killing workers...
/app/netbox/netbox/./netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/./netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x14ca7d482bf0 pid: 295 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 295)
spawned uWSGI worker 1 (pid: 314, cores: 1)
[uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 99 gid: 100)
/app/netbox/netbox/netbox/settings.py:57: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(
/app/netbox/netbox/netbox/settings.py:61: UserWarning: The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
warnings.warn(

 

Edited by TheBrian
Link to comment
  • 3 weeks later...

I'm fairly upset about this container.   


It should not be like pulling teeth.  Instructions should be clear on the Unraid app page.   It does not specify that one has to install a redis container and postgress database container.   


Not everyone has the knowledge to instantly know this.  ... throw the unraid community a bone.  

Link to comment

Sure, a better overview could have been included (and in the read me first) but an additional tag and flag for Apps has recently been introduced to explicitly state additional requirements but until the release of Unraid 6.10 stable it won't wind up being utilized commonly.

 

But I'm adding it manually to highlight that you need Redis and PostGres installed

Link to comment
  • 4 months later...

Hey, first of all thank you for providing this great container.


With a little bit of tinkering and trail & error i got netbox to run and i love it.

 

But there is one little thing that isn working, its the offline documentation.
When i try to open the documentation i get "/static/docs/ The request page does not exist".

I checked the path inside the container and that folder does exist.

I tried changing the BASE_PATH variable but to no avail.

 

Any ideas?

Link to comment
  • 3 months later...

This unraid template should be revised, as well as the configuration.py default file. 

 

Noticed issues : 

  • When initializing the container for the first time, there is an error l. 246 in configuration.py. A "}" at the end of the line is causing an error. It conflicts with REMOTE_AUTH_DEFAULT_PERMISSIONS default value, this character should not be already there. 
  • Most default values for Environment Variables are incorrectly set. Currently, variables values are set to be the ENV variable name by default, which is causing a lot of errors during initialization. Indeed, since configuration.py is written when the container is started for the first time, having wrong values does not prevent the container to start and result in a config file with many errors, which has to be corrected later on. Instead, ENV var that are required to be set by user should be empty to prevent the container to start if not set. According to https://docs.linuxserver.io/images/docker-netbox, default values should be set as follow : 
    • SUPERUSER_EMAIL* : SUPERUSER_EMAIL 'empty'
    • SUPERUSER_PASSWORD*: SUPERUSER_PASSWORD 'empty'

    • ALLOWED_HOST*: ALLOWED_HOST 'empty'

    • DB_NAME*: DB_NAME netbox

    • DB_USER*: DB_USER 'empty'

    • DB_PASSWORD* DB_PASSWORD 'empty'

    • DB_HOST*: DB_HOST postgres

    • DB_PORT*: DB_PORT 5432

    • REDIS_HOST*: REDIS_HOST redis

    • REDIS_PORT*: REDIS_PORT 6379

    • REDIS_PASSWORD: REDIS_PASSWORD 'empty'

    • REDIS_DB_TASK*: REDIS_DB_TASK 0

    • REDIS_DB_CACHE*: REDIS_DB_CACHE 1

    • BASE_PATH: BASE_PATH 'empty'

    • REMOTE_AUTH_ENABLED: REMOTE_AUTH_ENABLED False

    • REMOTE_AUTH_BACKEND: REMOTE_AUTH_BACKEND netbox.authentication.RemoteUserBackend

    • REMOTE_AUTH_HEADER: REMOTE_AUTH_HEADER HTTP_REMOTE_USER

    • REMOTE_AUTH_AUTO_CREATE_USER: REMOTE_AUTH_AUTO_CREATE_USER False

    • REMOTE_AUTH_DEFAULT_GROUPS: REMOTE_AUTH_DEFAULT_GROUPS []

    • REMOTE_AUTH_DEFAULT_PERMISSIONS: REMOTE_AUTH_DEFAULT_PERMISSIONS {}

  • Currently, REDIS_PASSWORD ENV var is 'required' in the template. It should not, since it is optionnal.

 

As a general concern, changes in the UI does not reflect on the configuration file, since it is only written the first time the container start. Isn't there a way to pass Environnement variable to the config after it has been created ?

Edited by potjoe
typo
Link to comment
  • 10 months later...

It doesn't seem like this docker has gotten much love. I attempted to get this working last year and couldn't but was able to get through it this time around. One of the most common error was 400 bad gateway. Since I was using NGINXProxyManager, i knew it was the problem since I could access it via IP after adding my UnRaid's box's ip was placed in the CORS whitelist and for INTERNAL_IPS variable.

 

For those that are running into 400 bad gateway errors and using NGINXReverseProxy- you must also designate in the /config/configuration.py, ~ Line 157/299, regarding HTTP_PROXIES so that it reflects your NGINX reverse proxies' IP & Ports, e.g.:

# HTTP proxies NetBox should use when sending outbound HTTP requests (e.g. for webhooks).
HTTP_PROXIES = {
#     'http': 'http://10.10.1.10:3128',
#     'https': 'http://10.10.1.10:1080',
   'http': 'x.x.x.x:8080',
   'https': 'x.x.x.x:8443',       
} 

 

You'll also want to put in your UnRaid box's internal IP under the

 

INTERNAL_IPS = ('127.0.0.1', '::1', 'x.x.x.x')

 

Link to comment
  • 6 months later...

After some attempts got mine working, here are the steps I did to make it work:

 

  1. Install Redis from jj9987 maintainer.
  2. Install PostgreSQL15 from jj9987 maintainer
  3. Install netbox from linuxserver maintainer, carefully fill out the redis and postgresql required information
  4. If you see on netbox logs error below, stop netbox container.

 

ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?

 

    5. Edit the /appdata/logs/netbox/configuration.py and add a sharp to  #'PASSWORD': 'none' on redis configs.

    6. Remove the REDIS PASSWORD variable from the netbox container

 

Obs: If any configuration is needed on netbox container, stop the container, edit on the configuration.py first and then edit the config on container.

 

As mentioned here, the container configuration is not being updated correctly to configuratin.py.

 

Edited by dgaglioni
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.