Open telmich opened 2 years ago
Original issue for completeness: https://github.com/netbox-community/netbox/issues/10499
I found a workaround for this problem by specifying a static number of processes in nginx-units.json https://github.com/netbox-community/netbox-docker/blob/release/docker/nginx-unit.json#L34
"applications": {
"netbox": {
"type": "python 3",
"path": "/opt/netbox/netbox/",
"module": "netbox.wsgi",
"home": "/opt/netbox/venv",
"processes": 4
}
}
I am observing the same behavior, although i have already implemented the workaround suggested by @Kartograf .
There are five working requests (with "processes": 4
in nginx-unit.json) in total to netbox / wsgi application but afterwards, no request is answered correctly.
2023/04/19 13:44:34 [info] 33#33 "netbox" prototype started
2023/04/19 13:44:34 [info] 34#34 "netbox" application started
🧬 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'
2023/04/19 13:44:35 [info] 35#35 "netbox" application started
🧬 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'
2023/04/19 13:44:37 [info] 36#36 "netbox" application started
🧬 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'
2023/04/19 13:44:38 [info] 37#37 "netbox" application started
🧬 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'
✅ Unit configuration loaded successfully
2023/04/19 13:44:39 [notice] 18#18 process 25 exited with code 0
2a05:..... - - [19/Apr/2023:13:44:39 +0000] "GET / HTTP/1.1" 302 0 "-" "kube-probe/1.24+"
2a05:..... - - [19/Apr/2023:13:44:42 +0000] "GET / HTTP/1.1" 302 0 "-" "kube-probe/1.24+"
2a05:..... - - [19/Apr/2023:13:44:47 +0000] "GET / HTTP/1.1" 302 0 "-" "kube-probe/1.24+"
2a05:..... - - [19/Apr/2023:13:44:52 +0000] "GET / HTTP/1.1" 302 0 "-" "kube-probe/1.24+"
2a05:..... - - [19/Apr/2023:13:44:53 +0000] "GET / HTTP/1.1" 302 0 "-" "kube-probe/1.24+"
A request with cURL also times out:
curl localhost:8080/ -v
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
>
Apart from that static assets are working properly:
root@netbox-7b9f7d64cd-22fws:/opt/netbox/netbox# date >> static/date.txt
root@netbox-7b9f7d64cd-22fws:/opt/netbox/netbox# curl localhost:8080/static/date.txt
Wed Apr 19 13:50:34 UTC 2023
What it wound up being for us was CPU "throttling" After increasing the limits a bunch, it is not using the new cpu provided, but it is happy that it is there.
Current 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.
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.
Expected Behavior
Netbox does not exit on its own. By exiting the nginx-ingress will return a 404 to clients, every time netbox is unreachable.
Docker Compose Version
kubernetes 1.24
Docker Version
The git Revision
docker-hub versions: v3.3.2-2.2.0, v3.3.4-2.2.0
The git Status
Startup Command
The image directly, no commands
NetBox Logs