Cannot upgrade - app rebuild fails to boostrap

I had a notification that I needed to upgrade our installation, so I went to the admin and saw this:

Hitting the upgrade link triggered a check, but both came back with “up to date”. So I tried ./launcher rebuild app and got this:

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 #<Process::Status: pid 130 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin $version\n      git fetch --depth 1 origin $version\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n'", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\n      git pull\n  else\n      git -c advice.detachedHead=false checkout $version\n  fi\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p           /shared/{uploads,backups}\"", "bash -c \"ln    -s           /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p           /shared/tmp/{backups,restores}\"", "bash -c \"ln    -s           /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** 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.
fd6a747d640a06c375439c5c134aa46ff11ceb8f677d6d16247cb57c9772f731

I then ran ./discourse-doctor which got the site back up (although weirdly the test email timed out, maybe that’s a separate issue). So I tried another ./launcher rebuild app and it failed to bootstrap again with the same issue.

Does anyone have any clues on this? I’m using Docker on Ubuntu 22.04.

Can you do that and add that info here?

1 Like

Here’s the full log from the app rebuild:

discourse-log.log.txt (17.7 KB)

I see that when I try an app stop and and app start, it comes back again OK, but I guess that’s on the old version?

Correct. We don’t need the whole log just obvious errors (not warnings)

(not sure why my upload isn’t working on that link, but) the only obvious error I can see when looking at that log is:

fatal: unable to access 'https://github.com/discourse/discourse.git/': Could not resolve host: github.com

That doesn’t sound good?

~$ host github.com on the server works OK to resolve it.

If the error were obvious then he’d not be posting. :slight_smile: (But seriously, it’s pretty hard for someone not familiar with those logs to figure out what matters and what doesn’t and you can find hundreds of topics where someone guessed wrong at what was the error.

Sounds like an issue with Docker networking being broken somehow. Is docker up to date? Is your OS?

2 Likes

but @gilgongo hit the spot :wink:

1 Like

Ah - networking? OK so in an attempt to do a “basic” thing, I ran systemctl restart docker.service then ran ./launcher rebuild app and (after what seemed like ten thousand years) it came back up and worked! Now says I’m running “3.3.0.beta3-dev” which sounds like a good thing, I think? It appears to be working at least.

Phew - thanks for your help! I love Discourse!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.