# Backup restore failing on clean dev docker env: FATAL: Peer authentication failed for user “postgres”

**URL:** <https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170>\
**Category:** Bug\
**Tags:** pr-welcome, dev-install\
**Created:** [November 3, 2021, 9:22pm UTC](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170 "2021-11-03T21:22:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)\
**Post date:** [April 4, 2024, 7:57pm UTC](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170/13 "2024-04-04T19:57:49Z")

</div>

This works for me:

[https://github.com/discourse/discourse/pull/26521](https://github.com/discourse/discourse/pull/26521)

But there are several other ways to fix this to choose from:

- add env setting `USER=discourse` to the docker boot image

- add `-e USER=discourse \` to `d\exec`

- add this to `backup_restore.rb`

In addition, there is a new problem when executing `d/discourse` in the docker dev environment:

```shell
$ d/discourse backup
<internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require': cannot load such file -- thor (LoadError)
        from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from script/discourse:4:in `<main>'

```

while `d/bundle exec script/discourse backup` works (see [patch](https://github.com/discourse/discourse/compare/main...thoka:discourse:fix-backup-on-dev-install2)).

---

_[View the full topic](https://meta.discourse.org/t/backup-restore-failing-on-clean-dev-docker-env-fatal-peer-authentication-failed-for-user-postgres/208170)._
