# DB backup config error

**URL:** <https://meta.discourse.org/t/db-backup-config-error/100604>\
**Category:** Self-hosting\
**Created:** [October 27, 2018, 4:49am UTC](https://meta.discourse.org/t/db-backup-config-error/100604 "2018-10-27T04:49:43Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![netpositive](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@netpositive](https://meta.discourse.org/u/netpositive)\
**Post date:** [October 27, 2018, 4:49am UTC](https://meta.discourse.org/t/db-backup-config-error/100604/1 "2018-10-27T04:49:44Z")

</div>

I upgraded Discourse to latest stable version with complete rebuild yesterday. I’ve got this strange error this morning:

```plaintext
[2018-10-27 04:21:44] 'netpositive' has started the backup! 
[2018-10-27 04:21:44] Marking backup as running... 
[2018-10-27 04:21:44] Making sure '/var/www/discourse/tmp/backups/default/2018-10-27-042144' exists... 
[2018-10-27 04:21:44] Making sure '/var/www/discourse/public/backups/default' exists... 
[2018-10-27 04:21:44] Pausing sidekiq... 
[2018-10-27 04:21:44] Waiting for sidekiq to finish running jobs... 
[2018-10-27 04:21:44] Dumping the public schema of the database... 
[2018-10-27 04:21:44] pg_dump: [archiver (db)] connection to database "discourse" failed: could not connect to server: Connection refused 
[2018-10-27 04:21:44] Is the server running on host "172.17.0.1" and accepting 
[2018-10-27 04:21:44] TCP/IP connections on port 5432? 
[2018-10-27 04:21:44] EXCEPTION: pg_dump failed 
[2018-10-27 04:21:44]
 /var/www/discourse/lib/backup_restore/backuper.rb:172:in `dump_public_schema'
 /var/www/discourse/lib/backup_restore/backuper.rb:37:in `run'
 /var/www/discourse/lib/backup_restore/backup_restore.rb:167:in `block in start!'
 /var/www/discourse/lib/backup_restore/backup_restore.rb:164:in `fork'
 /var/www/discourse/lib/backup_restore/backup_restore.rb:164:in `start!'
 /var/www/discourse/lib/backup_restore/backup_restore.rb:18:in `backup!'
 /var/www/discourse/app/controllers/admin/backups_controller.rb:32:in `create'
[2018-10-27 04:21:44] Notifying 'netpositive' of the end of the backup... 
[2018-10-27 04:21:53] Removing old backups...

```

The postgresql 9.6 server is running outside the container and it’s accessible on port 5433. If I manually run the pg\_dump command inside the container then it works flawlessly and I haven’t detected any other DB related issue in Discourse.

Any idea why does it take wrong config settings? 😕

Thanks a lot!

---

_[View the full topic](https://meta.discourse.org/t/db-backup-config-error/100604)._
