Opened 3 years ago

Closed 3 years ago

#33089 closed Cleanup/optimization (invalid)

Unable to run db migration

Reported by: Aprila Hijriyan Owned by:
Component: Error reporting Version: 3.2
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

To be honest this previously worked fine, but I don't know why I can't run the "makemigrations" command.
The error that appears in my terminal:

WARNING:apscheduler.scheduler:Error getting due jobs from job store 'default': relation "django_apscheduler_djangojob" does not exist
LINE 1: ..., "django_apscheduler_djangojob"."job_state" FROM "django_ap...
                                                             ^

DEBUG:apscheduler.scheduler:Next wakeup is due at 2021-09-08 17:59:12.316528+07:00 (in 10.000000 seconds)
Traceback (most recent call last):
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "drf_superset_permission" does not exist
LINE 1: SELECT (1) AS "a" FROM "drf_superset_permission" WHERE "drf_...
                               ^


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    django.setup()
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/home/apriladev/Workspace/bankjateng-new/api/apps.py", line 44, in ready
    create_all_permissions()
  File "/home/apriladev/Workspace/bankjateng-new/drf_superset/core/helpers.py", line 74, in create_all_permissions
    if not Permission.objects.filter(name=view).exists():
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/models/query.py", line 808, in exists
    return self.query.has_results(using=self.db)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/models/sql/query.py", line 552, in has_results
    return compiler.has_results()
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1145, in has_results
    return bool(self.execute_sql(SINGLE))
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 98, in execute
    return super().execute(sql, params)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/apriladev/.local/share/virtualenvs/bankjateng-new-Hvy1TumD/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "drf_superset_permission" does not exist
LINE 1: SELECT (1) AS "a" FROM "drf_superset_permission" WHERE "drf_...

I'm using a postgre database with docker images. As I explained earlier, I can't run the "makemigrations" command.

So I took the initiative to pull back the image Docker (clean all the image Docker & and volume).
Also I cleaned all files *.pyc, pycache, migrations.
Then I ran the command "python manage.py reset_db -c".

Still not working, anyone please help me. :)

Change History (1)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed

See TicketClosingReasons/UseSupportChannels for ways to get help. Trac is not a support channel.

Note: See TracTickets for help on using tickets.
Back to Top