0

I'm getting the error at the end of the trace back below. When I run 'python manage.py makemigrations'. I Get similar errors when I run it by 'python manage.py makemigrations accounts' and 'python manage.py makemigrations homedb'. If I run the accounts app, it says I'm missing a dependency in the accounts app and if I run the homedb app, it says I'm missing a dependency in the accounts app.

In an effort to fix this, I've deleted my migrations, many pycache_ items, and the database to no avail.

I also unstalled then reinstalled django.

I would be greatful for any help. This is a portion of my traceback:

self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/core/management/base.py", line 373, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/core/management/base.py", line 417, in execute
    output = self.handle(*args, **options)
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/core/management/base.py", line 90, in wrapped
    res = handle_func(*args, **kwargs)
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/core/management/commands/makemigrations.py", line 88, in handle
    loader = MigrationLoader(None, ignore_no_migrations=True)
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/db/migrations/loader.py", line 53, in __init__
    self.build_graph()
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/db/migrations/loader.py", line 262, in build_graph
    self.graph.validate_consistency()
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/db/migrations/graph.py", line 195, in validate_consistency
    [n.raise_error() for n in self.node_map.values() if isinstance(n, Du
mmyNode)]
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/db/migrations/graph.py", line 195, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, Du
mmyNode)]
  File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d
jango/db/migrations/graph.py", line 58, in raise_error
    raise NodeNotFoundError(self.error_message, self.key, origin=self.or
igin)
django.db.migrations.exceptions.NodeNotFoundError: Migration admin.0004_
alter_logentry_user dependencies reference nonexistent parent node ('hom
edb', '0005_account')
  • Have you tried faking the migrations with: `python manage.py makemigrations` and then `python manage.py migrate --fake account`? Then running the migration as usual. – Yusuf Ertas Jan 04 '22 at 12:11
  • I just tried entering: 'python manage.py makemigrations --fake account' I got the error that i have unrecognized areguments: --fake then I ran makemigrations and migrate as usual, I received the same error – Nick Krolczyk Jan 04 '22 at 12:24
  • The exact order of operations is as follows: You can not fake `makemigrations` but you can do so with `migrations` only. `python manage.py makemigrations` `python manage.py migrate --fake account` `python manage.py migrate` – Yusuf Ertas Jan 04 '22 at 12:30
  • I think there's progress? It's a different error which I think is good! I'm getting the following when i complete those instructions then run 'python manage.py migrate' : ``` File "/home/PyKane/.virtualenvs/django23/lib/python3.9/site-packages/d jango/db/migrations/loader.py", line 184, in check_key raise ValueError("Dependency on app with no migrations: %s" % key[0] ) ValueError: Dependency on app with no migrations: accounts ``` – Nick Krolczyk Jan 04 '22 at 12:35
  • Ok good, just replace `account` with `accounts` in the second command above. – Yusuf Ertas Jan 04 '22 at 12:36
  • bad news, we're back to the initial error : ( django.db.migrations.exceptions.NodeNotFoundError: Migration admin.0006_ alter_logentry_user dependencies reference nonexistent parent node ('acc ounts', '0001_initial') if it matters, I'm using python anywhere – Nick Krolczyk Jan 04 '22 at 12:43
  • Do you have a space in the string 'acc ounts' in your command. If that is not the case, can you please mention at which command you get this error? Is it the last one? – Yusuf Ertas Jan 04 '22 at 12:46
  • I do not have a space, when i run the three commands you mentioned: 1.a. python manage.py makemigrations 1.b. the error is django.db.migrations.exceptions.NodeNotFoundError: Migration admin.0004_ alter_logentry_user dependencies reference nonexistent parent node ('hom edb', '0005_account') 2a. python manage.py migrate --fake accounts 2.b. ValueError: Dependency on app with no migrations: accounts 3 python manage.py migrate – Nick Krolczyk Jan 04 '22 at 12:48
  • 3.b. django.db.migrations.exceptions.NodeNotFoundError: Migration admin.0006_ alter_logentry_user dependencies reference nonexistent parent node ('acc ounts', '0001_initial') – Nick Krolczyk Jan 04 '22 at 12:52
  • It seems like your migrations have dependencies in other apps such as admin. I would suggest deleting all of the migrations and start from scratch as outlined [here](https://stackoverflow.com/a/26283256/10256587). – Yusuf Ertas Jan 04 '22 at 13:11
  • awesome, thank you for all your time! I will go through and delete the admin files – Nick Krolczyk Jan 05 '22 at 03:22

0 Answers0