coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
32.07k stars 1.66k forks source link

[Bug]: Duplicate Table Error During Migration in Coolify Deployment | latest working Version 4.0.0-beta.323 #3618

Open Procuria opened 7 hours ago

Procuria commented 7 hours ago

Error Message and Logs

I encountered an issue while deploying Coolify, where the process fails due to a duplicate table error during the migration step. Below are the details and error logs:

Docker Logs coolify container:

SSL_MODE has been DISABLED, setting the web server to work in HTTP only...
ERROR The [public/storage] link already exists.
INFO Running migrations.
...
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "telescope_entries" already exists 
(Connection: pgsql, SQL: create table "telescope_entries" ("sequence" bigserial not null primary key, "uuid" uuid not null, 
"batch_id" uuid not null, "family_hash" varchar(255) null, "should_display_on_index" boolean not null default '1', 
"type" varchar(20) not null, "content" text not null, "created_at" timestamp(0) without time zone null))

In Connection.php line 825:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "telescope_entries" already exists

Docker Logs postgres container:

2024-09-28 15:39:08.587 UTC [197] ERROR: current transaction is aborted, commands ignored until end of transaction block
2024-09-28 15:39:15.657 UTC [205] ERROR: relation "telescope_entries" already exists

Steps to Reproduce

  1. Deploy Coolify using the current configuration.
  2. Observe the migration process failing with the above errors.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.323

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04.4

Additional Information

Expected Behavior: The migration process should handle existing tables gracefully and complete without errors.

Actual Behavior: The deployment fails due to a duplicate table error, specifically related to the "telescope_entries" table already existing.

Possible Cause: It seems like the migration script attempts to create a table that already exists in the database, causing the deployment to fail.

If there are any configurations or steps I can adjust to mitigate this issue, please let me know.

andrasbacsai commented 6 hours ago

Did you ever installed a non-released version (next)? Because it looks like you did.

There is only one migration available that looks good and I cannot reproduce this issue.

Procuria commented 6 hours ago

@andrasbacsai Thank you very much for the fast reply! I think I once installed a next version — but I thought that should not be an issue, as I'm using a DB backup from before. But I'm not completely certain about that. Would you be so kind to elaborate on what gave you that clue regarding the non-released version? What do you mean by “There is only one migration available that looks good”? What would you suggest doing, in order having an upgradable instance again?