During an upgrade, when applying a backup to a fresh install of Domino 5.1 via the data importer (with postgres data), it failed with below error message,
Running postgres migration...
Backing up local postgres db to /opt/scratch/postgres/postgres_archive_local-backup_20220413-233813.gz...
Running: ['pg_dump', '-h', 'postgresql', '-U', 'postgres', '-Z', '9', 'keycloak'], piping to /opt/scratch/dev-postgres.sql
Dropping and recreating 'keycloak' database...
Sending UPDATE pg_database SET datallowconn = 'false' WHERE datname = 'keycloak' to postgres...
UPDATE 1
Sending SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'keycloak' to postgres...
pg_terminate_backend
---------------------- t
(1 row)
Sending DROP DATABASE keycloak to postgres...
DROP DATABASE
Sending CREATE DATABASE keycloak to postgres...
CREATE DATABASE
Restoring postgres from /opt/scratch/dev-postgres.sql...
Sending file data to postgres...
Traceback (most recent call last):
File "src/importer/importer", line 275, in <module>
main()
File "src/importer/importer", line 40, in main
Importer().process_all()
File "src/importer/importer", line 269, in process_all
[q.migrate() for q in queue]
File "src/importer/importer", line 269, in <listcomp>
[q.migrate() for q in queue]
File "/app/src/importer/import_workers/postgres.py", line 96, in migrate
self.psql_cmds(stdin=f, db="keycloak", encoding=None)
File "/app/src/importer/import_workers/postgres.py", line 143, in psql_cmds
raise WorkerException(f"Command [{psql_cmd}] exited with {p.returncode}: {p.stderr}")
importer.import_workers.WorkerException: Command [['psql', '-h', 'postgresql', '-U', 'postgres', '-d', 'keycloak']] exited with 0: b'invalid command \\@\xc2\x198\xb4\ninvalid command
Cause and remediation: The customer had renamed the backup.sql.gz file, and removed the .gz extension. The .gz extension is REQUIRED for the importer to work properly.
If the ".gz" extension is not present, the Domino code skips the "gunzip" step entirely when attempting to extract the files.
In this case, it was trying to import the encoded, gzipped file instead of the unzipped backup it needed. Renaming the backup to include .gz extension solved the problem.
Comments
0 comments
Please sign in to leave a comment.