# Can't rebuild due to failed postgres 12 upgrade

**URL:** <https://meta.discourse.org/t/cant-rebuild-due-to-failed-postgres-12-upgrade/157428>\
**Category:** Self-hosting\
**Created:** [11 juli 2020 om 01:43 UTC](https://meta.discourse.org/t/cant-rebuild-due-to-failed-postgres-12-upgrade/157428 "2020-07-11T01:43:47Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)\
**Post date:** [13 juli 2020 om 14:39 UTC](https://meta.discourse.org/t/cant-rebuild-due-to-failed-postgres-12-upgrade/157428/34 "2020-07-13T14:39:24Z")

</div>

I think @pfaffman means that because your are using a reverse proxy (nginx), the script `discourse-setup` might not work (I have never run discourse with a reverse proxy, so I don’t know if this is the case). If you define the `app.yml` correctly it should be fine too, without running `discourse-setup`.

> [@pr0cesor](#):
>
> ```plaintext
> I, [2020-07-13T13:34:21.809170 #1] INFO -- : > chown -R root /var/lib/postgresql/10/main
> chown: cannot access '/var/lib/postgresql/10/main': No such file or directory
> 
> ```

This seems like it’s trying to execute this code in a container that doesn’t have postgres 10 (you are probably using the version 12). If this is what you want, and your template is `templates/postgres.template.yml` as defined in your first post, maybe the `discourse_docker` repository in your machine (at `/var/discourse`) is outdated.

Is your installed discourse recent or old? It may fix that problem if you update the repository:

```
cd /var/discourse
git pull

```

and then run the rebuild step.

Also make sure that the discourse container is destroyed and recreated (and not only stopped and started), to not use an old container (I think the discourse rebuild should already do that, but just in case…).

If it doesn’t work and you have a backup, it is advisable to try to install in a fresh new instance as @Benjamin_D said.

---

_[View the full topic](https://meta.discourse.org/t/cant-rebuild-due-to-failed-postgres-12-upgrade/157428)._
