# Problem when updating Discourse Forum

**URL:** https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [June 25, 2023, 3:26pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562 "2023-06-25T15:26:28Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 3:26pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/1 "2023-06-25T15:26:28Z")

</div>

![iShot_2023-06-25_17.18.20](https://global.discourse-cdn.com/meta/original/4X/f/5/7/f577ddae7962ebd3b8ff10cf6f1b99f762168f4d.png)  
Hello everyone!  
I was trying to update the discourse forum using the link posted in admin panel and i got this error. The whole forum just gone. What should i do now to reset the update? Thanks a lot if anyone could help me. 😭

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [June 25, 2023, 3:33pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/2 "2023-06-25T15:33:47Z")

</div>

In fact it means that your forum is being updated. - unless you interrupt the update before it finishes.

Try visiting your forum `https://yoursite.com/latest.json`. If it returns something, then wait 10 minutes and see if the problem resolves itself

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 3:50pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/3 "2023-06-25T15:50:14Z")

</div>

Thanks for your reply, I tried the method you gave and it returns 502 Bad Gateway nginx.

---

<div class="post-metadata">

### Author: ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)
#### Post date: [June 25, 2023, 3:51pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/4 "2023-06-25T15:51:51Z")

</div>

It looks like you may have to `./launcher rebuild app`

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 4:15pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/5 "2023-06-25T16:15:29Z")

</div>

I tried the ./launcher rebuild app and i got following error messages:

```plaintext
FAILED

--------------------

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' failed with return #<Process::Status: pid 340 exit 5>

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 --retry 3 --jobs 4 --verbose --without test development'"]}

6e9e60bd6b6113cdcb001127fd2a24fe86f2a1658bf24500e5e2b720fd793510

**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.

./discourse-doctor may help diagnose the problem.

```

and i scrolled up and found some possible errors logs:

```plaintext
1)200:M 25 Jun 2023 16:00:16.252 # Failed listening on port 6379 (TCP), aborting.

2)[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag

[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'test development'`, and stop using this flag

3)Bundler::PathError: The path `/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/sprockets-f4d3dae71ef2` does not exist.

4)Bundler::InstallError: sass-embedded-1.63.6-x86_64-linux requires rubygems version >= 3.3.22, which is incompatible with the current version, 3.2.18

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 25, 2023, 5:44pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/6 "2023-06-25T17:44:26Z")

</div>

Someone else encountered a similar issue recently if this is any help?

> [@Long pause in standard installation of command : cd /var/www/discourse && su discourse -c 'bundle install --retry 3 --jobs 4'](https://meta.discourse.org/t/long-pause-in-standard-installation-of-command-cd-var-www-discourse-su-discourse-c-bundle-install-retry-3-jobs-4/267142):
>
> hello guys! i am a new user of discourse from china ,and i meet a strange issue in standard installation after execute the command ./discourse-setup, my terminal stuttered on command for a long time ( more than 20 minutes) I, [2023-06-04T07:47:29.161469 #1] INFO -- : \> cd /var/www/discourse && su discourse -c 'bundle config --local deployment true' I, [2023-06-04T07:47:29.544117 #1] INFO -- : I, [2023-06-04T07:47:29.544260 #1] INFO -- : \> cd /var/www/discourse && su discourse -c 'bundle co…

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 7:50pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/7 "2023-06-25T19:50:34Z")

</div>

Thanks a lot for your reply, but i guess it is not the same problem, my server is at Germany. I’m using discourse docker image for my server. What should i do if ./launcher rebuild app doesn’t work?

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [June 25, 2023, 8:17pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/8 "2023-06-25T20:17:59Z")

</div>

Looks similar to  
[Rebuild failed due to ruby gem incompatibility](https://meta.discourse.org/t/rebuild-failed-due-to-ruby-gem-incompatibility/260799)

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 8:46pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/9 "2023-06-25T20:46:07Z")

</div>

Thanks for your help! Yes, it looks similar and I tried:

```plaintext
my server:/var/discourse**$ git pull

fatal: Not a git repository: ../.git/modules/discourse_docker

```

Should i do something before running git pull? I was doing this in my server’s /var/discourse.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [June 25, 2023, 8:58pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/10 "2023-06-25T20:58:31Z")

</div>

Seems possible you have an unusual setup - is this a [standard install](https://meta.discourse.org/t/142537?silent=true)?

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 25, 2023, 9:17pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/11 "2023-06-25T21:17:21Z")

</div>

I read the last programmer’s documents for me and it says because many things of the web running behind nginx and discourse also needs to be hosted behind nginx. The [standard install](https://meta.discourse.org/t/142537?silent=true) doesn’t work for my situation.

and the following is how he said in the document and how he did:

Discourse runs in a docker container. However, it requires a special kind of configuration, not via a docker-compose.yml or a .conf file.

The discourse-project/ the github repository required to **config and build the docker-image can be found [here](https://github.com/discourse/discourse_docker)**. Ignore the nice and juicy “discourse-setup” program they provide, that won’t work here. We need to configure the app ourselves.

1. clone discourse\_docker to /var/discourse: `git clone https://github.com/discourse/discourse_docker.git /var/discourse`
2. go to the folder and use a provided sample configuration: `cd /var/discourse && cp samples/standalone.yml containers/app.yml`
3. then edit the containers/app.yml file (e.g. with `sudo nano`)

- Changes were made to the hosting section, the smtp settings for mail and - important - the expose section so only an unused port is exposed to the outside
- To run discourse on a path such as “/forum” some more changes were needed as described [here](https://meta.discourse.org/t/subfolder-support-with-docker/30507)
- Some problems also occur with the email-authentication:
  - The mail that sends emails is here “server’s email”. However, Discourse expects the mail to have the same domain as its host, namely “server’s email”
    - Solution described [here](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326)

  - Also use “DISCOURSE\_SMTP\_AUTHENTICATION: login” as another env option. Why also always . . .

1. Then build the app from the `/var/discourse` directory with `sudo ./launcher bootstrap app`. This takes quite a while
2. Then you may be able to start the discourse container with `sudo ./launcher start app`.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 25, 2023, 11:30pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/12 "2023-06-25T23:30:51Z")

</div>

Those are good notes.

The `git pull;./launcher rebuild app` should work.

What version are you updating from?

Is he os out of date? (`cat /etc/issue`)

Is the disk full? (`df - h`)

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 26, 2023, 12:22am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/13 "2023-06-26T00:22:38Z")

</div>

Thanks for your reply! The version I’m updating from is 2.8.0.beta6 and last update was at 28.09.2021.

After running `cat /etc/issue` i got:  
`Debian GNU/Linux 9 \n \l`

And the following are Information according to `./discourse-doctor`

```plaintext
==================== MEMORY INFORMATION ====================
RAM (MB): 4050

              total used free shared buff/cache available
Mem: 3955 427 1152 63 2375 3182
Swap: 0 0 0

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 63G 27G 34G 45% /

==================== DISK INFORMATION ====================
Disk /dev/sda: 64 GiB, 68719476736 bytes, 134217728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc0b6220c

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 134217727 134215680 64G 83 Linux

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 26, 2023, 1:08am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/14 "2023-06-26T01:08:44Z")

</div>

You might add swap.

Also, see [PostgreSQL 13 update](https://meta.discourse.org/t/postgresql-13-update/172563).

Did you rebuild more than once?

See also [Debian | endoflife.date](https://endoflife.date/debian)

You really need to move everything to a new vm with a supported operating system. So you’ll also need to get whatever the other stuff you have running upgraded as well.

---

<div class="post-metadata">

### Author: ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)
#### Post date: [June 26, 2023, 1:30am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/16 "2023-06-26T01:30:26Z")

</div>

hello jammy, after times of fail installation , i found it’s caused by memory limit of server and network, i suggest you to use a server of 4GB Mem and access normally of github and ruby

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [June 26, 2023, 6:58am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/17 "2023-06-26T06:58:27Z")

</div>

> [@klein](#):
>
> ```plaintext
> The path `/var/www/discourse/vendor/bundle/ruby/2.7.0/bundler/gems/sprockets-f4d3dae71ef2` does not exist.
> 
> ```

This error bothers me - do you still see it? The docker container should now be running 3.2.0

But if your /var/discourse is not a git directory, something has been done which is different from the instructions. It prevents an update and causes the ruby version mismatch. For me:

```plaintext
/var/discourse# git status
On branch main
Your branch is up to date with 'origin/main'.

```

Also we see a .git directory:

```plaintext
# ls -a /var/discourse/
. .github README.md cids discourse-setup launcher scripts tests
.. .gitignore bin containers image rebuild.log shared
.git LICENSE c discourse-doctor index.html samples templates

```

Edit: but it’s true, if you’re on a too-old OS, you have some work to do, to install discourse in a new OS and recover your backup, and also to do all the extra things which might be needed for your specific situation.

If your server is doing more things than just running discourse then that’s an extra complication. You may need local expertise.

---

<div class="post-metadata">

### Author: ![daemon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daemon/32/256632_2.png) [@daemon](https://meta.discourse.org/u/daemon)
#### Post date: [June 26, 2023, 8:17am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/18 "2023-06-26T08:17:41Z")

</div>

I have a comparable failure with ruby gems etc.  
It was a fresh install on a new server.

> [@Installation on new server fails](https://meta.discourse.org/t/installation-on-new-server-fails/269495):
>
> I just try a new installation on a new VPS and I get the following error: FAILED -------------------- Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse bash -c ' set -o errexit if [$(git rev-parse --is-shallow-repository) == "true"]; then git remote set-branches --add origin main git remote set-branches origin tests-passed git fetch --depth 1 origin tests-passed else git fetch --tags --prune-tags --prune --force origin fi ' failed with return #\<P…

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 27, 2023, 1:17am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/19 "2023-06-27T01:17:19Z")

</div>

Thank you guys for helping, I will try your suggestions one by one to fix the problem. If there is any feedback(good or bad), I will post it back in the forum. Thanks again！

---

<div class="post-metadata">

### Author: ![klein](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klein/32/310191_2.png) [@klein](https://meta.discourse.org/u/klein)
#### Post date: [June 29, 2023, 11:44am UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/20 "2023-06-29T11:44:30Z")

</div>

I successfully installed the new version discourse. I just followed the instructions in the document above and i worked for me. But now I have trouble to restore from the backup.  
I tried [Restore a backup from the command line](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034) but i got following:

```plaintext
root@my_server:/var/www/discourse# discourse restore my_server-2023-06-20-033008-v20210922064213.tar.gz
Starting restore: my_server-2023-06-20-033008-v20210922064213.tar.gz
[STARTED]
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2023-06-29-113408 exists...
Copying archive to tmp directory...
Unzipping archive, this may take a while...
EXCEPTION: /var/www/discourse/lib/discourse.rb:137:in `exec': Failed to decompress archive.

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
/var/www/discourse/lib/discourse.rb:171:in `execute_command'
/var/www/discourse/lib/discourse.rb:137:in `exec'
/var/www/discourse/lib/discourse.rb:33:in `execute_command'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:78:in `decompress_archive'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:23:in `decompress'
/var/www/discourse/lib/backup_restore/restorer.rb:42:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2023-06-29-113408' directory...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

```

What should i do now?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 29, 2023, 2:11pm UTC](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562/21 "2023-06-29T14:11:56Z")

</div>

Something is wrong with your backup file. It might just be truncated.

[Next page](https://meta.discourse.org/t/problem-when-updating-discourse-forum/269562.md?page=2)
