0

I'm trying to restore a database dump from Render locally which worked fine in the past. But now I get lots of errors.

$ PGPASSWORD="###" pg_dump -h ###.render.com -O -U app_production app_production >dump.sql
$ psql -U app_production -f dump.sql app_production

The errors usually start when the indexes are recreated:

(...)
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
ERROR:  could not open file "base/16388/18035": No such file or directory
CONTEXT:  writing block 0 of relation base/16388/18035
parallel worker
ERROR:  could not open file "base/16388/18035": No such file or directory
CONTEXT:  writing block 1 of relation base/16388/18035
ERROR:  could not open file "base/16388/18035": No such file or directory
CONTEXT:  writing block 2 of relation base/16388/18035
ERROR:  could not open file "base/16388/18035": No such file or directory
CONTEXT:  writing block 3 of relation base/16388/18035
(...)

I have reinstalled everything on my local (macOS Ventura) machine, all of Homebrew, PostgreSQL etc. Tried different dumps as well, which results sometimes in a few, sometimes in lots of such errors.

Any idea what's going on here?

Thanks a lot for your hints!

svoop
  • 3,318
  • 1
  • 23
  • 41

1 Answers1

0

I figured it out: Apparently, in a comments table, someone posted a text which contains the base64 encoded signature of a macOS malware. ClamAV recognizes this and quarantines the database file during import (for some reason, notifications were off). When the import rebuilds the indexes, this database inconsistency causes the errors.

svoop
  • 3,318
  • 1
  • 23
  • 41