linuxserver / docker-healthchecks

GNU General Public License v3.0
177 stars 38 forks source link

Can't login to fresh install #85

Closed realEthanZou closed 2 years ago

realEthanZou commented 2 years ago

linuxserver.io


Expected Behavior

Able to login

Current Behavior

OperationalError at /accounts/login/

Steps to Reproduce

  1. Fresh install with docker compose
  2. Login

Environment

OS: Ubuntu 20.04 CPU architecture: x86_64 How docker service was installed: lsio repo

Command used to create docker container (run/create/compose/screenshot)

version: "2.1"
services:
  healthchecks:
    image: lscr.io/linuxserver/healthchecks
    container_name: healthchecks
    environment:
      - PUID=1000
      - PGID=1000
      - SITE_ROOT=redacted.my.domain
      - SITE_NAME=redacted
      - DEFAULT_FROM_EMAIL=redacted
      - EMAIL_HOST=redacted
      - EMAIL_PORT=redacted
      - EMAIL_HOST_USER=redacted
      - EMAIL_HOST_PASSWORD=redacted
      - EMAIL_USE_TLS=True
      - ALLOWED_HOSTS=["*"]
      - SUPERUSER_EMAIL=redacted
      - SUPERUSER_PASSWORD=redacted
    volumes:
      - ./data:/config
    ports:
      - 8000:8000
    restart: unless-stopped

Docker logs

healthchecks  | Internal Server Error: /accounts/login/
healthchecks  | Traceback (most recent call last):
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 85, in _execute
healthchecks  |     return self.cursor.execute(sql, params)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 416, in execute
healthchecks  |     return Database.Cursor.execute(self, query, params)
healthchecks  | sqlite3.OperationalError: no such table: api_tokenbucket
healthchecks  | 
healthchecks  | The above exception was the direct cause of the following exception:
healthchecks  | 
healthchecks  | Traceback (most recent call last):
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
healthchecks  |     response = get_response(request)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
healthchecks  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
healthchecks  |   File "/app/healthchecks/./hc/accounts/views.py", line 156, in login
healthchecks  |     if form.is_valid():
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/forms/forms.py", line 190, in is_valid
healthchecks  |     return self.is_bound and not self.errors
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/forms/forms.py", line 185, in errors
healthchecks  |     self.full_clean()
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/forms/forms.py", line 405, in full_clean
healthchecks  |     self._clean_form()
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/forms/forms.py", line 426, in _clean_form
healthchecks  |     cleaned_data = self.clean()
healthchecks  |   File "/app/healthchecks/./hc/accounts/forms.py", line 88, in clean
healthchecks  |     if not TokenBucket.authorize_login_password(username):
healthchecks  |   File "/app/healthchecks/./hc/api/models.py", line 961, in authorize_login_password
healthchecks  |     return TokenBucket.authorize(value, 20, 3600 * 24)
healthchecks  |   File "/app/healthchecks/./hc/api/models.py", line 914, in authorize
healthchecks  |     obj, created = TokenBucket.objects.get_or_create(value=value)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
healthchecks  |     return getattr(self.get_queryset(), name)(*args, **kwargs)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 588, in get_or_create
healthchecks  |     return self.get(**kwargs), False
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 435, in get
healthchecks  |     num = len(clone)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
healthchecks  |     self._fetch_all()
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 1354, in _fetch_all
healthchecks  |     self._result_cache = list(self._iterable_class(self))
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
healthchecks  |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1202, in execute_sql
healthchecks  |     cursor.execute(sql, params)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 99, in execute
healthchecks  |     return super().execute(sql, params)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
healthchecks  |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
healthchecks  |     return executor(sql, params, many, context)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 85, in _execute
healthchecks  |     return self.cursor.execute(sql, params)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
healthchecks  |     raise dj_exc_value.with_traceback(traceback) from exc_value
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 85, in _execute
healthchecks  |     return self.cursor.execute(sql, params)
healthchecks  |   File "/usr/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 416, in execute
healthchecks  |     return Database.Cursor.execute(self, query, params)
healthchecks  | django.db.utils.OperationalError: no such table: api_tokenbucket
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

jmc265 commented 2 years ago

@realEthanZou I am experiencing the same issue, how did you fix it?

Gerben321 commented 2 years ago

Same here. Got it working?

jmc265 commented 2 years ago

Actually, mine was a rather silly issue on my part. I hadn't set the SITE_ROOT environement variable properly.

tristan-k commented 2 years ago

Same here. No clue what could be the reason for no such table: api_tokenbucket. This is really annoying.