经过身份验证后,Github / orgs /:org / repos会返回“存储库脱机”

时间:2015-01-14 04:19:46

标签: github oauth github-api

我试图访问" / repos" github组织的端点,我在使用curl的所有者组中。我在这里使用的令牌是使用"设置"生成的个人API令牌。 Github上的界面。

使用此CURL命令(当然是一些擦洗" {}"。

curl -s https://api.github.com/orgs/{ORGNAME by text}/repos\?access_token\={TOKEN}

我收到了这个回复:

{
  "message": "Repository offline",
  "documentation_url": "https://developer.github.com/v3"
}

以下是标题(使用相同的命令+" -i")

HTTP/1.1 503 Service Unavailable
Server: GitHub.com
Date: {date}
Content-Type: application/json; charset=utf-8
Content-Length: 96
Status: 503 Service Unavailable
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4998
X-RateLimit-Reset: {msec}
X-OAuth-Scopes: admin:org, gist, notifications, read:public_key, read:repo_hook, repo, user
X-Accepted-OAuth-Scopes: repo
X-GitHub-Media-Type: github.v3
Link: <https://api.github.com/organizations/{7 digit number}/repos?access_token={TOKEN}&page=2>; rel="next", <https://api.github.com/organizations/{7 digit number}/repos?access_token={TOKEN}&page=17>; rel="last"
X-XSS-Protection: 1; mode=block
X-Frame-Options: deny
Content-Security-Policy: default-src 'none'
Access-Control-Allow-Credentials: true

它似乎很奇怪,它会给我链接到下一个/最后一个API调用以及页码,然后返回&#34;存储库脱机。&#34;实际上,API调用它们实际上是从第2页及以上开始,但不是第1页,或使用&#34;页面&#34;属性未指定。

我还尝试使用上面相同的CURL命令减去令牌,在没有auth的情况下访问repos。它返回预期的json:我组织中的一个完全公共存储库。

我尝试在线搜索来自Github API调用的503响应代码以及&#34; offline offline&#34;消息,但无法挖掘任何东西。为什么API调用不起作用,也不在任何页面的标题中调用API&lt; 2?

1 个答案:

答案 0 :(得分:0)

我发现了问题。其中一个存储库似乎在组织中被破坏了。当我尝试查看它时,我得到一个500错误页面。现在我必须弄清楚为什么我会得到500。