Herbouw mislukt met git reset --hard origin tests-passed mislukt met return

AI-generated summary

The user amalg encountered a rebuild failure in a Docker container running Discourse, with the error git reset --hard origin tests-passed failing due to a Git issue. The problem seemed related to the GitHub repository state, as the rebuild succeeded after a retry amalg. The user noted the lack of rollback options and the risk of a 502 error during failed boots. pfaffman clarified that if a rebuild fails, the ./launcher start app command can restart the existing container, which may resolve temporary issues, though a 502 is expected during startup pfaffman. amalg confirmed the container was running but Discourse wasn’t fully operational, highlighting confusion about the correct recovery steps.

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.

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.

If the rebuild fails you can usually

./launcher start app

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.