atmos / heaven

:walking: Rails app for GitHub Flow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

500 Internal Server Errors returned from GitHub on Gist update

dblandin opened this issue · comments

Deploys today at my office have been failing due to an Internal Server Error returned from Octokit (Octokit::InternalServerError). The provider will run (and usually succeed) but when it comes time to update the deployment gist, a 500 error is returned from GitHub and the entire deployment "fails".

It seems that from c663ce8 onward, this error and any other StandardErrors are rescued, but the 500s still occur on output update so the deployment gist usually reads something like:

stdout

Deployment 46955 pending

Not very helpful at all.

Has anyone encountered the same problem and/or been able to dig up a cause? The content provided to Octokit seems to be pretty standard Git and deployment output. I wasn't able to find a more detailed response from GitHub while digging around OctoKit.

stderr

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  100   817    0   703  100   114   1028    166 --:--:-- --:--:-- --:--:--  1027
  100  1574    0  1460  100   114   2135    166 --:--:-- --:--:-- --:--:--  2134

stdout

HEAD is now at 4e78c80 Commit message
INFO[66101a10] Running /usr/bin/env mkdir -p /tmp/app/ on staging.app.com
INFO[66101a10] Finished in 0.445 seconds with exit status 0 (successful).
INFOUploading /tmp/app/git-ssh.sh 100.0%
INFO[5afdca0f] Running /usr/bin/env chmod +x /tmp/app/git-ssh.sh on staging.app.com
INFO[5afdca0f] Finished in 0.057 seconds with exit status 0 (successful).
INFO[cac5e680] Running /usr/bin/env mkdir -pv /var/www/app/shared /var/www/app/releases on staging.app.com
INFO[cac5e680] Finished in 0.057 seconds with exit status 0 (successful).
INFO[35bf4698] Running /usr/bin/env mkdir -pv /var/www/app/shared/log /var/www/app/shared/tmp/pids /var/www/app/shared/tmp/cache /var/www/app/shared/tmp/sockets /var/www/app/shared/vendor/bundle on staging.app.com
INFO[35bf4698] Finished in 0.058 seconds with exit status 0 (successful).
INFO[1a78c1d5] Running /usr/bin/env mkdir -pv /var/www/app/shared on staging.app.com
INFO[1a78c1d5] Finished in 0.059 seconds with exit status 0 (successful).
INFOThe repository mirror is at /var/www/app/repo
INFO[fb385612] Running /usr/bin/env git remote update on staging.app.com
INFO[fb385612] Finished in 1.163 seconds with exit status 0 (successful).
INFO[85b03637] Running /usr/bin/env mkdir -p /var/www/app/releases/20140818223457 on staging.app.com
INFO[85b03637] Finished in 0.064 seconds with exit status 0 (successful).
INFO[f59bb870] Running /usr/bin/env git archive master | tar -x -C /var/www/app/releases/20140818223457 on staging.app.com
INFO[f59bb870] Finished in 0.342 seconds with exit status 0 (successful).
INFO[935dcf39] Running /usr/bin/env mkdir -pv /var/www/app/releases/20140818223457 on staging.app.com
INFO[935dcf39] Finished in 0.057 seconds with exit status 0 (successful).
INFO[89d5ebfb] Running /usr/bin/env ln -s /var/www/app/shared/.env /var/www/app/releases/20140818223457/.env on staging.app.com
INFO[89d5ebfb] Finished in 0.056 seconds with exit status 0 (successful).
INFO[fcfd02c4] Running /usr/bin/env mkdir -pv /var/www/app/releases/20140818223457 /var/www/app/releases/20140818223457/tmp /var/www/app/releases/20140818223457/tmp /var/www/app/releases/20140818223457/tmp /var/www/app/releases/20140818223457/vendor on staging.app.com
INFO[fcfd02c4] Finished in 0.058 seconds with exit status 0 (successful).
INFO[2fa216e5] Running /usr/bin/env ln -s /var/www/app/shared/log /var/www/app/releases/20140818223457/log on staging.app.com
INFO[2fa216e5] Finished in 0.057 seconds with exit status 0 (successful).
INFO[921415b8] Running /usr/bin/env ln -s /var/www/app/shared/tmp/pids /var/www/app/releases/20140818223457/tmp/pids on staging.app.com
INFO[921415b8] Finished in 0.057 seconds with exit status 0 (successful).
INFO[6c5c1f60] Running /usr/bin/env ln -s /var/www/app/shared/tmp/cache /var/www/app/releases/20140818223457/tmp/cache on staging.app.com
INFO[6c5c1f60] Finished in 0.058 seconds with exit status 0 (successful).
INFO[4fb56c9e] Running /usr/bin/env ln -s /var/www/app/shared/tmp/sockets /var/www/app/releases/20140818223457/tmp/sockets on staging.app.com
INFO[4fb56c9e] Finished in 0.056 seconds with exit status 0 (successful).
INFO[c6906fc9] Running /usr/bin/env ln -s /var/www/app/shared/vendor/bundle /var/www/app/releases/20140818223457/vendor/bundle on staging.app.com
INFO[c6906fc9] Finished in 0.056 seconds with exit status 0 (successful).
INFO[d8e002ee] Running /usr/bin/env bundle install --path /var/www/app/shared/bundle --without development test --deployment --quiet on staging.app.com
INFO[d8e002ee] Finished in 0.593 seconds with exit status 0 (successful).
INFO[6fc2147d] Running bundle exec rake assets:precompile on staging.app.com
INFO[6fc2147d] Finished in 5.608 seconds with exit status 0 (successful).
INFO[e25fdce5] Running /usr/bin/env cp /var/www/app/releases/20140818223457/public/assets/manifest* /var/www/app/releases/20140818223457/assets_manifest_backup on staging.app.com
INFO[e25fdce5] Finished in 0.059 seconds with exit status 0 (successful).
INFO[292428bb] Running /usr/bin/env cd /var/www/app/releases/20140818223457 && source .env && bundle exec rake db:migrate on staging.app.com
INFO[292428bb] Finished in 3.911 seconds with exit status 0 (successful).
INFO[a748f389] Running /usr/bin/env rm -rf /var/www/app/current on staging.app.com
INFO[a748f389] Finished in 0.057 seconds with exit status 0 (successful).
INFO[2f09767a] Running /usr/bin/env ln -s /var/www/app/releases/20140818223457 /var/www/app/current on staging.app.com
INFO[2f09767a] Finished in 0.058 seconds with exit status 0 (successful).
INFO[223f3e93] Running /usr/bin/env cd /var/www/app/current && kill -USR2 $(cat /var/www/app/shared/tmp/pids/unicorn.pid) on staging.app.com
INFO[223f3e93] Finished in 0.060 seconds with exit status 0 (successful).
INFO[9e470e76] Running /usr/bin/env cd /var/www/app/current && source .env && bundle exec sidekiq -d -i 0 -P /var/www/app/shared/tmp/pids/sidekiq.pid -e $RACK_ENV -c $SIDEKIQ_WORKERS -q default -L /var/www/app/current/log/sidekiq.log on staging.app.com
INFO[9e470e76] Finished in 0.784 seconds with exit status 0 (successful).
INFOKeeping 3 of 4 deployed releases on staging.app.com
INFO[9864c1d5] Running /usr/bin/env rm -rf /var/www/app/releases/20140808161311 on staging.app.com
INFO[9864c1d5] Finished in 0.174 seconds with exit status 0 (successful).
Notifying NewRelic
Notifying Honeybadger
Honeybadger Notification Complete
INFO[694775c8] Running /usr/bin/env echo \"Branch master (at 4e78c80) deployed as release 20140818223457 by app; \" >> /var/www/app/revisions.log on staging.app.com
INFO[694775c8] Finished in 0.059 seconds with exit status 0 (successful).

This was something that popped up in gist that I started noticing yesterday too. It's fixed in #70, try updating and let me know.

Yep. That seemed to work! Thanks!

So it boils down to the Content-Type not defaulting to "application/json"?

Would anything else result in that 500 status code from GitHub?