I'm experiencing issues running the dbrestore command on a remote server (EC2) while the dbbackup is running fine.
Locally, both dbbackup and dbrestore are working succesfully and I can't find why it behaves differently in a different environment.
root@cb84c9d64783:/app# python manage.py dbrestore
Finding latest backup
INFO:dbbackup.command:Finding latest backup
Restoring backup for database 'default' and server 'None'
INFO:dbbackup.command:Restoring backup for database 'default' and server 'None'
Restoring: default-cb84c9d64783-2021-08-06-184602.psql.bin
INFO:dbbackup.command:Restoring: default-cb84c9d64783-2021-08-06-184602.psql.bin
Restore tempfile created: 127.0 MiB
INFO:dbbackup.command:Restore tempfile created: 127.0 MiB
Are you sure you want to continue? [Y/n]
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbrestore.py", line 53, in handle
self._restore_backup()
File "/usr/local/lib/python3.8/site-packages/dbbackup/management/commands/dbrestore.py", line 94, in _restore_backup
self.connector.restore_dump(input_file)
File "/usr/local/lib/python3.8/site-packages/dbbackup/db/base.py", line 92, in restore_dump
result = self._restore_dump(dump)
File "/usr/local/lib/python3.8/site-packages/dbbackup/db/postgresql.py", line 125, in _restore_dump
stdout, stderr = self.run_command(cmd, stdin=dump, env=self.restore_env)
File "/usr/local/lib/python3.8/site-packages/dbbackup/db/postgresql.py", line 21, in run_command
return super(PgDumpConnector, self).run_command(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dbbackup/db/base.py", line 150, in run_command
raise exceptions.CommandConnectorError(
dbbackup.db.exceptions.CommandConnectorError: Error running: pg_restore --dbname=<x> --host=x-rds-proxy-x.eu-central-1.rds.amazonaws.com --port=5432 --user=<x> --no-password --single-transaction --clean
pg_restore: error: error returned by PQputCopyData: SSL connection has been closed unexpectedly
Bug Report
Describe the bug
I'm experiencing issues running the dbrestore command on a remote server (EC2) while the dbbackup is running fine.
Locally, both dbbackup and dbrestore are working succesfully and I can't find why it behaves differently in a different environment.
Screenshots or reproduction
Versions
Django-dbbackup
External tools
Any help appreciated