Rebuild fails with git reset --hard origin tests-passed failed with return

I’m running Discourse in a docker container and when I try to use launcher to rebuild app.yml I am getting this failure;

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && git reset --hard origin tests-passed failed with return #<Process::Status: pid 257 exit 128>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["git remote set-branches --add origin master", "git remote set-branches origin $version", "git fetch --depth 1 origin $version", "git checkout $version", "git reset --hard origin $version", "git clean -f", "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", "find public/plugins/ -maxdepth 1 -xtype l -delete"]}
a84cc388fbc4b16307c2081e17b03c5eee578e1155fa1e057147601119d89a34
** 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.
==================== END REBUILD LOG ====================

It looks like a git error with the current state of the official discourse repo on github, but I don’t know enough about docker or git to really understand for sure. I attempted to run the ./discourse-doctor as suggested but that resulted in the same issue being repeated… no help.

1 Like

ok so yeah… it was something going on with the discourse repo because i didn’t do anything… i just ran the rebuild again and now it’s working…

  1. scary a fudged repo status can brick your whole setup

  2. also scary no rollback recovery for when remote repos are not playing nice… whole forum was 502 bad gateway until it successfully rebuilt itself. maybe there is something in docker like an image history or something that can be reverted to… i don’t know… but it seems like rollback support would be a pretty important thing if the difference between your site running and not is totally reliant on github repos being properly sorted. sure, one could argue it should be on me to snapshot the server before attempting a rebuild… one could argue that i suppose.

1 Like

If the rebuild fails you can usually

./launcher start app
1 Like

Thanks Jay,

The container was starting… I could use docker top to see nginx running inside the container and that instance is what was giving the http error 502 “bad gateway”. I confirmed by stopping the container and then getting connection refused, so the container was running… but discourse was failing to run properly.

Are you saying though that using the launcher utility it should start the discourse application inside the container? Or would that need to be executed from within the container itself?

Sorry for my ignorance here.

I’m saying that if the rebuild fails you can usually launch the old container with the start command.

It takes a while for rails to crank up, so the 502 is expected for a minute or two.

2 Likes

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