# PostgreSQL Error While Rebuilding

**URL:** <https://meta.discourse.org/t/postgresql-error-while-rebuilding/157830>\
**Category:** Self-hosting\
**Created:** [July 15, 2020, 4:34pm UTC](https://meta.discourse.org/t/postgresql-error-while-rebuilding/157830 "2020-07-15T16:34:25Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [July 15, 2020, 5:18pm UTC](https://meta.discourse.org/t/postgresql-error-while-rebuilding/157830/9 "2020-07-15T17:18:37Z")

</div>

~~It looks like this didn’t do it. I’ve got that commit and I still get:~~

Oh. I might be confused.

```plaintext
I, [2020-07-15T17:11:53.608333 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/12/bin/postmaster -D /etc/postgresql/12/main
I, [2020-07-15T17:11:53.610211 #1] INFO -- : > sleep 5
2020-07-15 17:11:53.641 GMT [49] LOG: syntax error in file "/etc/postgresql/12/main/postgresql.conf" line 193, near token "$" 
2020-07-15 17:11:53.642 GMT [49] LOG: syntax error in file "/etc/postgresql/12/main/postgresql.conf" line 286, near token "$"
2020-07-15 17:11:53.643 GMT [49] FATAL: configuration file "/etc/postgresql/12/main/postgresql.conf" contains errors
I, [2020-07-15T17:11:58.619578 #1] INFO -- :
I, [2020-07-15T17:11:58.619911 #1] INFO -- : > su postgres -c 'createdb discourse' || true
Error: invalid line 193 in /etc/postgresql/12/main/postgresql.conf: wal_level = $db_wal_level
I, [2020-07-15T17:11:58.700776 #1] INFO -- :
I, [2020-07-15T17:11:58.701730 #1] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
Error: invalid line 193 in /etc/postgresql/12/main/postgresql.conf: wal_level = $db_wal_level
I, [2020-07-15T17:11:58.775094 #1] INFO -- :
I, [2020-07-15T17:11:58.776049 #1] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
Error: invalid line 193 in /etc/postgresql/12/main/postgresql.conf: wal_level = $db_wal_level
I, [2020-07-15T17:11:58.847143 #1] INFO -- :
I, [2020-07-15T17:11:58.848265 #1] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
Error: invalid line 193 in /etc/postgresql/12/main/postgresql.conf: wal_level = $db_wal_level
I, [2020-07-15T17:11:58.918991 #1] INFO -- :
I, [2020-07-15T17:11:58.920088 #1] INFO -- : Terminating async processes

```

But it looks like that got merged and

> <https://github.com/discourse/discourse_docker/blob/master/templates/postgres.template.yml#L174-L177>

needs to have `$db_wal_level` defined.

---

_[View the full topic](https://meta.discourse.org/t/postgresql-error-while-rebuilding/157830)._
