XRAY: Failed to get db migration parameters: Failed to check if mongo migration is needed

AuthorFullName__c
Lawrence Fung
articleNumber
000005235
FirstPublishedDate
2022-03-31T09:52:09Z
lastModifiedDate
2025-05-15

XRAY: Failed to get db migration parameters: Failed to check if mongo migration is needed

When starting up Xray, you may see the following error if there is a database misconfiguration.

2021-09-29T09:22:27.358Z [jfxr ] [ERROR] [45697710ba70780c] [migrate:46                    ] [main                ] Failed to get db migration parameters: Failed to check if mongo migration is needed
 --- at /go/src/jfrog.com/xray/internal/migration/db/migrate.go:70 (GetMigrationDbs) ---
Caused by: failed to get postgres db migration version
 --- at /go/src/jfrog.com/xray/internal/migration/db/migrate.go:103 (IsMongoMigrationNeeded) ---
Caused by: Driver 'postgresql' not found.
Solution

The above error usually happens due to a misconfiguration in the database URL found in the system.yaml. A common issue is using the name PostgreSQL instead of Postgres in the URL. It should normally look like the following.

shared
  database:
    type: postgresql
    driver: org.postgresql.Driver
    url: postgres://<database_host>:<:port>/xray?sslmode=disable
    username: xray
    password: xray