Problem Bad Request (400) #4570

Closed
opened 2025-12-29 18:37:46 +01:00 by adam · 2 comments
Owner

Originally created by @dexter74 on GitHub (Feb 17, 2021).

Environment

  • Python version: Default
  • NetBox version: Default

Steps to Reproduce

  1. Docker + Portainer
  2. Create 2 Stack
  3. Check URL

Expected Behavior

URL Work without Error.

Observed Behavior

I take error "Problem Bad Request (400)

image

pcre jit disabled,
detected number of CPU cores: 4,
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...1293 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.8.5 (default, Jul 20 2020, 23:11:29)  [GCC 9.3.0],
Python main interpreter initialized at 0x55b0c4637100,
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)...,
,
961 static files copied to '/app/netbox/netbox/static'.,
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...,
Traceback (most recent call last):,
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection,
    self.connect(),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect,
    self.connection = self.get_new_connection(conn_params),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection,
    connection = Database.connect(**conn_params),
  File "/usr/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect,
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync),
psycopg2.OperationalError: received invalid response to SSL negotiation: t,
,
,
The above exception was the direct cause of the following exception:,
,
Traceback (most recent call last):,
  File "./manage.py", line 10, in <module>,
    execute_from_command_line(sys.argv),
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line,
    utility.execute(),
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute,
    self.fetch_command(subcommand).run_from_argv(self.argv),
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv,
    self.execute(*args, **cmd_options),
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute,
    output = self.handle(*args, **options),
  File "/usr/lib/python3.8/site-packages/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py", line 39, in handle,
    apps_content_types = itertools.groupby(,
  File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 287, in __iter__,
    self._fetch_all(),
  File "/usr/lib/python3.8/site-packages/cacheops/query.py", line 273, in _fetch_all,
    return self._no_monkey._fetch_all(self),
  File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 1308, in _fetch_all,
    self._result_cache = list(self._iterable_class(self)),
  File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 53, in __iter__,
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size),
  File "/usr/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql,
    cursor = self.connection.cursor(),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 259, in cursor,
    return self._cursor(),
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 235, in _cursor,
    self.ensure_connection(),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection,
    self.connect(),
  File "/usr/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__,
    raise dj_exc_value.with_traceback(traceback) from exc_value,
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection,
    self.connect(),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect,
    self.connection = self.get_new_connection(conn_params),
  File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner,
    return func(*args, **kwargs),
  File "/usr/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection,
    connection = Database.connect(**conn_params),
  File "/usr/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect,
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync),
django.db.utils.OperationalError: received invalid response to SSL negotiation: t,
,
command "/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" exited with non-zero code: 1,
Fri Feb  5 06:59:09 2021 - FATAL hook failed, destroying instance,
SIGINT/SIGQUIT received...killing workers...,
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x55b0c4637100 pid: 266 (default app),
*** uWSGI is running in multiple interpreter mode ***,
spawned uWSGI master process (pid: 266),
spawned uWSGI worker 1 (pid: 288, cores: 1),
[uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 1001 gid: 74240),
Error 111 connecting to NetBox:6379. Connection refused.,
daemon "/usr/bin/python3 ./manage.py rqworker" (pid: 289) annihilated,
[pid: 288|app: 0|req: 1/1] 192.168.1.10 () {36 vars in 1106 bytes} [Fri Feb  5 06:02:21 2021] GET / => generated 143 bytes in 501 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0),
[pid: 288|app: 0|req: 2/2] 192.168.1.10 () {34 vars in 1022 bytes} [Fri Feb  5 06:02:22 2021] GET /favicon.ico => generated 143 bytes in 15 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0),

Stack MariaDB (Container name : CN_MariaDB)

version: 2.4
services:
  MariaDB:
    image: 'linuxserver/mariadb'
    container_name: 'CN_MariaDB'
    network_mode: 'bridge'
    restart: 'unless-stopped'
    environment:
      PUID: '1001'
      PGID: '74240'
      TZ: 'Europe/Paris'
      MYSQL_ROOT_PASSWORD: 'root'
      MYSQL_DATABASE: 'database'
      MYSQL_USER: 'admin'
      MYSQL_PASSWORD: 'admin'
    volumes:
      - 'MariaDB:/config'

Stack NetBox (Container name : CN_NetBox)

version: '2.4'
services:
  NetBox:
    image: 'linuxserver/netbox'
    container_name: 'CN_NetBox'
    network_mode: 'bridge'
    restart: 'no'
    hostname: 'NetBox'
    environment:
      PUID: '1001' # USER ID DOCKER IS 1001
      PGID: '74240' # USERGROUP DOCKER IS 74240
      TZ: 'Europe/Paris'
      SUPERUSER_EMAIL: 'teste@email.com'
      SUPERUSER_PASSWORD: 'admin'
      ALLOWED_HOST: '0.0.0.0/0'
      BASE_PATH: 'none'
      DB_HOST: 'mysql'
      DB_PORT: '3306'
      DB_NAME: 'database'
      DB_USER: 'admin'
      DB_PASSWORD: 'admin'
      REDIS_HOST: 'NetBox'
      REDIS_PORT: '6379'
      REDIS_PASSWORD: 'admin'

    external_links:
      - 'CN_MariaDB:mysql'
     
    ports:
      - '1000:8000'
      - '1002:6379'
    volumes:
      - 'NetBox:/config'
    labels:
       cacher: 'non'
Originally created by @dexter74 on GitHub (Feb 17, 2021). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reporting reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, please start a discussion instead: https://github.com/netbox-community/netbox/discussions Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: Default * NetBox version: Default <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. Docker + Portainer 2. Create 2 Stack 3. Check URL <!-- What did you expect to happen? --> ### Expected Behavior URL Work without Error. <!-- What happened instead? --> ### Observed Behavior I take error "Problem Bad Request (400) ![image](https://user-images.githubusercontent.com/35907/106995882-2807b280-6780-11eb-965f-4bf735c2b651.png) ```` pcre jit disabled, detected number of CPU cores: 4, 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...1293 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.8.5 (default, Jul 20 2020, 23:11:29) [GCC 9.3.0], Python main interpreter initialized at 0x55b0c4637100, 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)..., , 961 static files copied to '/app/netbox/netbox/static'., running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)..., Traceback (most recent call last):, File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection, self.connect(), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect, self.connection = self.get_new_connection(conn_params), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection, connection = Database.connect(**conn_params), File "/usr/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect, conn = _connect(dsn, connection_factory=connection_factory, **kwasync), psycopg2.OperationalError: received invalid response to SSL negotiation: t, , , The above exception was the direct cause of the following exception:, , Traceback (most recent call last):, File "./manage.py", line 10, in <module>, execute_from_command_line(sys.argv), File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line, utility.execute(), File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute, self.fetch_command(subcommand).run_from_argv(self.argv), File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv, self.execute(*args, **cmd_options), File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute, output = self.handle(*args, **options), File "/usr/lib/python3.8/site-packages/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py", line 39, in handle, apps_content_types = itertools.groupby(, File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 287, in __iter__, self._fetch_all(), File "/usr/lib/python3.8/site-packages/cacheops/query.py", line 273, in _fetch_all, return self._no_monkey._fetch_all(self), File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 1308, in _fetch_all, self._result_cache = list(self._iterable_class(self)), File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 53, in __iter__, results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size), File "/usr/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql, cursor = self.connection.cursor(), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 259, in cursor, return self._cursor(), File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 235, in _cursor, self.ensure_connection(), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection, self.connect(), File "/usr/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__, raise dj_exc_value.with_traceback(traceback) from exc_value, File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection, self.connect(), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect, self.connection = self.get_new_connection(conn_params), File "/usr/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner, return func(*args, **kwargs), File "/usr/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection, connection = Database.connect(**conn_params), File "/usr/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect, conn = _connect(dsn, connection_factory=connection_factory, **kwasync), django.db.utils.OperationalError: received invalid response to SSL negotiation: t, , command "/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" exited with non-zero code: 1, Fri Feb 5 06:59:09 2021 - FATAL hook failed, destroying instance, SIGINT/SIGQUIT received...killing workers..., WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x55b0c4637100 pid: 266 (default app), *** uWSGI is running in multiple interpreter mode ***, spawned uWSGI master process (pid: 266), spawned uWSGI worker 1 (pid: 288, cores: 1), [uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 1001 gid: 74240), Error 111 connecting to NetBox:6379. Connection refused., daemon "/usr/bin/python3 ./manage.py rqworker" (pid: 289) annihilated, [pid: 288|app: 0|req: 1/1] 192.168.1.10 () {36 vars in 1106 bytes} [Fri Feb 5 06:02:21 2021] GET / => generated 143 bytes in 501 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0), [pid: 288|app: 0|req: 2/2] 192.168.1.10 () {34 vars in 1022 bytes} [Fri Feb 5 06:02:22 2021] GET /favicon.ico => generated 143 bytes in 15 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0), ```` **Stack MariaDB** (Container name : CN_MariaDB) ````yaml version: 2.4 services: MariaDB: image: 'linuxserver/mariadb' container_name: 'CN_MariaDB' network_mode: 'bridge' restart: 'unless-stopped' environment: PUID: '1001' PGID: '74240' TZ: 'Europe/Paris' MYSQL_ROOT_PASSWORD: 'root' MYSQL_DATABASE: 'database' MYSQL_USER: 'admin' MYSQL_PASSWORD: 'admin' volumes: - 'MariaDB:/config' ```` **Stack NetBox** (Container name : CN_NetBox) ````yaml version: '2.4' services: NetBox: image: 'linuxserver/netbox' container_name: 'CN_NetBox' network_mode: 'bridge' restart: 'no' hostname: 'NetBox' environment: PUID: '1001' # USER ID DOCKER IS 1001 PGID: '74240' # USERGROUP DOCKER IS 74240 TZ: 'Europe/Paris' SUPERUSER_EMAIL: 'teste@email.com' SUPERUSER_PASSWORD: 'admin' ALLOWED_HOST: '0.0.0.0/0' BASE_PATH: 'none' DB_HOST: 'mysql' DB_PORT: '3306' DB_NAME: 'database' DB_USER: 'admin' DB_PASSWORD: 'admin' REDIS_HOST: 'NetBox' REDIS_PORT: '6379' REDIS_PASSWORD: 'admin' external_links: - 'CN_MariaDB:mysql' ports: - '1000:8000' - '1002:6379' volumes: - 'NetBox:/config' labels: cacher: 'non' ````
adam closed this issue 2025-12-29 18:37:46 +01:00
Author
Owner

@sdktr commented on GitHub (Feb 17, 2021):

Hi, this specific hosting option is not supported by the netboxcommunity. It's more of a DIY implementation of 'a' dockerized version.

Also, netbox doesn't use mysql. If you want a 'known good' starting config you should checkout the netbox-docker repo.

@sdktr commented on GitHub (Feb 17, 2021): Hi, this specific hosting option is not supported by the netboxcommunity. It's more of a DIY implementation of 'a' dockerized version. Also, netbox doesn't use mysql. If you want a 'known good' starting config you should checkout the netbox-docker repo.
Author
Owner

@DanSheps commented on GitHub (Feb 18, 2021):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to the discussions instead.

@DanSheps commented on GitHub (Feb 18, 2021): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/netbox-community/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to the [discussions](https://github.com/netbox-community/netbox/discussions) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4570