boxen / our-boxen

Copy me for your team.
https://github.com/boxen/our-boxen/
MIT License
2.58k stars 883 forks source link

api.github.com 422 Validation Failed (Unprocessable Entity) #788

Closed indi-ca closed 8 years ago

indi-ca commented 8 years ago

While attempting to bootstrap boxen on a fresh computer, I encounter the following error message. My credential are correct. According to the GitHub API v3, "Sending invalid fields will result in a 422 Unprocessable Entity response."

/opt/boxen/repo/.bundle/ruby/2.0.0/gems/octokit-2.7.2/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/authorizations: 422 - Validation Failed (Octokit::UnprocessableEntity)
Error summary:
  resource: OauthAccess
  code: already_exists
  field: fingerprint // See: https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/response.rb:9:in `block in call'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/sawyer-0.5.5/lib/sawyer/agent.rb:94:in `call'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/octokit-2.7.2/lib/octokit/client.rb:257:in `request'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/octokit-2.7.2/lib/octokit/client.rb:138:in `post'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/octokit-2.7.2/lib/octokit/client/authorizations.rb:70:in `create_authorization'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/boxen-2.8.0/lib/boxen/preflight/creds.rb:88:in `run'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/boxen-2.8.0/lib/boxen/check.rb:28:in `block in run'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/boxen-2.8.0/lib/boxen/check.rb:28:in `each'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/boxen-2.8.0/lib/boxen/check.rb:28:in `run'
    from /opt/boxen/repo/.bundle/ruby/2.0.0/gems/boxen-2.8.0/lib/boxen/cli.rb:43:in `run'
    from ./script/boxen:165:in `<main>'
takashiyoshida commented 8 years ago

I had the same problem on my second Mac. You may want to refer to https://github.com/github/hub/issues/496

I followed one of the suggestions (deleting a duplicate OAuth token description). After deleting the duplicate OAuth token, I was able to run ./script/boxen without the error.

indi-ca commented 8 years ago

Yes. This resolves the issue. Thank you.