0

I feel like I'm missing something glaringly obvious, but when calling .add_deploy_key I'm getting the following (user and repo below are placeholders):

Octokit::UnprocessableEntity:
POST https://api.github.com/repos///keys: 422 - Validation Failed Error summary: resource: PublicKey code: custom field: key message: key is invalid. It must begin with 'ssh-rsa' or 'ssh-dss'. Check that you're copying the public half of the key // See: http://developer.github.com/v3/repos/keys/#create

Here is an example of the generated key:

"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCluDMepWvk7Ur68mj0RVJ0W419FiiZdHgClBF7z56uK5LzMfc5H4K91EI2uvepNwMu8U0+mgFr4PKmxgnKa+eclQqpxpohX+aCMQ3tkbeuPZ7XF5y1yMahNXHZAXIhBSlbjbA/GmmkGHc+wA4n0ey1wR6rWwdMa/fQ5/H8P3sRKSgkvpx9BNBf95CZpewiwtCNDwhOak3+XbYJDcYGMh1nd2Jp4Fu3r6H7jff9Krz4Wsa1dpRBKBhvYDWhv8+l4AMG6ghUDiP5YDFF9IacSxp1OHTCOcRbDXWlq60NXJNvVpyWNP7xXPb0STcE5jZ1UK+0DkBV0ESWRJZLo18l54U9"

If I take this exact same key and paste it into the web UI, it accepts it just fine. I'm authenticated with an Oauth access token.

Any pointers?

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Chris Ball
  • 131
  • 6
  • What permissions does your Access Token haven? – Ian Stapleton Cordasco Jan 02 '14 at 03:29
  • @sigmavirus24 I have the scope set to "repo,user:email". – Chris Ball Jan 02 '14 at 15:31
  • Hmm, just to double-check -- you're not sending the double quotes at the beginning and end as a part of the key, right? Also, can you reproduce the error with curl? If so, can you please send the full output of such a curl -v command to support@github.com so that we can investigate? Thanks! – Ivan Zuzak Jan 02 '14 at 21:02
  • I'm not... just passing the string on to the Octokit .add_deploy_key method. I'll run it through curl and let you know how that goes. – Chris Ball Jan 02 '14 at 22:10
  • All of that worked fine, so just to check, I copied and pasted the same code I was having issues with yesterday... totally fine. Sorry to waste time, but thanks for the help! – Chris Ball Jan 03 '14 at 01:10

1 Answers1

1

This seems to somehow have been a temporary issue... the exact same code works fine today.

Chris Ball
  • 131
  • 6