reenhanced / gitreflow

Reflow automatically creates pull requests, ensures the code review is approved, and squash merges finished branches to master with a great commit message template.
MIT License
1.49k stars 64 forks source link

error: We were unable to authenticate with Github #196

Closed abbas999 closed 8 years ago

abbas999 commented 8 years ago

I'm getting a very non-descriptive "We were unable to authenticate with Github" message when I try to set up reflow. I know my password is correct because when I enter a wrong password, I get the expected authentication error message. All usual git operations are working fine. I'd be happy to help investigate.

[ec2-user@ip-172-31-5-23 webapp]$ git reflow setup
[notice] Created $HOME/.gitconfig.reflow for Reflow specific configurations
[notice] Added $HOME/.gitconfig.reflow to ~/.gitconfig include paths
Available remote Git Server services:
1. GitHub
2. BitBucket (team-owned repos only)
Which service would you like to use for this project?  1
Please enter your GitHub username: abbas999
Please enter your GitHub password (we do NOT store this): 
error: We were unable to authenticate with Github.
codenamev commented 8 years ago

Strange issue! I'm hoping it's not related to any of their updated APIs.

Prepend setup with the debug switch to see what Github is saying: DEBUG=true git reflow setup. Paste the output you get from that here.

abbas999 commented 8 years ago
[ec2-user@ip-172-31-53-203 webapp]$ DEBUG=true git reflow setup
[notice] Created $HOME/.gitconfig.reflow for Reflow specific configurations
[notice] Added $HOME/.gitconfig.reflow to ~/.gitconfig include paths
Available remote Git Server services:
1. GitHub
2. BitBucket (team-owned repos only)
Which service would you like to use for this project?  1
Please enter your GitHub username: abbas999
Please enter your GitHub password (we do NOT store this): 
EXECUTED: get - /authorizations with PARAMS: {}
"Connection options : \n"
{:headers=>
  {"Accept"=>
    "application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1",
   "Accept-Charset"=>"utf-8",
   "User-Agent"=>"Github API Ruby Gem 0.14.0"},
 :ssl=>
  {:ca_file=>
    "/usr/local/share/ruby/gems/2.3/gems/github_api-0.14.0/lib/github_api/ssl_certs/cacerts.pem"},
 :url=>"https://api.github.com",
 :builder=>
  #<Faraday::RackBuilder:0x00000002785f30
   @handlers=
    [Github::Request::Jsonize,
     Faraday::Request::Multipart,
     Faraday::Request::UrlEncoded,
     Github::Request::BasicAuth,
     Faraday::Response::Logger,
     Github::Response::Mashify,
     Github::Response::Jsonize,
     Github::Response::AtomParser,
     Github::Response::RaiseError,
     Faraday::Adapter::NetHttp]>}
I, [2016-08-19T12:25:50.443570 #25193]  INFO -- : get https://api.github.com/authorizations
D, [2016-08-19T12:25:50.443654 #25193] DEBUG -- request: Accept:     "application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1"
Accept-Charset: "utf-8"
User-Agent: "Github API Ruby Gem 0.14.0"
Authorization: "Basic YWJiYXM5OTk6YWxwaGE5OQ==\""
I, [2016-08-19T12:25:50.505297 #25193]  INFO -- Status: 200
D, [2016-08-19T12:25:50.505432 #25193] DEBUG -- response: server: "GitHub.com"
date: "Fri, 19 Aug 2016 12:25:50 GMT"
content-type: "application/json; charset=utf-8"
transfer-encoding: "chunked"
connection: "close"
status: "200 OK"
x-ratelimit-limit: "5000"
x-ratelimit-remaining: "4991"
x-ratelimit-reset: "1471611176"
cache-control: "private, max-age=60, s-maxage=60"
vary: "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding"
etag: "W/\"439925b77ac34fa521a365dc73978f50\""
x-github-media-type: "github.v3; format=json"
access-control-expose-headers: "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-    Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"
access-control-allow-origin: "*"
content-security-policy: "default-src 'none'"
strict-transport-security: "max-age=31536000; includeSubdomains; preload"
x-content-type-options: "nosniff"
x-frame-options: "deny"
x-xss-protection: "1; mode=block"
x-served-by: "8dd185e423974a7e13abbbe6e060031e"
x-github-request-id: "36EBE3C5:2CFA1:1293036:57B6FACE"
EXECUTED: post - /authorizations with PARAMS: {"scopes"=>["repo"], "note"=>"git-reflow (ip-172-    31-53-203)"}
"Connection options : \n"
{:headers=>
  {"Accept"=>
    "application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1",
   "Accept-Charset"=>"utf-8",
   "User-Agent"=>"Github API Ruby Gem 0.14.0"},
 :ssl=>
  {:ca_file=>
    "/usr/local/share/ruby/gems/2.3/gems/github_api-0.14.0/lib/github_api/ssl_certs/cacerts.pem"},
 :url=>"https://api.github.com",
 :builder=>
  #<Faraday::RackBuilder:0x000000036d9338
   @handlers=
    [Github::Request::Jsonize,
     Faraday::Request::Multipart,
     Faraday::Request::UrlEncoded,
     Github::Request::BasicAuth,
     Faraday::Response::Logger,
     Github::Response::Mashify,
     Github::Response::Jsonize,
     Github::Response::AtomParser,
     Github::Response::RaiseError,
     Faraday::Adapter::NetHttp]>}
error: We were unable to authenticate with Github.
codenamev commented 8 years ago

Can you check #193 and see if any of those suggestions fix your problem? Also, can you provide the version of git-reflow you're using? git reflow --version

abbas999 commented 8 years ago
[ec2-user@ip-172-31-53-203 webapp]$ git reflow --version
git-reflow version 0.8.3

I tried the suggestions mentioned in #193, but it didnt help. This is the first time I'm setting up reflow on this machine (fresh image), so understandably the git config files were mostly blank anyway.

codenamev commented 8 years ago

Ok, I will setup a fresh machine and debug this one a little further. In the meantime, you can connect Github manually by creating an access token with a note of git-reflow (ip-172- 31-53-203). Then run git config -f $HOME/.gitconfig.reflow --replace-all github.oauth-token "replace_with_your_generated_token".

Once you have your token setup, you should be able to run git reflow setup again without any issue to make sure the rest of the reflow-specific git config settings get updated.

Sorry for this! I'll be working on a fix today.

abbas999 commented 8 years ago

Ok i'll do that. Thanks so much for the help and prompt responses. I really appreciate it!

Sergeyy2 commented 3 years ago

a