2 months ago
App cannot connect to Postgres - fd12:77a:c120:1:2000:c1:b516:247f:5432
deployment for product-catalog- in grand-emotioncrashed within the production environment.
13 Replies
2 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • about 2 months ago
2 months ago
Can you share error logs?
2 months ago
Hi,
see below, please help
2 months ago
I found the following errors in your logs that are most likely causing this issue:ERROR: could not create unique index Key (document_number, line_item_sku)=(0613386, 82621J-AB-PINK-L) is duplicated.
This error occurs when you try to run a migration to add a unique index on a table that already has duplicates, so postgres blocks it. because you can't enforce uniqueness on a table that already has duplicates. You have to delete the duplicate rows before you can create the index.ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification
This requires a unique Index or constraint to work. Because the index creation failed, this one fails as well.
Now you should remove the duplicate rows for document_number + line_item_sku , and run the CREATE UNIQUE INDEX command again.And redeploy your service.
2 months ago
2 months ago
The error hasn't changed. You are still getting the duplicate data error. Specifically, the pair (0603677, 84670J-AE-GREY-S) appears more than once in your table.
2 months ago
cleaned up the duplicates
{success: true, duplicatesFound: 0, rowsDeleted: 0, message: 'Fixed 0 duplicate rows and recreated unique index'}
but Database tab UI is stuck on "Attempting to connect" even though the database is working fine.
what should I do?
2 months ago
Is your app connecting to the db now? UI might be just stuck on "Attempting to connect", so try to redeploy and see if it persists.
2 months ago
yes and its working , I tried to restart and redeploy doesn't clear the issue, still says attempting to connect. what do you think is happening?
2 months ago
Well, good thing it's working now. Can you share an image so I can see?
2 months ago
The logs in your screenshot show checkpoint complete messages only now, which is good. Checkpoints happen when the database is running and managing data on disk. So there is no issue there.
"Attempting to connect" message is a harmless UI glitch in the dashboard most likely, not a database failure. It should be resolved on its own. So I wouldn't worry about it as long as your app is connecting to the db, and working as expected.
2 months ago
oh okay, good to know. Hopefully it does resolve itself, thx
2 months ago
You're welcome