openwisp / docker-openwisp

OpenWISP in docker. For production usage we recommend using the ansible-openwisp2 role.
https://openwisp.io/docs/stable/docker/
BSD 3-Clause "New" or "Revised" License
154 stars 83 forks source link

[bug] auto-install issue #372

Closed ropelletier closed 1 month ago

ropelletier commented 1 month ago

Describe the bug I have used the auto-install script to install openwisp, but I m getting this error

deploy# docker logs -f docker-openwisp_websocket_1
INFO spawned: 'daphne' with pid 28
2024-10-10 09:15:11,578 INFO spawned: 'daphne' with pid 28
Traceback (most recent call last):
  File "/usr/local/bin/daphne", line 8, in <module>
    sys.exit(CommandLineInterface.entrypoint())
  File "/usr/local/lib/python3.7/site-packages/daphne/cli.py", line 191, in entrypoint
    cls().run(sys.argv[1:])
  File "/usr/local/lib/python3.7/site-packages/daphne/cli.py", line 252, in run
    application = import_by_path(args.application)
  File "/usr/local/lib/python3.7/site-packages/daphne/utils.py", line 12, in import_by_path
    target = importlib.import_module(module_path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./openwisp/asgi.py", line 11, in <module>
    django.setup()
  File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 83, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 70, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 177, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./openwisp/settings.py", line 39, in <module>
    f'{HTTP_SCHEME}://{os.environ["RADIUS_DOMAIN"]}',
  File "/usr/local/lib/python3.7/os.py", line 681, in __getitem__
    raise KeyError(key) from None
KeyError: 'RADIUS_DOMAIN'
2024-10-10 09:15:12,077 INFO exited: daphne (exit status 1; not expected)
2024-10-10 09:15:12,077 INFO exited: daphne (exit status 1; not expected)
deploy# docker logs -f docker-openwisp_dashboard_1
Waiting for database to become available...
Connection with database established.
Waiting for redis to become available...
Connection with redis established.
Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 83, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 70, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 177, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/openwisp/openwisp/settings.py", line 39, in <module>
    f'{HTTP_SCHEME}://{os.environ["RADIUS_DOMAIN"]}',
  File "/usr/local/lib/python3.7/os.py", line 681, in __getitem__
    raise KeyError(key) from None
KeyError: 'RADIUS_DOMAIN'
docker logs -f docker-openwisp_nginx_1
2024/10/10 09:24:56 [error] 44#44: *356 connect() failed (113: Host is unreachable) while connecting to upstream, client: 172.18.0.6, server: dashboard.internal, request: "GET /admin/login/ HTTP/1.1", upstream: "uwsgi://172.18.0.5:8000", host: "dashboard.internal"
[cc492bc27260] - - [10/Oct/2024:09:24:56 -0400] "GET /admin/login/ HTTP/1.1" status: 502 157 "-" "Wget" http_x_forwarded_for: - - remote_addr: 172.18.0.6 - realip_remote_addr: 172.18.0.6 - real_ip: 172.18.0.6

Steps To Reproduce Steps to reproduce the behavior: edit .env file run auto-install.sh answer all the questions run docker logs -f on containers to discover the error

Expected behavior Expected to be able to open the web interface

System Informatioon:

pandafy commented 1 month ago

@ropelletier can you share the changes made to the .env file? Listing out the variables would help.

Can you also share the inputs given to the auto-install script?

nemesifier commented 1 month ago

@ropelletier can you please share which documentation (URL) you followed and the exact steps you did to run into this problem?