No commit found for SHA

I’m getting an error when I try and restore a paket. Please see item at bottom. I can’t see anywhere that that a feature needs enabling.

Problem is reproducible in browser. The following gets an error response
https://api.github.com/repos/CraigChamberlain/moon-data

Where as this example servers a full json object.
https://api.github.com/repos/forki/FsUnit

Could not find hash for https://api.github.com/repos/CraigChamberlain/moon-data/commits/
RequestFailedException: Request to 'https://api.github.com/repos/CraigChamberlain/moon-data/commits/' failed with: 422 UnprocessableEntity — {"message":"No commit found for SHA: ","documentation_url":"https://developer.github.com/v3/repos/commits/#get-a-single-commit"}

:wave: @CraigChamberlain, welcome to the GitHub Support Community! :sunglasses:

Thanks for asking about this.

The following URLs are structured to request a single repository based on a repository owner and its name:

Sending a GET request to either of these URLs should return a 200 OK because they’re both public repositories.

:mag: Let’s look at this line together:

RequestFailedException: Request to 'https://api.github.com/repos/CraigChamberlain/moon-data/commits/' failed with: 422 UnprocessableEntity — {"message":"No commit found for SHA: ","documentation_url":"https://developer.github.com/v3/repos/commits/#get-a-single-commit"}

While I can’t speak to which HTTP client made this request, it may be worth highlighting that there’s a trailing slash, /, at the end of this URL. Based on the error message, our API interpreted this request expecting a SHA after that slash.

It’s possible that you’re interested in listing commits for that repository. If that’s the case, here’s an example curl request for doing so:

curl --verbose https://api.github.com/repos/CraigChamberlain/moon-data/commits

On the other hand, if you’re interested in getting a single commit for that repository, you can make a GET request to this URL. Here’s another example curl request:

curl --verbose https://api.github.com/repos/CraigChamberlain/moon-data/commits/f438b25473961cfd0d57375c1af0e749c26aa97d

Yes looks like the trailing slash was the issue. Silly of me to have missed it.

Thanks

C

1 Like