saleor / saleor

Saleor Core: the high performance, composable, headless commerce API.
https://saleor.io
BSD 3-Clause "New" or "Revised" License
20.53k stars 5.42k forks source link

Bug: Docker installation - Permission doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS #11792

Open mistrypavan opened 1 year ago

mistrypavan commented 1 year ago

What are you trying to achieve?

I am installing Saleor by using this giode - https://docs.saleor.io/docs/3.x/setup/docker-compose

Adter this step => Finally, create an admin account:

docker-compose run --rm api python3 manage.py createsuperuser

After running above step following error is throwing:

RuntimeError: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Steps to reproduce the problem

pavan@system-892:~/saleor/saleor-platform$ docker-compose run --rm api python3 manage.py createsuperuser
[+] Running 3/0
 ⠿ Container saleor-platform-db-1      Running                                                                                  0.0s
 ⠿ Container saleor-platform-redis-1   Running                                                                                  0.0s
 ⠿ Container saleor-platform-jaeger-1  Running                                                                                  0.0s
Traceback (most recent call last):
  File "/app/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 100, in handle
    default_username = get_default_username(database=database)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/management/__init__.py", line 115, in get_default_username
    from django.contrib.auth import models as auth_app
  File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/models.py", line 35, in <module>
    class Permission(models.Model):
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 113, in __new__
    raise RuntimeError(
RuntimeError: Model class django.contrib.auth.models.Permission doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
pavan@system-892:~/saleor/saleor-platform$ 

What did you expect to happen?

It should have created a new super user and should have allowed to login as super user in the dashboard.

Logs

No response

Environment

Saleor version: … OS and version: Docker based installation - https://docs.saleor.io/docs/3.x/setup/docker-compose

VictorHurtado commented 1 year ago

I have the same problem, I am using docker to generate the images and it does not allow me to create the super user with the command specified in the documentation.

akhial commented 1 year ago

Will be fixed by https://github.com/saleor/saleor/pull/11810

peelar commented 1 year ago

Hello @VictorHurtado @mistrypavan 👋

Can you please confirm if the PR mentioned by @akhial fixed it for you?