# Help! Upgrade constantly fails

**URL:** https://meta.discourse.org/t/help-upgrade-constantly-fails/259032
**Category:** Self-hosting
**Created:** [March 22, 2023, 1:16pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032 "2023-03-22T13:16:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 22, 2023, 1:16pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/1 "2023-03-22T13:16:17Z")

</div>

Help! Upgrade constantly fails

We recently upgraded servers on Google Cloud Console. Not sure this is related, but since then we’ve hit lots of 502 errors. It seems that infrequently updates such as for official theme components and themes can be pulled, and at times they return 502 after around 30-sec.

Using [safe mode](https://meta.discourse.org/t/53504?silent=true) it also works most of the time, but not always.

We updated the docker, then got a message we must re-build via SSH.

Then we constantly get a failure and have to revert to an image backup →

```plaintext

…..
oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
129:C 22 Mar 2023 13:00:10.162 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=129, just started
129:C 22 Mar 2023 13:00:10.162 # Configuration loaded
129:M 22 Mar 2023 13:00:10.162 * monotonic clock: POSIX clock_gettime
129:M 22 Mar 2023 13:00:10.163 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
129:M 22 Mar 2023 13:00:10.163 # Failed listening on port 6379 (TCP), aborting.
Updating files: 100% (32972/32972), done.
I, [2023-03-22T13:00:11.909015 #1] INFO -- : HEAD is now at 59e548540 Build(deps): Bump sass from 1.58.3 to 1.59.2 in /app/assets/javascripts (#20656)
 
I, [2023-03-22T13:00:11.909217 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2023-03-22T13:00:12.001100 #1] INFO -- :
I, [2023-03-22T13:00:12.001244 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  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 --prune --prune-tags origin tests-passed
  fi
[[[[[…. Timeout here -> and exit with an error]]]]]
fatal: unable to access 'https://github.com/discourse/discourse.git/': gnutls_handshake() failed: Error in the pull function.
I, [2023-03-20T10:54:29.239940 #1] INFO -- :
I, [2023-03-20T10:54:29.240283 #1] INFO -- : Terminating async processes
I, [2023-03-20T10:54:29.240310 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 41
I, [2023-03-20T10:54:29.240342 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 102
2023-03-20 10:54:29.240 UTC [41] LOG: received fast shutdown request
2023-03-20 10:54:29.242 UTC [41] LOG: aborting any active transactions
2023-03-20 10:54:29.244 UTC [41] LOG: background worker "logical replication launcher" (PID 50) exited with exit code 1
2023-03-20 10:54:29.245 UTC [45] LOG: shutting down
2023-03-20 10:54:29.268 UTC [41] LOG: database system is shut down

```

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 23, 2023, 12:55pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/2 "2023-03-23T12:55:55Z")

</div>

If anyone has even a slight idea I’d really appreciate it!

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [March 23, 2023, 1:10pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/3 "2023-03-23T13:10:30Z")

</div>

> [@sok777](#):
>
> ```plaintext
> fatal: unable to access 'https://github.com/discourse/discourse.git/': gnutls_handshake() failed: Error in the pull function.
> 
> ```

There appears to be a problem with `git` in the Docker container being able to access `github.com`.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 23, 2023, 1:11pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/4 "2023-03-23T13:11:56Z")

</div>

That’s exactly what I thought, but I have no idea why it would fail?

At times it work, and so I was able to update the docker to the latest version. But then re-build fails all the time, and sometimes even installing an official theme fails.

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [March 23, 2023, 1:31pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/5 "2023-03-23T13:31:24Z")

</div>

If I were you I’d get a shell in the Docker container and try to debug accessing `https://github.com/` from there.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [April 2, 2023, 5:07pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/6 "2023-04-02T17:07:16Z")

</div>

I just checked again and it does download the update from git but fails at the end… pretty lost here! Any advice would be extremely appreciated.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [April 3, 2023, 5:07pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/7 "2023-04-03T17:07:30Z")

</div>

Continuing the discussion here as it’s the same issue and there is advice 🙂

> [@Issue when installing new Discourse instance](https://meta.discourse.org/t/issue-when-installing-new-discourse-instance/259617):
>
> Hello Everyone, When trying to install a new instance of discourse, I’m getting this error (here is my install log): Configuration file at containers/app.yml updated successfully! Updates successful. Rebuilding in 5 seconds. Building app x86\_64 arch detected. Ensuring launcher is up to date Fetching origin Launcher is up-to-date 2.0.20230313-1023: Pulling from discourse/base Digest: sha256:f7467469ab9e39c3548d4478e3f416c05b34a0ee58eb6e40b963e562005669cc Status: Image is up to date for discour…

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [April 3, 2023, 5:07pm UTC](https://meta.discourse.org/t/help-upgrade-constantly-fails/259032/8 "2023-04-03T17:07:35Z")

</div>


