Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_dump: warning: there are circular foreign-key constraints on this table #12

Closed
ventsislavnikolov opened this issue Nov 29, 2023 · 5 comments

Comments

@ventsislavnikolov
Copy link

Hello, 2 day ago I made everything by the tutorial but it gives me this error and doesnt create backup:

`containers-us-west-22.railway.app:8007 - accepting connections

pg_dump (PostgreSQL) 16.1

NodeJS Version: v18.18.2

Backup cron scheduled...

Initiating DB backup...

Dumping DB to file...

Error while running backup: {

stderr: 'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: hypertable\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.\n' +

'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: chunk\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.'

}

Initiating DB backup...

Dumping DB to file...

Error while running backup: {

stderr: 'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: hypertable\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.\n' +

'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: chunk\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.'

}`

I have env variables:
image

Did I miss something? Can somebody help?

Thanks!

@mbrookson
Copy link

mbrookson commented Nov 29, 2023

Just came to report the same issue.

Seeing this every hour and backups are no longer working. I think it's started happening since upgrading my Postgres instance from the legacy plugin architecture to the new Railway database with volume setup. Not sure what's changed under the hood to cause it.

I found a related issue here on the timescale db repo. Some comments suggest it's just a warning but it seems to me this is an error that prevents backups working?

Error while running backup:  {

stderr: 'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: hypertable\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.\n' +

'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: chunk\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.\n' +

'pg_dump: warning: there are circular foreign-key constraints on this table:\n' +

'pg_dump: detail: continuous_agg\n' +

'pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.\n' +

'pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.'

}

image

@ventsislavnikolov
Copy link
Author

I think I found my problem, my data is corrupted or have some problems between relations on Strapi. I think this still make some backup but dunno if backup everything.

@RyanElder
Copy link

The latest update to the repo added in a check that fails if there are any warnings from pg_dump, rather than just errors. This means that backups that were previously running well will now fail. If you comment out lines 47-50 in backup.ts and redeploy it to Railway, then the backups should run just fine. However, I would make sure to test out restoring your DB backup once you do so to make sure that the warnings aren't a deeper issue that will prevent you from restoring them in the future.

@rkm3
Copy link

rkm3 commented Dec 5, 2023

Same problem here. Will try @RyanElder's suggestion.

@brody192
Copy link
Contributor

brody192 commented Jan 3, 2024

fixed in #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants