0

I have setup a drone server (not in a container , running on my machine for the first part of this).

I have a github repo set up and the details for the github client and secret. The server is http://localhost:4040 and the 'Authorization callback URL' set to http://localhost:4040/authorize

When I hit access http://localhost:4040 to login am sent to github to authorize the application. (This is in line with what I expected). The details all look correct (what I think it should be).

When I click the Authorize application button in the github screen I am redirected back to http://localhost:4040/authorize and on to http://localhost:4040/login?error=oauth_error

Where can I get more information on this error? Can I provide more details?

Where can I get more information about setting up a drone server (first) then a docker drone (as it seems that is the setup preferred (correct?))?

Thanks in advance for your time on this Github OAuth Details Application authorization

  • Note: I have VERSION: 0.6.0-rc.1 – Caffeine Borg Apr 28 '17 at 22:16
  • what do you see in the drone logs? You should see something like `cannot authenticate user. %s` where `%s` is the detailed reason authorization was rejected – Brad Rydzewski Apr 29 '17 at 10:41
  • When I go to login (at the drone url) I get redirected to github to Authorize the application. Then a form for a password (at https://github.com/login/oauth/authorize) I enter my github password (correct?) (which I pasted in after confirming it is good). I get redirected to the drone server /login?error=oauth_error From the server running in debug I see the following error: ERRO[71203] cannot authenticate user. GET https://api.github.com/user/emails: 404 Not Found [] – Caffeine Borg Apr 29 '17 at 17:44
  • This would tell me that either a) your account doesn't have a primary / verified email address, resulting the user email endpoint returning no results or b) you changed the default scope configuration and forgot to include the user:email scope. The solution to the former would be to make sure your account has a primary email setup. – Brad Rydzewski Apr 30 '17 at 10:25
  • It was the setting for DRONE_GITHUB_SCOPE=repo,repo:status,user:email,read:org Comma-separated Github oauth scope. I had only repo,repo:status. My thought was to be limited, which was too much. Also, I had DRONE_OPEN=false and needed to change that to 'true'. Thanks for your time and feedback. I will look back over the documents after I can get some testing/building done. My goal there will be to learn more about the user setup. Now I am at the screen with "Loading..." – Caffeine Borg Apr 30 '17 at 13:50
  • The "Loading..." seemed to be related to being in an account before the github collaboration step was complete. I have that fixed. Now, using the same binary for server and agent (on the same machine) I see an error when a build is kicked off "ERROR: Error response from daemon: client is newer than server (client API version: 1.26, server API version: 1.24)" ---> $ drone -v --> drone version 0.6.0-rc.1 – Caffeine Borg Apr 30 '17 at 21:28
  • Brad - quick note: I set up a v0.5.0 drone server and agent and have more success . I will plan to sit there for the main use. IF I can help on the v0.6.0-rc.X or v0.6.0 let me know. – Caffeine Borg May 01 '17 at 18:22
  • `client is newer than server` is a docker error when the client (in this case drone) uses a newer api protocol than your docker daemon. This can be solved by upgrading docker (to 17.x) or by instructing the client to downgrade the docker API by setting `DOCKER_API_VERSION=1.24` with the agent. The latter approach is confirmed to work by a number of teams already using 0.6. – Brad Rydzewski May 02 '17 at 00:11
  • Thanks. I will plan to make the changes this PM and update this thread once I have some progress. – Caffeine Borg May 02 '17 at 00:29
  • Success! I did a clean create of the drone server docker image and ran that. On another machine, from the cli , I started a drone agent (in debug) with environment set for the DRONE_SERVER and DRONE_SECRET adn included "export DOCKER_API_VERSION=1.24" ... Got a successful `go get ; go build ; go test`. I found I had to have workplace: set in the .drone.yml (in the root directory of the repo). I can add more details or let me know ho I can otherwise help. For now this "question" can be closed. I appreciate your time & guidance – Caffeine Borg May 02 '17 at 19:39
  • Glad it works! I don't think I need more details regarding the workspace. It is advised and documented that Go programs should consider setting the workspace http://docs.drone.io/workspace/ http://docs.drone.io/golang-example/ – Brad Rydzewski May 03 '17 at 00:38

0 Answers0