Zeigren / inventree-docker

Docker Stack For InvenTree A Open Source Inventory Management System
11 stars 5 forks source link

Cannot login into InvenTree #7

Open tionebrr opened 3 years ago

tionebrr commented 3 years ago

Hello, After being able to run the composition, I get an error when trying to login, and nginx is giving me a good old 500. Here is the log from docker-compose:

nginx_1      | 192.168.0.16 - - [05/Dec/2020:07:26:11 +0000] "GET /static/css/bootstrap_3.3.7_css_bootstrap.min.css HTTP/1.1" 404 0 "http://192.168.0.14:9080/login?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0" "-"
inventree    | Internal Server Error: /login
inventree    | Traceback (most recent call last):
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute
inventree    |     return self.cursor.execute(query, args)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
inventree    |     res = self._query(query)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
inventree    |     db.query(q)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 259, in query
inventree    |     _mysql.connection.query(self, query)
inventree    | MySQLdb._exceptions.ProgrammingError: (1146, "Table 'inventree.auth_user' doesn't exist")
inventree    | 
inventree    | The above exception was the direct cause of the following exception:
inventree    | 
inventree    | Traceback (most recent call last):
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 113, in _get_response
inventree    |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/views/generic/base.py", line 71, in view
inventree    |     return self.dispatch(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
inventree    |     return bound_method(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
inventree    |     return view(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
inventree    |     return bound_method(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
inventree    |     response = view_func(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
inventree    |     return bound_method(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
inventree    |     response = view_func(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/contrib/auth/views.py", line 63, in dispatch
inventree    |     return super().dispatch(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/views/generic/base.py", line 97, in dispatch
inventree    |     return handler(request, *args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/views/generic/edit.py", line 141, in post
inventree    |     if form.is_valid():
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/forms/forms.py", line 180, in is_valid
inventree    |     return self.is_bound and not self.errors
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/forms/forms.py", line 175, in errors
inventree    |     self.full_clean()
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/forms/forms.py", line 377, in full_clean
inventree    |     self._clean_form()
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/forms/forms.py", line 404, in _clean_form
inventree    |     cleaned_data = self.clean()
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/contrib/auth/forms.py", line 214, in clean
inventree    |     self.user_cache = authenticate(self.request, username=username, password=password)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/contrib/auth/__init__.py", line 72, in authenticate
inventree    |     user = backend.authenticate(request, **credentials)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 46, in authenticate
inventree    |     user = UserModel._default_manager.get_by_natural_key(username)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/contrib/auth/base_user.py", line 44, in get_by_natural_key
inventree    |     return self.get(**{self.model.USERNAME_FIELD: username})
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
inventree    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 411, in get
inventree    |     num = len(clone)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 258, in __len__
inventree    |     self._fetch_all()
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 1261, in _fetch_all
inventree    |     self._result_cache = list(self._iterable_class(self))
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 57, in __iter__
inventree    |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1152, in execute_sql
inventree    |     cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 68, in execute
inventree    |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
inventree    |     return executor(sql, params, many, context)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
inventree    |     raise dj_exc_value.with_traceback(traceback) from exc_value
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute
inventree    |     return self.cursor.execute(query, args)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
inventree    |     res = self._query(query)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
inventree    |     db.query(q)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 259, in query
inventree    |     _mysql.connection.query(self, query)
inventree    | django.db.utils.ProgrammingError: (1146, "Table 'inventree.auth_user' doesn't exist")
inventree    | 
inventree    | During handling of the above exception, another exception occurred:
inventree    | 
inventree    | Traceback (most recent call last):
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute
inventree    |     return self.cursor.execute(query, args)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
inventree    |     res = self._query(query)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
inventree    |     db.query(q)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 259, in query
inventree    |     _mysql.connection.query(self, query)
inventree    | MySQLdb._exceptions.ProgrammingError: (1146, "Table 'inventree.error_report_error' doesn't exist")
inventree    | 
inventree    | The above exception was the direct cause of the following exception:
inventree    | 
inventree    | Traceback (most recent call last):
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
inventree    |     response = get_response(request)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 115, in _get_response
inventree    |     response = self.process_exception_by_middleware(e, request)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 155, in process_exception_by_middleware
inventree    |     response = middleware_method(request, exception)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/error_report/middleware.py", line 27, in process_exception
inventree    |     error = Error.objects.create(
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
inventree    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 433, in create
inventree    |     obj.save(force_insert=True, using=self.db)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/base.py", line 745, in save
inventree    |     self.save_base(using=using, force_insert=force_insert,
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/base.py", line 782, in save_base
inventree    |     updated = self._save_table(
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/base.py", line 887, in _save_table
inventree    |     results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/base.py", line 924, in _do_insert
inventree    |     return manager._insert(
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
inventree    |     return getattr(self.get_queryset(), name)(*args, **kwargs)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/query.py", line 1204, in _insert
inventree    |     return query.get_compiler(using=using).execute_sql(returning_fields)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1392, in execute_sql
inventree    |     cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 68, in execute
inventree    |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
inventree    |     return executor(sql, params, many, context)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
inventree    |     raise dj_exc_value.with_traceback(traceback) from exc_value
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute
inventree    |     return self.cursor.execute(sql, params)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 74, in execute
inventree    |     return self.cursor.execute(query, args)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 206, in execute
inventree    |     res = self._query(query)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/cursors.py", line 319, in _query
inventree    |     db.query(q)
inventree    |   File "/opt/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 259, in query
inventree    |     _mysql.connection.query(self, query)
inventree    | django.db.utils.ProgrammingError: (1146, "Table 'inventree.error_report_error' doesn't exist")
nginx_1      | 192.168.0.16 - - [05/Dec/2020:07:26:21 +0000] "POST /login?next=/ HTTP/1.1" 500 145 "http://192.168.0.14:9080/login?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0" "-"
nginx_1      | 192.168.0.16 - - [05/Dec/2020:07:26:22 +0000] "GET /favicon.ico HTTP/1.1" 302 0 "http://192.168.0.14:9080/login?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0" "-"
nginx_1      | 192.168.0.16 - - [05/Dec/2020:07:26:22 +0000] "GET /login?next=/favicon.ico HTTP/1.1" 200 754 "http://192.168.0.14:9080/login?next=/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0" "-"

I am missing something... again

tionebrr commented 3 years ago

Here is the full run logs: https://pastebin.com/RfVkVsNE

tionebrr commented 3 years ago

Ah also, I noticed that the page styling of the login page is absent. Firefox cannot get the favicon and css sheet.

tionebrr commented 3 years ago

Hello @Zeigren . Are you still maintaining/using inventree-docker? I'm going to dig into this a bit more seriously today.

Zeigren commented 3 years ago

Try using 0.1.7, see if that fixes it.