# Postgres failing to update?

**URL:** https://meta.discourse.org/t/postgres-failing-to-update/93412
**Category:** Self-hosting
**Created:** [7월 29, 2018, 2:31오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412 "2018-07-29T14:31:01Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 2:31오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/1 "2018-07-29T14:31:01Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7월 29, 2018, 7:16오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/2 "2018-07-29T19:16:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 7:40오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/3 "2018-07-29T19:40:41Z")

</div>

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:~#

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7월 29, 2018, 7:42오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/4 "2018-07-29T19:42:50Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 7:46오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/5 "2018-07-29T19:46:28Z")

</div>

> [@codinghorror](#):
>
> permissions messed up

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`

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 8:02오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/6 "2018-07-29T20:02:13Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7월 29, 2018, 8:08오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/7 "2018-07-29T20:08:09Z")

</div>

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/](https://www.literatecomputing.com/)

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 8:11오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/8 "2018-07-29T20:11:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [7월 29, 2018, 8:22오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/9 "2018-07-29T20:22:21Z")

</div>

> [@vicatcu](#):
>
> in order to get a discourse backup extracted though, right?

ouch, no copy off-site?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7월 29, 2018, 8:32오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/10 "2018-07-29T20:32:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [7월 29, 2018, 9:07오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/11 "2018-07-29T21:07:50Z")

</div>

> [@vicatcu](#):
>
> Seems like I need to get docker running in order to get a discourse backup extracted though

Any existing backups should exist on the host machine under (assuming a [standard install](https://meta.discourse.org/t/142537?silent=true)):

```plaintext
/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.

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 9:12오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/12 "2018-07-29T21:12:46Z")

</div>

OK I’ve spun up a new instance and installed docker following [these instructions](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04).

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)

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 9:24오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/13 "2018-07-29T21:24:15Z")

</div>

> [@david](#):
>
> /var/discourse/shared/standalone/backups/default

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?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [7월 29, 2018, 9:24오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/14 "2018-07-29T21:24:54Z")

</div>

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)

```plaintext
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”:

> [@Move your Discourse Instance to a Different Server](https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721):
>
> bookmark This is a guide for moving your Discourse instance from one server to another, including all settings and data. This guide applies to self-hosted Discourse instances using Docker. person_raising_hand Required user level: System Administrator warning This procedure involves domain and DNS changes. Ensure you have access to both the source and destination servers. This guide walks you through the process of migrating your Discourse instance from one server to another, ensuring …

---

<div class="post-metadata">

### Author: ![vicatcu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vicatcu/32/116471_2.png) [@vicatcu](https://meta.discourse.org/u/vicatcu)
#### Post date: [7월 29, 2018, 10:01오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/15 "2018-07-29T22:01:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [7월 30, 2018, 5:00오후 UTC](https://meta.discourse.org/t/postgres-failing-to-update/93412/16 "2018-07-30T17:00:08Z")

</div>

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