djangowagtaildjango-migrationsdokkuprocfile

Dokku Procfile "release: python manage.py migrate" results in a NodeNotFoundError "Migration XYZ dependencies reference nonexistent parent node"


When attempting to deploy to the Dokku testing environment with a Postgres database, I encounter an error while the Procfile is being utilized.

-----> Releasing aha-website-test...
-----> Checking for predeploy task
       No predeploy task found, skipping
-----> Checking for release task
       Executing release task from Procfile in ephemeral container: python manage.py migrate
=====> Start of aha-website-test release task (825335cfe) output
remote:  !     Traceback (most recent call last):
remote:  !       File "/app/manage.py", line 10, in <module>
remote:  !         execute_from_command_line(sys.argv)
remote:  !         ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
remote:  !         utility.execute()
remote:  !         ~~~~~~~~~~~~~~~^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
remote:  !         self.fetch_command(subcommand).run_from_argv(self.argv)
remote:  !         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv
remote:  !         self.execute(*args, **cmd_options)
remote:  !         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
remote:  !         output = self.handle(*args, **options)
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 107, in wrapper
remote:  !         res = handle_func(*args, **kwargs)
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/core/management/commands/migrate.py", line 118, in handle
remote:  !         executor = MigrationExecutor(connection, self.migration_progress_callback)
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/db/migrations/executor.py", line 18, in __init__
remote:  !         self.loader = MigrationLoader(self.connection)
remote:  !                       ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/db/migrations/loader.py", line 58, in __init__
remote:  !         self.build_graph()
remote:  !         ~~~~~~~~~~~~~~~~^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/db/migrations/loader.py", line 276, in build_graph
remote:  !         self.graph.validate_consistency()
remote:  !         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/db/migrations/graph.py", line 198, in validate_consistency
remote:  !         [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
remote:  !          ~~~~~~~~~~~~~^^
remote:  !       File "/usr/local/lib/python3.13/site-packages/django/db/migrations/graph.py", line 60, in raise_error
remote:  !         raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
remote:  !     django.db.migrations.exceptions.NodeNotFoundError: Migration generic.0001_initial dependencies reference nonexistent parent node ('wagtailcore', '0092_query_searchpromotion_querydailyhits')

The Procfile

release: python manage.py migrate

I cannot reproduce this locally. I also removed the db and every migration, and still no error, migrations where applied without any errors.

Wagtail version: 6.2.2
Django version: 5.1.2
psycopg version: 3.2.3


Solution

  • After a lot of trail and error i made a last resort move and just created a new project and moved the code there. It was the only suitable option. Migration errors were gone and everything worked as expected. Never came to the cause of all the weird errors.