# Error "relation 'users' does not exist" when installing discourse

**URL:** <https://meta.discourse.org/t/error-relation-users-does-not-exist-when-installing-discourse/99246>\
**Category:** Self-hosting\
**Created:** [October 11, 2018, 4:33am UTC](https://meta.discourse.org/t/error-relation-users-does-not-exist-when-installing-discourse/99246 "2018-10-11T04:33:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![UnivacTwo](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@UnivacTwo](https://meta.discourse.org/u/UnivacTwo)\
**Post date:** [October 11, 2018, 4:33am UTC](https://meta.discourse.org/t/error-relation-users-does-not-exist-when-installing-discourse/99246/1 "2018-10-11T04:33:06Z")

</div>

Hello,

I am trying to install a new discourse on a clean server but I get this error:

```
I, [2018-10-11T04:28:17.965799 #14] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2018-10-11 04:28:24.160 UTC [365] discourse@discourse ERROR: relation "users" does not exist at character 566
2018-10-11 04:28:24.160 UTC [365] discourse@discourse STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                             pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                             c.collname, col_description(a.attrelid, a.attnum) AS comment
                        FROM pg_attribute a
                        LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                        LEFT JOIN pg_type t ON a.atttypid = t.oid
                        LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
                       WHERE a.attrelid = '"users"'::regclass
                         AND a.attnum > 0 AND NOT a.attisdropped
                       ORDER BY a.attnum

2018-10-11 04:28:35.564 UTC [374] discourse@discourse LOG: duration: 100.559 ms statement: ALTER TABLE "users" ADD "staged" boolean DEFAULT FALSE NOT NULL

```

This is definitely a bug, I tried on multiple servers with different OS versions.

Probably it is something with the current version of discourse

it alway end with this message error:

```
I, [2018-10-11T07:15:34.658740 #14] INFO -- : Terminating async processes
I, [2018-10-11T07:15:34.658882 #14] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 84
I, [2018-10-11T07:15:34.659052 #14] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 200
200:signal-handler (1539242134) Received SIGTERM scheduling shutdown...
2018-10-11 07:15:34.659 UTC [84] LOG: received fast shutdown request
2018-10-11 07:15:34.680 UTC [84] LOG: aborting any active transactions
2018-10-11 07:15:34.685 UTC [84] LOG: worker process: logical replication launcher (PID 93) exited with exit code 1
2018-10-11 07:15:34.688 UTC [88] LOG: shutting down
200:M 11 Oct 07:15:34.758 # User requested shutdown...
200:M 11 Oct 07:15:34.758 * Saving the final RDB snapshot before exiting.
200:M 11 Oct 07:15:34.787 * DB saved on disk
200:M 11 Oct 07:15:34.787 # Redis is now ready to exit, bye bye...
2018-10-11 07:15:34.873 UTC [84] LOG: database system is shut down

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 1429 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
6e330632df0aef58e54069e5041a77d3624c8f870d1a7939cb738df4b2c6adba
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

_[View the full topic](https://meta.discourse.org/t/error-relation-users-does-not-exist-when-installing-discourse/99246)._
