Using DEFAULT_LANGUAGE other than en-us causes worker not to boot #7377

Closed
opened 2025-12-29 20:22:36 +01:00 by adam · 1 comment
Owner

Originally created by @ziggekatten on GitHub (Dec 17, 2022).

NetBox version

V3.4.1

Python version

3.8

Steps to Reproduce

  1. add DEFAULT_LANGUAGE='se-sv' to configuration.py
  2. restart netbox and netbox-rq

Expected Behavior

An working Netbox running with Swedish date format in Scripts/jobs

Observed Behavior

Gets an bad gateway.

Running journalctl -en netbox shows that worker does not start, complaining about translation files

Dec 17 11:36:42 ubuntu gunicorn[49514]:     _translations[language] = DjangoTranslation(language)
Dec 17 11:36:42 ubuntu gunicorn[49514]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/django/utils/translation/trans_real.py", line 173, in __init__
Dec 17 11:36:42 ubuntu gunicorn[49514]:     raise OSError(
Dec 17 11:36:42 ubuntu gunicorn[49514]: OSError: No translation files found for default language se-sv.
Dec 17 11:36:42 ubuntu gunicorn[49514]: [2022-12-17 10:36:42 +0000] [49514] [INFO] Worker exiting (pid: 49514)
Dec 17 11:36:42 ubuntu gunicorn[49508]: Traceback (most recent call last):
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 209, in run
Dec 17 11:36:42 ubuntu gunicorn[49508]:     self.sleep()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 357, in sleep
Dec 17 11:36:42 ubuntu gunicorn[49508]:     ready = select.select([self.PIPE[0]], [], [], 1.0)
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
Dec 17 11:36:42 ubuntu gunicorn[49508]:     self.reap_workers()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
Dec 17 11:36:42 ubuntu gunicorn[49508]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
Dec 17 11:36:42 ubuntu gunicorn[49508]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Dec 17 11:36:42 ubuntu gunicorn[49508]: During handling of the above exception, another exception occurred:
Dec 17 11:36:42 ubuntu gunicorn[49508]: Traceback (most recent call last):
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox/venv/bin/gunicorn", line 8, in <module>
Dec 17 11:36:42 ubuntu gunicorn[49508]:     sys.exit(run())
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
Dec 17 11:36:42 ubuntu gunicorn[49508]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 231, in run
Dec 17 11:36:42 ubuntu gunicorn[49508]:     super().run()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run
Dec 17 11:36:42 ubuntu gunicorn[49508]:     Arbiter(self).run()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run
Dec 17 11:36:42 ubuntu gunicorn[49508]:     self.halt(reason=inst.reason, exit_status=inst.exit_status)
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt
Dec 17 11:36:42 ubuntu gunicorn[49508]:     self.stop()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop
Dec 17 11:36:42 ubuntu gunicorn[49508]:     time.sleep(0.1)
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
Dec 17 11:36:42 ubuntu gunicorn[49508]:     self.reap_workers()
Dec 17 11:36:42 ubuntu gunicorn[49508]:   File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
Dec 17 11:36:42 ubuntu gunicorn[49508]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
Dec 17 11:36:42 ubuntu gunicorn[49508]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
Dec 17 11:36:42 ubuntu systemd[1]: netbox.service: Main process exited, code=exited, status=1/FAILURE
Dec 17 11:36:42 ubuntu systemd[1]: netbox.service: Failed with result 'exit-code'.
Originally created by @ziggekatten on GitHub (Dec 17, 2022). ### NetBox version V3.4.1 ### Python version 3.8 ### Steps to Reproduce 1. add DEFAULT_LANGUAGE='se-sv' to configuration.py 2. restart netbox and netbox-rq ### Expected Behavior An working Netbox running with Swedish date format in Scripts/jobs ### Observed Behavior Gets an bad gateway. Running journalctl -en netbox shows that worker does not start, complaining about translation files ```venv) root@ubuntu:/opt/netbox/netbox/netbox# journalctl -eu netbox Dec 17 11:36:42 ubuntu gunicorn[49514]: _translations[language] = DjangoTranslation(language) Dec 17 11:36:42 ubuntu gunicorn[49514]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/django/utils/translation/trans_real.py", line 173, in __init__ Dec 17 11:36:42 ubuntu gunicorn[49514]: raise OSError( Dec 17 11:36:42 ubuntu gunicorn[49514]: OSError: No translation files found for default language se-sv. Dec 17 11:36:42 ubuntu gunicorn[49514]: [2022-12-17 10:36:42 +0000] [49514] [INFO] Worker exiting (pid: 49514) Dec 17 11:36:42 ubuntu gunicorn[49508]: Traceback (most recent call last): Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 209, in run Dec 17 11:36:42 ubuntu gunicorn[49508]: self.sleep() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 357, in sleep Dec 17 11:36:42 ubuntu gunicorn[49508]: ready = select.select([self.PIPE[0]], [], [], 1.0) Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld Dec 17 11:36:42 ubuntu gunicorn[49508]: self.reap_workers() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers Dec 17 11:36:42 ubuntu gunicorn[49508]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) Dec 17 11:36:42 ubuntu gunicorn[49508]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> Dec 17 11:36:42 ubuntu gunicorn[49508]: During handling of the above exception, another exception occurred: Dec 17 11:36:42 ubuntu gunicorn[49508]: Traceback (most recent call last): Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox/venv/bin/gunicorn", line 8, in <module> Dec 17 11:36:42 ubuntu gunicorn[49508]: sys.exit(run()) Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 67, in run Dec 17 11:36:42 ubuntu gunicorn[49508]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 231, in run Dec 17 11:36:42 ubuntu gunicorn[49508]: super().run() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run Dec 17 11:36:42 ubuntu gunicorn[49508]: Arbiter(self).run() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run Dec 17 11:36:42 ubuntu gunicorn[49508]: self.halt(reason=inst.reason, exit_status=inst.exit_status) Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt Dec 17 11:36:42 ubuntu gunicorn[49508]: self.stop() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop Dec 17 11:36:42 ubuntu gunicorn[49508]: time.sleep(0.1) Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld Dec 17 11:36:42 ubuntu gunicorn[49508]: self.reap_workers() Dec 17 11:36:42 ubuntu gunicorn[49508]: File "/opt/netbox-3.4.1/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers Dec 17 11:36:42 ubuntu gunicorn[49508]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) Dec 17 11:36:42 ubuntu gunicorn[49508]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> Dec 17 11:36:42 ubuntu systemd[1]: netbox.service: Main process exited, code=exited, status=1/FAILURE Dec 17 11:36:42 ubuntu systemd[1]: netbox.service: Failed with result 'exit-code'. ```
adam closed this issue 2025-12-29 20:22:36 +01:00
Author
Owner

@ziggekatten commented on GitHub (Dec 17, 2022):

Ignore this issue.... 'se-sv' should be 'sv-se'....

@ziggekatten commented on GitHub (Dec 17, 2022): Ignore this issue.... 'se-sv' should be 'sv-se'....
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7377