Deployment Method
Describe the problem*
pg_dump: error: connection to database "inventree" failed: could not connect to server: Connection timed out
Is the server running on host "172.17.0.3" and accepting
TCP/IP connections on port 5432?
Steps to Reproduce
- Added in pg_hba.conf the following
host all all 172.50.0.0/16 trust
host all all 172.50.0.2/16 trust
host all all 172.26.0.0/16 trust
host all all 172.19.0.0/16 trust
- ran "docker restart postgresql"
- Followed steps here https://docs.inventree.org/en/latest/start/docker_prod/
Relevant log output
Backing up InvenTree database...
Backing Up Database: inventree
CommandConnectorError: Error running: pg_dump --dbname=postgresql://inventree_user:**********@172.17.0.3:5432/inventree --format=custom
pg_dump: error: connection to database "inventree" failed: could not connect to server: Connection timed out
Is the server running on host "172.17.0.3" and accepting
TCP/IP connections on port 5432?
File "/root/.local/lib/python3.9/site-packages/dbbackup/utils.py", line 120, in wrapper
func(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/dbbackup/management/commands/dbbackup.py", line 93, in handle
self._save_new_backup(database)
File "/root/.local/lib/python3.9/site-packages/dbbackup/management/commands/dbbackup.py", line 106, in _save_new_backup
outputfile = self.connector.create_dump()
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/base.py", line 92, in create_dump
return self._create_dump()
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/postgresql.py", line 112, in _create_dump
stdout, stderr = self.run_command(cmd, env=self.dump_env)
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/base.py", line 171, in run_command
raise exceptions.CommandConnectorError(
Traceback (most recent call last):
File "/home/inventree/InvenTree/manage.py", line 23, in <module>
execute_from_command_line(sys.argv)
File "/root/.local/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/root/.local/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/.local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/root/.local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/root/.local/lib/python3.9/site-packages/dbbackup/utils.py", line 120, in wrapper
func(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/dbbackup/management/commands/dbbackup.py", line 93, in handle
self._save_new_backup(database)
File "/root/.local/lib/python3.9/site-packages/dbbackup/management/commands/dbbackup.py", line 106, in _save_new_backup
outputfile = self.connector.create_dump()
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/base.py", line 92, in create_dump
return self._create_dump()
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/postgresql.py", line 112, in _create_dump
stdout, stderr = self.run_command(cmd, env=self.dump_env)
File "/root/.local/lib/python3.9/site-packages/dbbackup/db/base.py", line 171, in run_command
raise exceptions.CommandConnectorError(
dbbackup.db.exceptions.CommandConnectorError: Error running: pg_dump --dbname=postgresql://inventree_user:**********@172.17.0.3:5432/inventree --format=custom
pg_dump: error: connection to database "inventree" failed: could not connect to server: Connection timed out
Is the server running on host "172.17.0.3" and accepting
TCP/IP connections on port 5432?