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

Debug Toolbar not displaying #1383

Closed
jscooksey opened this issue Jan 27, 2025 · 9 comments
Closed

Debug Toolbar not displaying #1383

jscooksey opened this issue Jan 27, 2025 · 9 comments

Comments

@jscooksey
Copy link

Current Behavior

Shows in debug but does not show toolbar
Seeing this in logs
GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404

and the files do not exist in the container.
Have run build

Expected Behavior

To see the toolbar

Docker Compose Version

Docker Compose version v2.31.0-desktop.2

Docker Version

Client:
 Version:           27.4.0
 API version:       1.47
 Go version:        go1.22.10
 Git commit:        bde2b89
 Built:             Sat Dec  7 10:40:21 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.37.1 (178610)
 Engine:
  Version:          27.4.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.10
  Git commit:       92a8393
  Built:            Sat Dec  7 10:38:57 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.21
  GitCommit:        472731909fa34bd7bc9c087e4c27943f9835f111
 runc:
  Version:          1.1.13
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

7ce715eabcf9ed24f550bdb1f29b988e3ea2896f

The git Status

On branch minder
Your branch is ahead of 'origin/minder' by 3 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   env/netbox.env
        deleted:    netbox_export_at_378.sql
        modified:   plugin_requirements.txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        netbox_sql_2025-01-16.sql

no changes added to commit (use "git add" and/or "git commit -a")

Startup Command

docker compose up -d

NetBox Logs

2025-01-27 19:15:30 ↩️ Skip creating the superuser
2025-01-27 19:15:33 🧬 loaded config '/etc/netbox/config/configuration.py'
2025-01-27 19:15:33 🧬 loaded config '/etc/netbox/config/extra.py'
2025-01-27 19:15:33 🧬 loaded config '/etc/netbox/config/logging.py'
2025-01-27 19:15:33 🧬 loaded config '/etc/netbox/config/plugins.py'
2025-01-27 19:15:33 ✅ Initialisation is done.
2025-01-27 19:15:33 ⏳ Waiting for control socket to be created... (1/10)
2025-01-27 19:15:33 2025/01/27 08:15:33 [info] 107#107 discovery started
2025-01-27 19:15:33 2025/01/27 08:15:33 [notice] 107#107 module: python 3.12.3 "/usr/lib/unit/modules/python3.12.unit.so"
2025-01-27 19:15:33 2025/01/27 08:15:33 [info] 7#7 controller started
2025-01-27 19:15:33 2025/01/27 08:15:33 [notice] 7#7 process 107 exited with code 0
2025-01-27 19:15:33 2025/01/27 08:15:33 [info] 109#109 router started
2025-01-27 19:15:33 2025/01/27 08:15:33 [info] 109#109 OpenSSL 3.0.13 30 Jan 2024, 300000d0
2025-01-27 19:15:34 ⚙️ Applying configuration from /etc/unit/nginx-unit.json
2025-01-27 19:15:34 2025/01/27 08:15:34 [info] 112#112 "netbox" prototype started
2025-01-27 19:15:34 2025/01/27 08:15:34 [info] 113#113 "netbox" application started
2025-01-27 19:15:36 2025/01/27 08:15:36 [info] 151#151 "netbox" application started
2025-01-27 19:15:36 ✅ Unit configuration loaded successfully
2025-01-27 19:15:36 2025/01/27 08:15:36 [notice] 7#7 process 105 exited with code 0
2025-01-27 19:15:43 2025/01/27 08:15:43 [info] 181#181 "netbox" application started
2025-01-27 19:15:45 127.0.0.1 - - [27/Jan/2025:08:15:45 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:15:51 127.0.0.1 - - [27/Jan/2025:08:15:51 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:15:51 127.0.0.1 - - [27/Jan/2025:08:15:51 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:16:07 127.0.0.1 - - [27/Jan/2025:08:16:07 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:16:22 127.0.0.1 - - [27/Jan/2025:08:16:22 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:16:31 172.172.0.1 - - [27/Jan/2025:08:16:31 +0000] "GET / HTTP/1.1" 200 151458 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/setmode.js?v=4.2.2 HTTP/1.1" 200 1314 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/netbox-external.css?v=4.2.2 HTTP/1.1" 200 367126 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/netbox.css?v=4.2.2 HTTP/1.1" 200 554811 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/netbox.js?v=4.2.2 HTTP/1.1" 200 391058 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/debug_toolbar/js/toolbar.js HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/django-htmx.js HTTP/1.1" 200 741 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/logo_netbox_bright_teal.svg HTTP/1.1" 200 5156 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 172.172.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /static/logo_netbox_dark_teal.svg HTTP/1.1" 200 5159 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:38 127.0.0.1 - - [27/Jan/2025:08:16:38 +0000] "GET /login/ HTTP/1.1" 200 16956 "-" "curl/8.5.0"
2025-01-27 19:16:42 172.172.0.1 - - [27/Jan/2025:08:16:42 +0000] "GET /static/netbox_touch-icon-180.png HTTP/1.1" 200 6832 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:15:33 2025/01/27 08:15:33 [warn] 7#7 Unit is running unprivileged, then it cannot use arbitrary user and group.
2025-01-27 19:15:33 2025/01/27 08:15:33 [info] 7#7 unit 1.34.1 started
2025-01-27 19:16:42 172.172.0.1 - - [27/Jan/2025:08:16:42 +0000] "GET /static/netbox.ico HTTP/1.1" 200 1481 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:43 172.172.0.1 - - [27/Jan/2025:08:16:43 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:43 172.172.0.1 - - [27/Jan/2025:08:16:43 +0000] "GET /static/debug_toolbar/css/print.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/Inter-Regular-373XMOLM.woff2?v=3.18 HTTP/1.1" 200 98844 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/materialdesignicons-webfont-7OXPFKOV.woff2?v=7.4.47 HTTP/1.1" 200 403216 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/Inter-Italic-RW2ZALTO.woff2?v=3.18 HTTP/1.1" 200 106852 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/Inter-MediumItalic-P7H6BBYU.woff2?v=3.18 HTTP/1.1" 200 112168 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/Inter-Medium-JV63DMR7.woff2?v=3.18 HTTP/1.1" 200 105616 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:45 172.172.0.1 - - [27/Jan/2025:08:16:45 +0000] "GET /static/Inter-SemiBold-UMRILHOG.woff2?v=3.18 HTTP/1.1" 200 105980 "http://localhost:8000/static/netbox-external.css?v=4.2.2" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:47 172.172.0.1 - - [27/Jan/2025:08:16:47 +0000] "GET /core/changelog/?per_page=25&embedded=True HTTP/1.1" 200 21532 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:50 172.172.0.1 - - [27/Jan/2025:08:16:50 +0000] "GET / HTTP/1.1" 200 151458 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:50 172.172.0.1 - - [27/Jan/2025:08:16:50 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:50 172.172.0.1 - - [27/Jan/2025:08:16:50 +0000] "GET /static/debug_toolbar/js/toolbar.js HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:50 172.172.0.1 - - [27/Jan/2025:08:16:50 +0000] "GET /static/debug_toolbar/css/print.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:50 172.172.0.1 - - [27/Jan/2025:08:16:50 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:51 172.172.0.1 - - [27/Jan/2025:08:16:51 +0000] "GET /core/changelog/?per_page=25&embedded=True HTTP/1.1" 200 21532 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-27 19:16:53 127.0.0.1 - - [27/Jan/2025:08:16:53 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:17:09 127.0.0.1 - - [27/Jan/2025:08:17:09 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:17:24 127.0.0.1 - - [27/Jan/2025:08:17:24 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:17:40 127.0.0.1 - - [27/Jan/2025:08:17:40 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:17:55 127.0.0.1 - - [27/Jan/2025:08:17:55 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:18:11 127.0.0.1 - - [27/Jan/2025:08:18:11 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:18:30 127.0.0.1 - - [27/Jan/2025:08:18:30 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:18:45 127.0.0.1 - - [27/Jan/2025:08:18:45 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:18:47 🧬 loaded config '/etc/netbox/config/configuration.py'
2025-01-27 19:18:47 🧬 loaded config '/etc/netbox/config/extra.py'
2025-01-27 19:18:47 🧬 loaded config '/etc/netbox/config/logging.py'
2025-01-27 19:18:47 🧬 loaded config '/etc/netbox/config/plugins.py'
2025-01-27 19:18:49 2025/01/27 08:18:49 [notice] 112#112 app process 151 exited with code 0
2025-01-27 19:19:00 127.0.0.1 - - [27/Jan/2025:08:19:00 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:19:16 127.0.0.1 - - [27/Jan/2025:08:19:16 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:19:31 127.0.0.1 - - [27/Jan/2025:08:19:31 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:19:46 127.0.0.1 - - [27/Jan/2025:08:19:46 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"
2025-01-27 19:20:02 127.0.0.1 - - [27/Jan/2025:08:20:02 +0000] "GET /login/ HTTP/1.1" 200 16955 "-" "curl/8.5.0"

Content of docker-compose.override.yml

services:
  netbox:
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    ports:
      - "8000:8080"
    networks:
      - dockernet
  netbox-worker:
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    networks:
      - dockernet
  netbox-housekeeping:
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    networks:
      - dockernet
  postgres:
    ports:
      - "5433:5432"
    networks:
      - dockernet
  redis:
    networks:
      - dockernet
  redis-cache:
    networks:
      - dockernet

networks:
  dockernet:
    external: true
@jscooksey
Copy link
Author

Image

Debug is enabled and IPs are in the list

@jscooksey
Copy link
Author

I have created a brand new environment.

  1. Cloned the current netbox-docker repository from GitHub
  2. Created docker-compose.override.yml, to open up the port to browse to
services:
  netbox:
    ports:
       - "8000:8080"
  1. Edited netbox.env to add only debug information. 172.20.0.1 being on the subnet docker is using by default.
DEBUG=True
INTERNAL_IPS='127.0.0.1 172.20.0.1'
  1. docker compose up -d
    and let it start up properly and made a superuser

On the interface I get the bar saying its in Debug mode (as in image above)
and I get 404 /static/debug_toolbar in the logs, as in the above log

@jscooksey
Copy link
Author

Do I need to add in the plugins for the toolbar, its not part of the repository code as is?
I'm sure I have seen it before with prior versions (v3.xx)

2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET / HTTP/1.1" 200 152298 "http://localhost:8000/login/?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET /static/debug_toolbar/js/toolbar.js HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET /static/debug_toolbar/css/toolbar.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET /static/debug_toolbar/css/print.css HTTP/1.1" 404 54 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"
2025-01-28 09:11:11 172.20.0.1 - - [27/Jan/2025:22:11:11 +0000] "GET /static/netbox_touch-icon-180.png HTTP/1.1" 200 6832 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0"

@jscooksey
Copy link
Author

Also, I am doing this on a Windows machine....... that may be a factor, but its what Im required to work with. It shouldn't matter, but maybe it does
I will test on Linux when I get a moment

@tobiasge
Copy link
Member

When you run collectstatic the files for debug_toolbar are only added to the target directory, when you have DEBUG set to True. That's why the files are not where they are expected.
I just tried to run collectstatic with DEBUG enabled, but then the command crashes because no Redis server is available. I think that needs some investigation on the Netbox side,

@jscooksey
Copy link
Author

jscooksey commented Jan 28, 2025

Note that in my test netbox-docker I have a clean install, no plugins just an out of the box, that I'm testing getting the debug_toolbar going. Although the original one does have a plugin and Dockerfile etc etc
I do have the DEBUG=True and the INTERNAL_IPS= variables set in both.

If I run collect static in the (basically brand new release 3.1.0) netbox container:

docker exec -it test-netbox-netbox-1 bash
unit@becb4bcceeaa:/opt/netbox/netbox$ python3 /opt/netbox/netbox/manage.py collectstatic --no-input

Im getting:

PermissionError: [Errno 13] Permission denied: '/opt/netbox/netbox/static/debug_toolbar'

or more thoroughly:

🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
    collected = self.collect()
                ^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
    handler(path, prefixed_path, storage)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
    self.storage.save(prefixed_path, source_file)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save
    name = self._save(name, content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 100, in _save
    os.makedirs(directory, exist_ok=True)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/opt/netbox/netbox/static/debug_toolbar'

@tobiasge
Copy link
Member

I did some more debugging and found this:
netbox-community/netbox#18515
netbox-community/netbox#18516

@tobiasge tobiasge reopened this Jan 28, 2025
tobiasge added a commit to tobiasge/netbox-docker that referenced this issue Jan 29, 2025
- Fix netbox-community#1383: Setting DEBUG = true when collection the static files
  enables the use of the Django debug toolbar.
- Fix netbox-community#1385: Use uv as package manager instead of pip speeds up the build.
@tobiasge tobiasge mentioned this issue Jan 29, 2025
3 tasks
@jscooksey
Copy link
Author

@tobiasge likely something I'm doing, but I have

  1. Added those changes from Improved image build #1386 for Dockerfile & requirements-container.txt
  2. Ran the build again

And I'm still seeing the 404 message for debug_toolbar static files

tobiasge added a commit to tobiasge/netbox-docker that referenced this issue Feb 3, 2025
- Fix netbox-community#1383: Setting DEBUG = true when collection the static files
  enables the use of the Django debug toolbar.
- Fix netbox-community#1385: Use uv as package manager instead of pip speeds up the build.
tobiasge added a commit to tobiasge/netbox-docker that referenced this issue Feb 3, 2025
- Fix netbox-community#1383: Setting DEBUG = true when collection the static files
  enables the use of the Django debug toolbar.
- Fix netbox-community#1385: Use uv as package manager instead of pip speeds up the build.
- Nice display of Docker image version
tobiasge added a commit to tobiasge/netbox-docker that referenced this issue Feb 4, 2025
- Fix netbox-community#1383: Setting DEBUG = true when collection the static files
  enables the use of the Django debug toolbar.
- Fix netbox-community#1385: Use uv as package manager instead of pip speeds up the build.
- Nice display of Docker image version
@tobiasge
Copy link
Member

tobiasge commented Feb 5, 2025

Fixed in #1386

@tobiasge tobiasge closed this as completed Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants