# Why does install hang on background saving?

**URL:** https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017
**Category:** Self-hosting
**Created:** [September 13, 2014, 4:06am UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017 "2014-09-13T04:06:20Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![flexihack](https://avatars.discourse-cdn.com/v4/letter/f/9dc877/32.png) [@flexihack](https://meta.discourse.org/u/flexihack)
#### Post date: [September 13, 2014, 4:06am UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/1 "2014-09-13T04:06:20Z")

</div>

I recently installed Discourse on DigitalOcean (1GB CPU) and then when I try to rebuild the site it takes about 15 minutes (not even complete yet). It’s currently on something like “Background saving terminate with success”

---

<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: [September 13, 2014, 4:42am UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/2 "2014-09-13T04:42:36Z")

</div>

It takes around 8 minutes the last time I checked. The delay is that’s how long Rails pipeline takes to compile assets.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 13, 2014, 4:49am UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/3 "2014-09-13T04:49:39Z")

</div>

> [@codinghorror](#):
>
> It takes around 8 minutes the last time I checked. The delay is that’s how long Rails pipeline takes to compile assets.

Note, Btrfs is going to knock off 1-3 minutes of this process

> **[Btrfs](https://en.wikipedia.org/wiki/Btrfs)**
>
> Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or "B.T.R.F.S.") is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (distinct from Linux's LVM), developed together. It was created by Chris Mason in 2007 for use in Linux, and since November 2013, the file system's on-disk format has been declared stable in the Linux kernel.
> Btrfs is intended to address the lack of pooling, snapshots, integrity checking...

---

<div class="post-metadata">

### Author: ![michael\_cgla](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@michael\_cgla](https://meta.discourse.org/u/michael_cgla)
#### Post date: [October 8, 2014, 12:13pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/4 "2014-10-08T12:13:42Z")

</div>

It’s taking me much longer too unfortunately. I’m using a 1GB DigitalOcean box, and the last message was 24 minutes ago. It reads:

```
[181] 08 Oct 11:49:32.263 * Background saving terminated with success

```

---

<div class="post-metadata">

### Author: ![michael\_cgla](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@michael\_cgla](https://meta.discourse.org/u/michael_cgla)
#### Post date: [October 8, 2014, 12:35pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/5 "2014-10-08T12:35:57Z")

</div>

Just FYI, I gave up, dropped the SSH connection, reconnected, tried stopping the app and rebuilding again, got an error message that postgres was already running, followed the instructions I found elsewhere on this forum to reboot, then did a rebuild again and it completed fine within about 3-4 mins.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [October 8, 2014, 12:56pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/6 "2014-10-08T12:56:50Z")

</div>

> [@michael\_cgla](#):
>
> Just FYI, I gave up, dropped the SSH connection, reconnected, tried stopping the app and rebuilding again, got an error message that postgres was already running, followed the instructions I found elsewhere on this forum to reboot, then did a rebuild again and it completed fine within about 3-4 mins.

This happened to me the other day as well when I was moving from the beta to tests-passed channel. Very “buggy” at least appears that way, and creates quite a bit of downtime when you have to make 2 or 3 attempts at it. Perhaps the messages could be more verbose so people know things are happening in the background?

**Update:** Was just upgrading to 14.04 LTS and the same thing happened as described above. Had just rebooted after upgrading the OS, and 20 minutes into the bootstrap process, it was hanging at `* Background saving terminated with success` for 10+ minutes. I rebooted, and tried to bootstrap again. This time it hung several minutes after updating /etc/nginx/conf.d/discourse.conf with SSL information. Another reboot and re-bootstrap, seemed to work, and only took a couple minutes. However when trying to start the app, I got:

> `2014/10/08 10:49:07 Error response from daemon: Cannot start container 45892ae9d79e85a30ec1b43d597aabc334257bced330972f3477b20a29f9c767: Cannot find child for /app`

Following [https://meta.discourse.org/t/error-response-from-daemon-cannot-start-container-hash-cannot-find-child-for-app/20685](https://meta.discourse.org/t/error-response-from-daemon-cannot-start-container-hash-cannot-find-child-for-app/20685) resolved that, and I’m finally back in business after an hour. 🙂

2GB box at DO.

---

<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: [October 8, 2014, 4:32pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/10 "2014-10-08T16:32:08Z")

</div>

No, this is incorrect. That issue has nothing to do with swap file, I see it a fair bit and every install we do has a swap file.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [October 8, 2014, 4:40pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/11 "2014-10-08T16:40:51Z")

</div>

Could it be related to SSL? I ran into this exact error quite a bit last week while I was troubleshooting problems with SSL.

---

<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: [October 12, 2014, 10:15pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/12 "2014-10-12T22:15:57Z")

</div>

FYI @sam recently fixed the issue where the installation would hang late in the process – apparently we were terminating Postgres incorrectly and this would lead to hangs/problems.

To get the new image, you need to log in, `git pull` at `/var/discourse` and rebuild.

---

<div class="post-metadata">

### Author: ![daneriksson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daneriksson/32/114835_2.png) [@daneriksson](https://meta.discourse.org/u/daneriksson)
#### Post date: [October 19, 2014, 4:50pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/13 "2014-10-19T16:50:02Z")

</div>

I am currently trying to upgrade from 1.1.0.beta4 to 1.1.0.beta6b and I’ve been stuck here for over an hour:

[http://cl.ly/image/3Q3n073F1x2N/Image%202014-10-19%20at%206.49.27%20em.png](http://cl.ly/image/3Q3n073F1x2N/Image%202014-10-19%20at%206.49.27%20em.png)

Should I keep on waiting or do something else?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [October 19, 2014, 4:58pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/14 "2014-10-19T16:58:39Z")

</div>

What does the `Processes` tab look like?

---

<div class="post-metadata">

### Author: ![daneriksson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daneriksson/32/114835_2.png) [@daneriksson](https://meta.discourse.org/u/daneriksson)
#### Post date: [October 19, 2014, 5:04pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/15 "2014-10-19T17:04:25Z")

</div>

Like this:

[http://cl.ly/image/1g3l3a0o3R0k/Image%202014-10-19%20at%207.02.58%20em.png](http://cl.ly/image/1g3l3a0o3R0k/Image%202014-10-19%20at%207.02.58%20em.png)

**Edit:**  
And now I can’t get back to follow the upgrade. It says:

[http://cl.ly/image/0s2C2G2e2P0U/Image%202014-10-19%20at%207.07.00%20em.png](http://cl.ly/image/0s2C2G2e2P0U/Image%202014-10-19%20at%207.07.00%20em.png)

And when clicking the “Currently upgrading” button it looks like this:

[http://cl.ly/image/3g1S0H213K1x/Image%202014-10-19%20at%207.07.32%20em.png](http://cl.ly/image/3g1S0H213K1x/Image%202014-10-19%20at%207.07.32%20em.png)

---

<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: [October 19, 2014, 6:59pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/16 "2014-10-19T18:59:59Z")

</div>

Reboot. Log in at console, then git pull and ./launcher rebuild app.

---

<div class="post-metadata">

### Author: ![daneriksson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daneriksson/32/114835_2.png) [@daneriksson](https://meta.discourse.org/u/daneriksson)
#### Post date: [October 19, 2014, 7:01pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/17 "2014-10-19T19:01:07Z")

</div>

I did that, and now everything is Okey. Thanks.

---

<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: [December 12, 2014, 9:38pm UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/18 "2014-12-12T21:38:18Z")

</div>

> [@sam](#):
>
> Note, Btrfs is going to knock off 1-3 minutes of this process

Not really seeing this on [discourse.codinghorror.com](http://discourse.codinghorror.com) though which is running btrfs – I always upgrade this site at the same time I upgrade [talk.commonmark.org](http://talk.commonmark.org) and if anything discourse.ch upgrades consistently _slower_.

---

<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: [February 21, 2015, 6:03am UTC](https://meta.discourse.org/t/why-does-install-hang-on-background-saving/20017/19 "2015-02-21T06:03:55Z")

</div>


