Problem after host shutdown new server. Cant start app


(Roland) #1

So I recently switched to a new server. I have multiple servers with them. The site was working fine and the host shut off the wrong server. When they tried to bring it back up I get a 502 error on the site.

I accessed the server and they said to try port 3000 to launch the app. I went into app.yml and changed the port to 3000 (maybe in wrong place?) and when I go to rebuild i get these errors.

LOG:  could not open configuration file "/etc/postgresql/9.5/main/pg_hba.conf": Permission denied
2017-08-19 15:52:13.733 UTC [44] FATAL:  could not load pg_hba.conf
I, [2017-08-19T15:52:18.547133 #15]  INFO -- :
I, [2017-08-19T15:52:18.547828 #15]  INFO -- : > su postgres -c 'createdb discourse' || true
createdb: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2017-08-19T15:52:18.634427 #15]  INFO -- :
I, [2017-08-19T15:52:18.634701 #15]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2017-08-19T15:52:18.715596 #15]  INFO -- :
I, [2017-08-19T15:52:18.715966 #15]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2017-08-19T15:52:18.779628 #15]  INFO -- :
I, [2017-08-19T15:52:18.780018 #15]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2017-08-19T15:52:18.843265 #15]  INFO -- :
I, [2017-08-19T15:52:18.844098 #15]  INFO -- : Terminating async processes


FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 70 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
15a5b5711ba8a90c848d928552e957e3a44ee6ca51b915c605ba65a34507205f
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Any idea what the cause would be?


(Jay Pfaffman) #2

You don’t want port 3000 if you followed the install cloud instructions.

You might try changing it back and

./launcher bootstrap app

(Roland) #3

Thanks. Yes I followed the instructions exactly. I just tried that and failed with same results.


(Roland) #4

anyone have another option? Searching and trying everything i can find but no luck. same errors.


(Eli the Bearded) #5

Is that the complete log of problems? I suspect there is more before that excerpt, but even there, this bit stands out as bad:

LOG:  could not open configuration file "/etc/postgresql/9.5/main/pg_hba.conf": Permission denied
2017-08-19 15:52:13.733 UTC [44] FATAL:  could not load pg_hba.conf

That file should exist and be owned and readable by the postgres user. Without it, nothing connects to your postgres database: createdb: could not connect to database

You say there was an inadvertant shutdown of the server. Sometimes that can cause filesystem problems. Did you have fsck troubles on startup? Are there a bunch of filesystem or fsck entries in the system logs (in /var/log/)? Is /lost+found empty? A bunch of files in /lost+found is a sure sign that you have had filesystem issues in the past and should strongly consider a restore from backup.


(Roland) #6

Yes thank you. There was a shutdown unexpectedly by the host and they messed it all up. Including deleting my backups while trying to restore them. Everytime they did something they messed it more and more. Ive since gone back to a more reliable hosting provider after that.