Postgres failing to update?

I’m getting this during ./launcher rebuild app:

I, [2018-07-29T14:29:05.072061 #14]  INFO -- : > /root/upgrade_postgres

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
dpkg-preconfigure: unable to re-open stdin: 
mv: cannot move '/shared/postgres_data' to '/shared/postgres_data_old/postgres_data': Directory not empty
mv: cannot move '/shared/postgres_data_new' to '/shared/postgres_data/postgres_data_new': Directory not empty
I, [2018-07-29T14:29:26.085017 #14]  INFO -- : Upgrading PostgreSQL from version 9.5 to 10
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

How do I address this? My site is giving 502 errors presently.

Are you out of disk space or are file permissions messed up?

Hey I’m fighting my way through it, I think I’m going to start a new thread that is less specific. What command results can I provide to get a good start on diagnostic inputs people here to be able to help? I’m pretty confident that I don’t have a disk space issue or a RAM issue - I’m on a 50GB droplet with 2GB of RAM.

Basically, I had a DO droplet running Ubuntu 14.04 and I’m just trying to get it to 16.04 and bring the discourse instance back to life afterwards and I’m having a heck of a time with it. Currently I’m getting this, which feels like a blocking problem for me that I don’t understand:

root@discuss:~# service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Sun 2018-07-29 15:38:47 EDT; 1min 4s ago
     Docs: https://docs.docker.com
  Process: 1356 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 1356 (code=exited, status=1/FAILURE)

Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: Failed to start Docker Application Container Engine.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: docker.service: Unit entered failed state.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: Stopped Docker Application Container Engine.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: docker.service: Start request repeated too quickly.
Jul 29 15:38:47 discuss.ithacagenerator.org systemd[1]: Failed to start Docker Application Container Engine.
root@discuss:~#

This has nothing to do with Discourse proper, it looks like you need to remove and reinstall Docker.

Also why would you upgrade 16.04 instead of 18.04 the current version?

1 Like

Jeff, Digital Ocean mirrors haven’t made 18.04 ready for do-release-update yet. I tried reinstalling docker using:

wget -qO- https://get.docker.com/ | sh

… and then rebooting, I don’t know why the service is failing to start after doing so, though.

Maybe I didn’t remove it properly first, any pointers on how to remove and reinstall docker properly?

Right now docker --version says: Docker version 18.06.0-ce, build 0ffa825

1 Like

@codinghorror in case it garners any sympathy from you, I voluntarily maintain this droplet for my local non-profit makerspace … I normally can get through this sort of thing with enough Google Fu, but I’m pretty stuck on this one and really appreciate any help. I’m going to try updating ubuntu to 18.04 using the do-release-upgrade -d I can always get back by restoring the snapshot i’m working from if necessary.

It seems the problems you are running into are OS upgrade issues? Docker isn’t running. If you have a Discourse backup available I recommend creating a new droplet and restoring the backup to a brand new droplet that is already the “current” version of Ubuntu, maybe?

You could try contacting Jay at https://www.literatecomputing.com/

Seems like I need to get docker running in order to get a discourse backup extracted though, right?

ouch, no copy off-site?

Not really – you can download the docker image and then move the docker image to a new machine where docker is functioning properly, and boot up the docker image there.

Any existing backups should exist on the host machine under (assuming a standard install):

/var/discourse/shared/standalone/backups/default

If you download the most recent one (e.g. using SCP), then you can easily restore it to a new discourse installation.

3 Likes

OK I’ve spun up a new instance and installed docker following these instructions.

Which files are “the docker image” so I can transfer it with its data to the new server? (that feels like such a dumb question, but there it is)

Oh ok, so I have a tar.gz there from Jul 27 23:32, which is totally reasonable for me to use… can you point me at instructions for restoring it to a new discourse installation?

To copy the backup to the current folder on your local computer, the command would look something like this: (replace your server domain name, and the name of the backup file)

scp root@myforum.com:/var/discourse/shared/standalone/backups/default/backup-2018-07-29-033126-v20180621013807.tar.gz .

Once that’s done, follow these instructions starting from “Log In and Restore Backup”:

3 Likes

Thanks so much, that worked! My site is back up and running.

5 Likes

This topic was automatically closed after 18 hours. New replies are no longer allowed.