[docker] Netbox exists after a couple of requests #7041

Closed
opened 2025-12-29 19:48:13 +01:00 by adam · 2 comments
Owner

Originally created by @telmich on GitHub (Sep 28, 2022).

NetBox version

v3.2.5

Python version

3.10

Steps to Reproduce

  1. Run netbox in docker/k8s
  2. Create an ingress
  3. Request a couple of objects

At some point the ingress will return a 404, because netbox is gone. Netbox logs look like this:

2a0a:e5c0:10:2:6c4c:27bd:c596:4da4 - - [28/Sep/2022:14:11:55 +0000] "GET /ipam/prefixes/39/prefixes/ HTTP/1.1" 200 108611 "https://netbox.xxx/ipam/prefixes/39/" "Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0"
🧬 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'
2022/09/28 14:13:54 [notice] 20#20 app process (isolated 222) exited with code 0

This restart happens sometimes after 8 requests, sometimes after 20ish requests, but rather frequent. As exit code 0 is a success code, I wonder what the motivation for netbox is to exit.

There is no memory or cpu pressure on the node nor any limitations applied.

Netbox is defined like this:

        - name: netbox
          image: netboxcommunity/netbox:{{ .Chart.AppVersion }}
          ports:
            - containerPort: 8080
          envFrom:
          - secretRef:
              name: {{ .Release.Name }}-netbox-secret
          env:
            - name: DB_HOST
              value: "{{ .Release.Name }}-postgres"
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: {{ .Release.Name }}-postgres-config
                  key: POSTGRES_PASSWORD
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: {{ .Release.Name }}-postgres-config
                  key: POSTGRES_USER
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: {{ .Release.Name }}-postgres-config
                  key: POSTGRES_DB

Expected Behavior

Netbox does not exit on its own.

Observed Behavior

Netbox exits after a few requests, causing nginx-ingress to return a 404 on failure.
Note though, that the container keeps running, it's merely the python/django process exiting.

Originally created by @telmich on GitHub (Sep 28, 2022). ### NetBox version v3.2.5 ### Python version 3.10 ### Steps to Reproduce 1. Run netbox in docker/k8s 2. Create an ingress 3. Request a couple of objects At some point the ingress will return a 404, because netbox is gone. Netbox logs look like this: ``` 2a0a:e5c0:10:2:6c4c:27bd:c596:4da4 - - [28/Sep/2022:14:11:55 +0000] "GET /ipam/prefixes/39/prefixes/ HTTP/1.1" 200 108611 "https://netbox.xxx/ipam/prefixes/39/" "Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0" 🧬 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' 2022/09/28 14:13:54 [notice] 20#20 app process (isolated 222) exited with code 0 ``` This restart happens sometimes after 8 requests, sometimes after 20ish requests, but rather frequent. As exit code 0 is a success code, I wonder what the motivation for netbox is to exit. There is no memory or cpu pressure on the node nor any limitations applied. Netbox is defined like this: ``` - name: netbox image: netboxcommunity/netbox:{{ .Chart.AppVersion }} ports: - containerPort: 8080 envFrom: - secretRef: name: {{ .Release.Name }}-netbox-secret env: - name: DB_HOST value: "{{ .Release.Name }}-postgres" - name: DB_PASSWORD valueFrom: secretKeyRef: name: {{ .Release.Name }}-postgres-config key: POSTGRES_PASSWORD - name: DB_USER valueFrom: secretKeyRef: name: {{ .Release.Name }}-postgres-config key: POSTGRES_USER - name: DB_NAME valueFrom: secretKeyRef: name: {{ .Release.Name }}-postgres-config key: POSTGRES_DB ``` ### Expected Behavior Netbox does not exit on its own. ### Observed Behavior Netbox exits after a few requests, causing nginx-ingress to return a 404 on failure. Note though, that the container keeps running, it's merely the python/django process exiting.
adam closed this issue 2025-12-29 19:48:13 +01:00
Author
Owner

@telmich commented on GitHub (Sep 28, 2022):

Just checked, this happens also with the image v3.3.2-2.2.0

@telmich commented on GitHub (Sep 28, 2022): Just checked, this happens also with the image v3.3.2-2.2.0
Author
Owner

@kkthxbye-code commented on GitHub (Sep 28, 2022):

This is not the repo for netbox-docker, please see: https://github.com/netbox-community/netbox-docker

Also, there is no error shown in your log, the notice is expected as nginx-unit kills idle processes.

@kkthxbye-code commented on GitHub (Sep 28, 2022): This is not the repo for netbox-docker, please see: https://github.com/netbox-community/netbox-docker Also, there is no error shown in your log, the notice is expected as nginx-unit kills idle processes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7041