[Bug]: The migration directory is corrupt #774

Closed
opened 2026-02-04 21:17:49 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @zalexki on GitHub (Aug 4, 2025).

Where is the problem occurring?

I'm not sure

What browsers are you seeing the problem on?

Other

Current behavior

Installed ghcr.io/plankanban/planka:2.0.0-rc.3 using docker compose default file on july 20
Worked with no issue.

Got back today to this spamming issue.

planka-1 | Error: The migration directory is corrupt, the following files are missing: 20250603102521_canonicalize_locale_codes.js, 20250703122452_move_webhooks_configuration_from_environment_variable_to_ui.js, 20250708200908_persist_closed_state_per_card.js, 20250709160208_add_ability_to_link_tasks_to_cards.js
planka-1 | at validateMigrationList (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:567:11)
planka-1 | at Migrator.latest (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7)
planka-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
planka-1 | at async /app/db/init.js:14:5
planka-1 |
planka-1 | Node.js v18.20.8

Desired behavior

No response

Steps to reproduce

i have no idea how to reproduce i just let it run itself for some days and now its broken :/

Other information

docker-compose.yml

  planka:
    image: ghcr.io/plankanban/planka:2.0.0-rc.3
    restart: on-failure
    volumes:
      - favicons:/app/public/favicons
      - user-avatars:/app/public/user-avatars
      - background-images:/app/public/background-images
      - attachments:/app/private/attachments
    # Optionally override this to your user/group
    # user: 1000:1000
    # tmpfs:
    #   - /app/.tmp:mode=770,uid=1000,gid=1000
    ports:
      - 3300:1337
    environment:
      - BASE_URL=http://localhost:3000
      - DATABASE_URL=postgresql://postgres@postgres/planka

      # Optionally store the database password in secrets:
      # - DATABASE_URL=postgresql://postgres:$${DATABASE_PASSWORD}@postgres/planka
      # - DATABASE_PASSWORD__FILE=/run/secrets/database_password
      # And add the following to the service:
      # secrets:
      #   - database_password

      - SECRET_KEY=notsecretkey
      # Optionally store in secrets - then SECRET_KEY should not be set
      # - SECRET_KEY__FILE=/run/secrets/secret_key

      # - LOG_LEVEL=warn

      # - TRUST_PROXY=true
      # - TOKEN_EXPIRES_IN=365 # In days

      # related: https://github.com/knex/knex/issues/2354
      # As knex does not pass query parameters from the connection string,
      # we have to use environment variables in order to pass the desired values, e.g.
      # - PGSSLMODE=<value>

      # Configure knex to accept SSL certificates
      # - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false

      # Used for per-board notifications
      # - DEFAULT_LANGUAGE=en-US

      # Do not comment out DEFAULT_ADMIN_EMAIL if you want to prevent this user from being edited/deleted
      # - DEFAULT_ADMIN_EMAIL=demo@demo.demo
      # - DEFAULT_ADMIN_PASSWORD=demo
      # Optionally store in secrets - then DEFAULT_ADMIN_PASSWORD should not be set
      # - DEFAULT_ADMIN_PASSWORD__FILE=/run/secrets/default_admin_password
      # - DEFAULT_ADMIN_NAME=Demo Demo
      # - DEFAULT_ADMIN_USERNAME=demo

      # - INTERNAL_ACCESS_TOKEN=
      # - ACTIVE_USERS_LIMIT=

      # Set to true to show more detailed authentication error messages.
      # It should not be enabled without a rate limiter for security reasons.
      # - SHOW_DETAILED_AUTH_ERRORS=false

      # - S3_ENDPOINT=
      # - S3_REGION=
      # - S3_ACCESS_KEY_ID=
      # - S3_SECRET_ACCESS_KEY=
      # Optionally store in secrets - then S3_SECRET_ACCESS_KEY should not be set
      # - S3_SECRET_ACCESS_KEY__FILE=/run/secrets/s3_secret_access_key
      # - S3_BUCKET=
      # - S3_FORCE_PATH_STYLE=true

      # - OIDC_ISSUER=
      # - OIDC_CLIENT_ID=
      # - OIDC_CLIENT_SECRET=
      # Optionally store in secrets - then OIDC_CLIENT_SECRET should not be set
      # - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret
      # - OIDC_ID_TOKEN_SIGNED_RESPONSE_ALG=
      # - OIDC_USERINFO_SIGNED_RESPONSE_ALG=
      # - OIDC_SCOPES=openid email profile
      # - OIDC_RESPONSE_MODE=fragment
      # - OIDC_USE_DEFAULT_RESPONSE_MODE=true
      # - OIDC_ADMIN_ROLES=admin
      # - OIDC_PROJECT_OWNER_ROLES=project_owner
      # - OIDC_BOARD_USER_ROLES=board_user
      # - OIDC_CLAIMS_SOURCE=userinfo
      # - OIDC_EMAIL_ATTRIBUTE=email
      # - OIDC_NAME_ATTRIBUTE=name
      # - OIDC_USERNAME_ATTRIBUTE=preferred_username
      # - OIDC_ROLES_ATTRIBUTE=groups
      # - OIDC_IGNORE_USERNAME=true
      # - OIDC_IGNORE_ROLES=true
      # - OIDC_ENFORCED=true

      # Email Notifications (https://nodemailer.com/smtp/)
      # - SMTP_HOST=
      # - SMTP_PORT=587
      # - SMTP_NAME=
      # - SMTP_SECURE=true
      # - SMTP_USER=
      # - SMTP_PASSWORD=
      # Optionally store in secrets - then SMTP_PASSWORD should not be set
      # - SMTP_PASSWORD__FILE=/run/secrets/smtp_password
      # - SMTP_FROM="Demo Demo" <demo@demo.demo>
      # - SMTP_TLS_REJECT_UNAUTHORIZED=false
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:16-alpine
    restart: on-failure
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=planka
      - POSTGRES_HOST_AUTH_METHOD=trust
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  favicons:
  user-avatars:
  background-images:
  attachments:
  db-data:

i tried to run
docker compose run --rm planka bash -> db:upgrade

with no luck :/

Originally created by @zalexki on GitHub (Aug 4, 2025). ### Where is the problem occurring? I'm not sure ### What browsers are you seeing the problem on? Other ### Current behavior Installed `ghcr.io/plankanban/planka:2.0.0-rc.3` using docker compose default file on july 20 Worked with no issue. Got back today to this spamming issue. planka-1 | Error: The migration directory is corrupt, the following files are missing: 20250603102521_canonicalize_locale_codes.js, 20250703122452_move_webhooks_configuration_from_environment_variable_to_ui.js, 20250708200908_persist_closed_state_per_card.js, 20250709160208_add_ability_to_link_tasks_to_cards.js planka-1 | at validateMigrationList (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:567:11) planka-1 | at Migrator.latest (/app/node_modules/knex/lib/migrations/migrate/Migrator.js:69:7) planka-1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) planka-1 | at async /app/db/init.js:14:5 planka-1 | planka-1 | Node.js v18.20.8 ### Desired behavior _No response_ ### Steps to reproduce i have no idea how to reproduce i just let it run itself for some days and now its broken :/ ### Other information docker-compose.yml ```services: planka: image: ghcr.io/plankanban/planka:2.0.0-rc.3 restart: on-failure volumes: - favicons:/app/public/favicons - user-avatars:/app/public/user-avatars - background-images:/app/public/background-images - attachments:/app/private/attachments # Optionally override this to your user/group # user: 1000:1000 # tmpfs: # - /app/.tmp:mode=770,uid=1000,gid=1000 ports: - 3300:1337 environment: - BASE_URL=http://localhost:3000 - DATABASE_URL=postgresql://postgres@postgres/planka # Optionally store the database password in secrets: # - DATABASE_URL=postgresql://postgres:$${DATABASE_PASSWORD}@postgres/planka # - DATABASE_PASSWORD__FILE=/run/secrets/database_password # And add the following to the service: # secrets: # - database_password - SECRET_KEY=notsecretkey # Optionally store in secrets - then SECRET_KEY should not be set # - SECRET_KEY__FILE=/run/secrets/secret_key # - LOG_LEVEL=warn # - TRUST_PROXY=true # - TOKEN_EXPIRES_IN=365 # In days # related: https://github.com/knex/knex/issues/2354 # As knex does not pass query parameters from the connection string, # we have to use environment variables in order to pass the desired values, e.g. # - PGSSLMODE=<value> # Configure knex to accept SSL certificates # - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false # Used for per-board notifications # - DEFAULT_LANGUAGE=en-US # Do not comment out DEFAULT_ADMIN_EMAIL if you want to prevent this user from being edited/deleted # - DEFAULT_ADMIN_EMAIL=demo@demo.demo # - DEFAULT_ADMIN_PASSWORD=demo # Optionally store in secrets - then DEFAULT_ADMIN_PASSWORD should not be set # - DEFAULT_ADMIN_PASSWORD__FILE=/run/secrets/default_admin_password # - DEFAULT_ADMIN_NAME=Demo Demo # - DEFAULT_ADMIN_USERNAME=demo # - INTERNAL_ACCESS_TOKEN= # - ACTIVE_USERS_LIMIT= # Set to true to show more detailed authentication error messages. # It should not be enabled without a rate limiter for security reasons. # - SHOW_DETAILED_AUTH_ERRORS=false # - S3_ENDPOINT= # - S3_REGION= # - S3_ACCESS_KEY_ID= # - S3_SECRET_ACCESS_KEY= # Optionally store in secrets - then S3_SECRET_ACCESS_KEY should not be set # - S3_SECRET_ACCESS_KEY__FILE=/run/secrets/s3_secret_access_key # - S3_BUCKET= # - S3_FORCE_PATH_STYLE=true # - OIDC_ISSUER= # - OIDC_CLIENT_ID= # - OIDC_CLIENT_SECRET= # Optionally store in secrets - then OIDC_CLIENT_SECRET should not be set # - OIDC_CLIENT_SECRET__FILE=/run/secrets/oidc_client_secret # - OIDC_ID_TOKEN_SIGNED_RESPONSE_ALG= # - OIDC_USERINFO_SIGNED_RESPONSE_ALG= # - OIDC_SCOPES=openid email profile # - OIDC_RESPONSE_MODE=fragment # - OIDC_USE_DEFAULT_RESPONSE_MODE=true # - OIDC_ADMIN_ROLES=admin # - OIDC_PROJECT_OWNER_ROLES=project_owner # - OIDC_BOARD_USER_ROLES=board_user # - OIDC_CLAIMS_SOURCE=userinfo # - OIDC_EMAIL_ATTRIBUTE=email # - OIDC_NAME_ATTRIBUTE=name # - OIDC_USERNAME_ATTRIBUTE=preferred_username # - OIDC_ROLES_ATTRIBUTE=groups # - OIDC_IGNORE_USERNAME=true # - OIDC_IGNORE_ROLES=true # - OIDC_ENFORCED=true # Email Notifications (https://nodemailer.com/smtp/) # - SMTP_HOST= # - SMTP_PORT=587 # - SMTP_NAME= # - SMTP_SECURE=true # - SMTP_USER= # - SMTP_PASSWORD= # Optionally store in secrets - then SMTP_PASSWORD should not be set # - SMTP_PASSWORD__FILE=/run/secrets/smtp_password # - SMTP_FROM="Demo Demo" <demo@demo.demo> # - SMTP_TLS_REJECT_UNAUTHORIZED=false depends_on: postgres: condition: service_healthy postgres: image: postgres:16-alpine restart: on-failure volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] interval: 10s timeout: 5s retries: 5 volumes: favicons: user-avatars: background-images: attachments: db-data: ``` i tried to run `docker compose run --rm planka bash` -> `db:upgrade` with no luck :/
Author
Owner

@meltyshev commented on GitHub (Aug 4, 2025):

Hey! I think you initially installed the nightly version (maybe accidentally) and then switched the image tag to 2.0.0-rc.3. However, by that time, the database had already been initialized with the newer migration files from the nightly build. So when you switch to 2.0.0-rc.3, it throws an error because the database expects migrations that don't exist in that version's folder.

The best option for now is to continue using the nightly version until we release the final v2. Just keep in mind that while we test everything thoroughly before pushing, there might still be a few minor bugs. The nightly build includes more features and improvements, but it's not recommended to stay on it long-term - once the final v2 is released, it's best to switch to that.

To switch to the nightly version, update your docker-compose.yml by changing the image to ghcr.io/plankanban/planka:nightly.

Then run the following commands:

docker compose pull
docker compose up -d
@meltyshev commented on GitHub (Aug 4, 2025): Hey! I think you initially installed the `nightly` version (maybe accidentally) and then switched the image tag to `2.0.0-rc.3`. However, by that time, the database had already been initialized with the newer migration files from the nightly build. So when you switch to `2.0.0-rc.3`, it throws an error because the database expects migrations that don't exist in that version's folder. The best option for now is to continue using the `nightly` version until we release the final v2. Just keep in mind that while we test everything thoroughly before pushing, there might still be a few minor bugs. The nightly build includes more features and improvements, but it's not recommended to stay on it long-term - once the final v2 is released, it's best to switch to that. To switch to the `nightly` version, update your `docker-compose.yml` by changing the `image` to `ghcr.io/plankanban/planka:nightly`. Then run the following commands: ``` docker compose pull docker compose up -d ```
Author
Owner

@zalexki commented on GitHub (Aug 5, 2025):

Hey !

thank you for your help !

that might the be case ye

i switched to nightly, i can login but then endless loop with this error spamming

index-B1DQv_wf.js:419 WebSocket connection to 'wss://roadmap.....com/socket.io/?__sails_io_sdk_version=1.2.1&__sa…platform=node&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed: ```
@zalexki commented on GitHub (Aug 5, 2025): Hey ! thank you for your help ! that might the be case ye i switched to nightly, i can login but then endless loop with this error spamming ``` index-B1DQv_wf.js:419 WebSocket connection to 'wss://roadmap.....com/socket.io/?__sails_io_sdk_version=1.2.1&__sa…platform=node&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed: ```
Author
Owner

@meltyshev commented on GitHub (Aug 6, 2025):

You're welcome! Hm... This error usually means that the BASE_URL is configured incorrectly - WebSocket connections fail because the origin check doesn't pass. In your case, it should be set to https://roadmap.....com.

Also, if you're using a proxy server, make sure it's correctly handling WebSocket connections and that TRUST_PROXY is set to true.

@meltyshev commented on GitHub (Aug 6, 2025): You're welcome! Hm... This error usually means that the `BASE_URL` is configured incorrectly - WebSocket connections fail because the origin check doesn't pass. In your case, it should be set to `https://roadmap.....com`. Also, if you're using a proxy server, make sure it's correctly handling WebSocket connections and that `TRUST_PROXY` is set to `true`.
Author
Owner

@zalexki commented on GitHub (Aug 6, 2025):

that was it !

thanks a lot for your help

question am i kinda stuck with nightlies or will i be able to switch to a stable 2.* version when it comes out ?

@zalexki commented on GitHub (Aug 6, 2025): that was it ! thanks a lot for your help question am i kinda stuck with nightlies or will i be able to switch to a stable 2.* version when it comes out ?
Author
Owner

@meltyshev commented on GitHub (Aug 6, 2025):

Happy to help - you're welcome :)

question am i kinda stuck with nightlies or will i be able to switch to a stable 2.* version when it comes out ?

You'll definitely be able to switch, and it's actually recommended to do so. We're planning to release the final version on September 1st, if everything goes as planned.

Once it's available, you'll just need to change the image tag to latest and run docker compose pull. There should be no issues switching, and it should be 100% compatible with your current nightly version.

@meltyshev commented on GitHub (Aug 6, 2025): Happy to help - you're welcome :) > question am i kinda stuck with nightlies or will i be able to switch to a stable 2.* version when it comes out ? You'll definitely be able to switch, and it's actually recommended to do so. We're planning to release the final version on September 1st, if everything goes as planned. Once it's available, you'll just need to change the image tag to `latest` and run `docker compose pull`. There should be no issues switching, and it should be 100% compatible with your current `nightly` version.
Author
Owner

@zalexki commented on GitHub (Aug 6, 2025):

awesome thank you for the help and the informations !

@zalexki commented on GitHub (Aug 6, 2025): awesome thank you for the help and the informations !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#774