Fresh Install - Stuck at Running migrations:

When things don't work as they should.
Post Reply
drsib
Posts: 3
Joined: Tue Oct 13, 2020 9:54 pm

Fresh Install - Stuck at Running migrations:

Post by drsib »

I feel like I'm probably doing something super obvious wrong here. So hopefully someone can set me straight.

Basic setup:
Using an Unraid server and their docker implementation. This means I can't use docker compose but have manually created and associated the containers.

This is a fresh install but it appears to be hanging at a migration process? Is that the equivalent of migrating from an old version?

Here is the log of the Mayan container:

Code: Select all

mayan: starting entrypoint.sh
Waiting for **:5432
Waiting for **:6379
mayan: update_uid_gid()
usermod: no changes
mayan: os_package_installs()
mayan: pip_installs()
mayan: initialsetup()
Operations to perform:
Apply all migrations: acls, actstream, admin, appearance, auth, authtoken, autoadmin, cabinets, checkouts, common, contenttypes, converter, django_celery_beat, django_gpg, document_comments, document_indexing, document_parsing, document_signatures, document_states, documents, dynamic_search, events, file_caching, file_metadata, linking, lock_manager, logging, mailer, mayan_statistics, metadata, motd, ocr, permissions, quotas, sessions, sites, sources, storage, tags, user_management, web_links
Running migrations:
When I look at the pgsql log I see a whole bunch of errors where it is trying to read tables that don't exist. I have logged into the db and confirmed the only table it has created is django_migrations. The SQL that is failing is:

Code: Select all


STATEMENT: SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_create' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR: relation "permissions_storedpermission" does not exist at character 132

STATEMENT: SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_delete' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR: relation "permissions_storedpermission" does not exist at character 132

STATEMENT: SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_edit' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR: relation "permissions_storedpermission" does not exist at character 132

STATEMENT: SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_view' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR: relation "permissions_storedpermission" does not exist at character 132

STATEMENT: SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_instance_view' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR: relation "document_states_workflowstateaction" does not exist at character 8
It feels like the step to create the db tables is not executing correctly?

Any thoughts?
User avatar
rosarior
Developer
Developer
Posts: 582
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Fresh Install - Stuck at Running migrations:

Post by rosarior »

Looks like a container communication problem. Check that the Mayan container can communicate with the database, the broker, and the result storage. You can log into the container, install NMAP and check if it can access the other container and their ports.
drsib
Posts: 3
Joined: Tue Oct 13, 2020 9:54 pm

Re: Fresh Install - Stuck at Running migrations:

Post by drsib »

I installed namp and checked for running services. It did locate on the host the following:

Code: Select all

5432/tcp open  postgresql
I have also confirmed that i can connect to Redis from another computer on the network

I also know it is connecting to the pgsql database as it is the only container connecting to it and do see that it is trying to run selects against the DB.

However when i log into the DB, there are no tables in the DB
drsib
Posts: 3
Joined: Tue Oct 13, 2020 9:54 pm

Re: Fresh Install - Stuck at Running migrations:

Post by drsib »

I think i might have solved it. As you guessed, it was a connection issue. I figured i would share the fix here incase someone else has the same issue.

The docker compose filed had env variables for the Mayan app of:

-e MAYAN_CELERY_BROKER_URL="redis://:mayanredispassword@redis:6379/0" \
-e MAYAN_CELERY_RESULT_BACKEND="redis://:mayanredispassword@redis:6379/1" \

I had to update the connection URL to replace redis with the external exposed IP of the redis DB. The result was:

-e MAYAN_CELERY_BROKER_URL="redis://:mayanredispassword@192.168.*.*/0" \
-e MAYAN_CELERY_RESULT_BACKEND="redis://:mayanredispassword@192.168.*.*/1" \

I replaced my internal IPs with *.....
Post Reply