0

I was making new project and app.

Then when I have typed 'python3 manage.py runserver'

django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0013_auto_20210902_0542 dependencies reference nonexistent parent node ('auth', '0012_alter_user_first_name_max_length')

This error come to me.

And even if I delete 'all' of my app's migrations forder It's still hapening

This error is hapening to all of my projects and apps

Watching for file changes with StatReloader

Performing system checks...

System check identified no issues (0 silenced).
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
    self.check_migrations()
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/core/management/base.py", line 453, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 274, in build_graph
    raise exc
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 248, in build_graph
    self.graph.validate_consistency()
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/graph.py", line 195, in validate_consistency
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/graph.py", line 195, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/home/kimhaju/.local/lib/python3.6/site-packages/django/db/migrations/graph.py", line 58, in raise_error
    raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0013_auto_20210902_0542 dependencies reference nonexistent parent node ('auth', '0012_alter_user_first_name_max_length')
kimhaju
  • 19
  • 6
  • At some point did you modify the code in `site-packages/django` and then run `makemigrations`? Try uninstalling and re-installing Django to get a fresh install – Iain Shelvington Feb 24 '22 at 03:53
  • I have tried uninstall and installing django. But same error. (My django version is 2.2) – kimhaju Feb 24 '22 at 04:11
  • Can you find where the migration `auth.0013_auto_20210902_0542` comes from? It's not from the installed version of Django, you must have either created it or have a different `auth` app installed? – Iain Shelvington Feb 24 '22 at 04:14
  • I can't find where is the 'auth.0013_auto_20210902_0542' is! – kimhaju Feb 24 '22 at 08:39
  • did you find any solution, I'm facing same error – Mohamed Sayed Feb 07 '23 at 20:44
  • inside "migrations" folder change 0001_initial.py -> dependencies to `migrations.swappable_dependency(settings.AUTH_USER_MODEL),` – kimhaju Feb 21 '23 at 12:33

0 Answers0