Skip to content

[BUG] Bad Request 400 #70

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

Closed
1 task done
begunfx opened this issue May 24, 2025 · 5 comments
Closed
1 task done

[BUG] Bad Request 400 #70

begunfx opened this issue May 24, 2025 · 5 comments

Comments

@begunfx
Copy link

begunfx commented May 24, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've tried everything I can think of but no matter what I cannot access the UI.

Expected Behavior

No response

Steps To Reproduce

Build this file, then try to access the UI via: servername:8000

Environment

- OS:
- How docker service was installed:
using Portainer on a Synology server running the latest DSM.

CPU architecture

x86-64

Docker creation

services:
  netbox:
    image: linuxserver/netbox:latest
    restart: always
    ports:
      - "8000:8000"
    volumes:
      - /volume1/docker/netbox/netbox_media:/opt/netbox/netbox/media
    environment:
      - PUID=1034
      - PGID=100
      - TZ=America/Los_Angeles
      - DB_HOST=netbox-db
      - DB_NAME=${DATABASE_NAME}
      - DB_USER=${DATABASE_USER}
      - DB_PASSWORD=${DATABASE_PASSWORD}
      - SUPERUSER_EMAIL=
      - SUPERUSER_PASSWORD=
      - ALLOWED_HOSTS=*
      - REDIS_HOST=redis
      - REDIS_PORT=6379
    depends_on:
      - netbox-db
      - redis
    networks:
      - netbox-net

  netbox-db:
    image: postgres:latest
    restart: always
    volumes:
      - /volume1/docker/netbox/netbox_db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=${DATABASE_USER}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD}
      - POSTGRES_DB=${DATABASE_NAME}
    networks:
      - netbox-net

  redis:
    image: redis:latest
    restart: always
    networks:
      - netbox-net

networks:
  netbox-net:

Container logs

migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1034
User GID:    100
───────────────────────────────────────
Linuxserver.io version: v4.3.1-ls278
Build-date: 2025-05-22T15:51:19+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
Operations to perform:
  Apply all migrations: account, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, vpn, wireless
Running migrations:
  No migrations to apply.
Building local documentation
[uWSGI] getting INI configuration from uwsgi.ini
[uwsgi-static] added mapping for /static => static
*** Starting uWSGI 2.0.25.1 (64bit) on [Sat May 24 13:43:53 2025] ***
compiled with version: 13.2.1 20240309 on 17 May 2024 06:11:37
os: Linux-4.4.302+ #72806 SMP Thu Sep 5 13:45:50 CST 2024
nodename: d8b9d92319e7
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /app/netbox/netbox
detected binary path: /usr/sbin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
building mime-types dictionary from file /etc/mime.types...1390 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :8000 fd 3
Python version: 3.12.10 (main, May 21 2025, 16:26:34) [GCC 13.2.1 20240309]
PEP 405 virtualenv detected: /lsiopy
Set PythonHome to /lsiopy
Python main interpreter initialized at 0x7f45f77f3c70
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 203184 bytes (198 KB) for 1 cores
*** Operational MODE: single process ***
running "exec:python3 ./manage.py collectstatic --noinput" (pre app)...
Connection to localhost (127.0.0.1) 8000 port [tcp/*] succeeded!
[ls.io-init] done.
502 static files copied to '/app/netbox/netbox/static'.
running "exec:python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
running "exec:python3 ./manage.py clearsessions" (pre app)...
WSGI app 0 (mountpoint='') ready in 3 seconds on interpreter 0x7f45f77f3c70 pid: 194 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 194)
spawned uWSGI worker 1 (pid: 222, cores: 1)
[uwsgi-daemons] spawning "python3 ./manage.py rqworker" (uid: 1034 gid: 100)
No queues have been specified. This process will service the following queues by default: high, default, low
20:44:40 Worker rq:worker:b48ba64174cd43fdaa179bb5115b6dd3 started with PID 223, version 2.3.3
20:44:40 Subscribing to channel rq:pubsub:b48ba64174cd43fdaa179bb5115b6dd3
20:44:40 *** Listening on high, default, low...
20:44:40 Cleaning registries for queue: high
20:44:40 Cleaning registries for queue: default
20:44:41 Cleaning registries for queue: low
20:44:41 Scheduler for high, default, low started with PID 225
[pid: 222|app: 0|req: 1/1] 192.168.1.17 () {40 vars in 766 bytes} [Sat May 24 20:45:13 2025] GET / => generated 143 bytes in 7795 msecs (HTTP/1.1 400) 3 headers in 121 bytes (1 switches on core 0)
[pid: 222|app: 0|req: 2/2] 192.168.1.17 () {36 vars in 704 bytes} [Sat May 24 20:45:21 2025] GET / => generated 143 bytes in 1 msecs (HTTP/1.1 400) 3 headers in 121 bytes (1 switches on core 0)
[pid: 222|app: 0|req: 3/3] 192.168.1.17 () {36 vars in 658 bytes} [Sat May 24 20:45:22 2025] GET /favicon.ico => generated 143 bytes in 1 msecs (HTTP/1.1 400) 3 headers in 121 bytes (1 switches on core 0)
Copy link

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

@itsCARLsanity
Copy link

Also experiencing the same. Not sure what's needed?

@begunfx
Copy link
Author

begunfx commented May 25, 2025

So I got it working. What worked for me is if you want multiple hosts you have to manually change the /config/configuration.py file. Specifically "ALLOWED_HOSTS=" you can add multiple hosts comma separated. If you only want one host then you can add that host to the compose file under "ALLOWED_HOST=" note the difference between HOST and HOSTS. Hope this helps!

@begunfx begunfx closed this as completed May 25, 2025
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker May 25, 2025
@itsCARLsanity
Copy link

@begunfx actually just solved this myself just now. Referencing from this issue. Problem is, when I changed ALLOWED_HOST in the docker-compose.yml, it does not automatically update the configuration.py file in /config. So what I did was to remove the docker volume and respawned the containers. Now, the configuration.py file contains whatever I specify on the ALLOWED_HOST. I specified a value of * which allows everything, its not ideal but the container is reverse-proxied anyways.

@begunfx
Copy link
Author

begunfx commented May 25, 2025

Cool glad you got it resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants