[BUG]: The initialization of the database does not work in version 0.25.1 and main
volodymyrpo opened this issue · comments
Describe the bug
On initial run, CascadeProjectDeleteAppCredentialsAndConnectionKey1710720610669
migration fails. The keys FK_03177dc6779e6e147866d43c050
and FK_d82bfb4c7432a69dc2419083a0e
already exist in the database at the time of migration.
To Reproduce
Steps to reproduce the behavior:
- Clear environment
- Run
node tools/setup-dev
- Run
docker-compose -f docker-compose.dev.yml up
- See error
Expected behavior
The application should have launched without any problems
Screenshots
Backend issue
Additional context
I couldn't find a clear description of which version is the most stable, so I decided to run tag 0.25.1
(ec0f149eadcca975420d563e028ed98e92c8c2b1
)
The same issue exists on main (8a7d9380a8e4128faafc9a706f3636704ee250e2
)
Stack trace:
[API] Migration "CascadeProjectDeleteAppCredentialsAndConnectionKey1710720610669" failed, error: constraint "FK_03177dc6779e6e147866d43c050" for relation "connection_key" already exists
[API] [16:23:55 UTC] ERROR: [Main#main]
[API] err: {
[API] "type": "QueryFailedError",
[API] "message": "constraint \"FK_03177dc6779e6e147866d43c050\" for relation \"connection_key\" already exists",
[API] "stack":
[API] QueryFailedError: constraint "FK_03177dc6779e6e147866d43c050" for relation "connection_key" already exists
[API] at PostgresQueryRunner.query (/usr/src/app/src/driver/postgres/PostgresQueryRunner.ts:331:19)
[API] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[API] "query": "\n ALTER TABLE \"connection_key\"\n ADD CONSTRAINT \"FK_03177dc6779e6e147866d43c050\" FOREIGN KEY (\"projectId\") REFERENCES \"project\"(\"id\")\n ON DELETE CASCADE ON UPDATE NO ACTION\n ",
[API] "driverError": {
[API] "type": "DatabaseError",
[API] "message": "constraint \"FK_03177dc6779e6e147866d43c050\" for relation \"connection_key\" already exists",
[API] "stack":
[API] error: constraint "FK_03177dc6779e6e147866d43c050" for relation "connection_key" already exists
[API] at /usr/src/app/node_modules/pg/lib/client.js:526:17
[API] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[API] at PostgresQueryRunner.query (/usr/src/app/src/driver/postgres/PostgresQueryRunner.ts:260:25)
[API] "length": 156,
[API] "name": "error",
[API] "severity": "ERROR",
[API] "code": "42710",
[API] "file": "tablecmds.c",
[API] "line": "8645",
[API] "routine": "ATExecAddConstraint"
[API] },
[API] "length": 156,
[API] "severity": "ERROR",
[API] "code": "42710",
[API] "file": "tablecmds.c",
[API] "line": "8645",
[API] "routine": "ATExecAddConstraint"
[API] }
Potentially this is just my problem. I expected docker-compose.dev.yml
to provide an environment for contributors, but it defaults to cloud.
Hi @volodymyrpo
That's correct, It's because using cloud edition for some reason in docker-compose.dev.yml
, this development mode will be deprecated soon, have you tried using dev containers?
I am closing this issue, Please reopen if the question is not answered.
⚠️ COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If this issue is continuing with the latest stable version of Activepieces, please open a new issue that references this one.