Skip to content

Docker docmost container Failed to execute migration #117

Closed

Description

@flinthamm

I'm using the default docker-compose file and have setup the 4 key variables: APP_URL, APP_SECRET, DATABASE_URL,REDIS_URL. Very early on in the boot as the docmost container boots for the first time it completes the first 11 migration rows but then fails near the end with...

docmost-docmost-1  | [Nest] 41  - 07/24/2024, 1:10:29 PM   ERROR [DatabaseMigrationService] Failed to execute migration "20240324T086800-pages-tsvector-trigger"
docmost-docmost-1  | [Nest] 41  - 07/24/2024, 1:10:29 PM   ERROR [DatabaseMigrationService] Failed to run database migration. Exiting program.
docmost-docmost-1  | [Nest] 41  - 07/24/2024, 1:10:29 PM   ERROR [DatabaseMigrationService] error: syntax error at or near "TRIGGER"
docmost-docmost-1  | /app/apps/server:
docmost-docmost-1  |  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  [email protected] start:prod: `cross-env NODE_ENV=production node dist/main`
docmost-docmost-1  | Exit status 1
docmost-docmost-1  |  ELIFECYCLE  Command failed with exit code 1.
docmost-docmost-1 exited with code 0

The main difference to the docker-compose script is I'm using an external PostgresSQL (v13.14) database but this runs fine for all other containers that use it.

Here is a screenshot of the errors.
image

I've tried deleting the database and running again. The user specified has full permissions.

If anyone has any ideas, all gratefully received :)

Activity

  1. olivierIllogika commented on Jul 24, 2024

    @olivierIllogika
    Contributor

    The "CREATE OR REPLACE TRIGGER" syntax is only valid in postgresql 14+ (vs. 13)

    Maybe the documentation should indicate support for >=14, but if you tweak the migration to remove the "OR REPLACE" and it's the only issue, maybe the migration could be modified manually in the repo?

  2. flinthamm commented on Jul 24, 2024

    @flinthamm
    Author

    Hi @olivierIllogika and thank you for this detailed and prompt response. Potentially I'll look to upgrade my version or as you say, tweak the migration.

    Hopefully this might help someone else with a similar compatibility issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions