如何在推送到新存储库时解决"GitLab:API无法访问"?

Duf*_*uff 19 gitlab

我们在我的工作地点有一个本地托管的GitLab企业版(目前在v7.12.00-ee ceb5083).我可以通过GUI创建存储库而不会出现问题.但是当我尝试向存储库添加任何内容时,我收到此错误:

D:\ws\testing [master]> git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: API is not accessible
To http://gitlab.ops.cld/duffrw/testing.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://gitlab.ops.cld/duffrw/testing.git'
Run Code Online (Sandbox Code Playgroud)

我在/var/log/gitlab/gitlab-shell/gitlab-shell.log文件中看到API没有响应,并且给出了"内部服务器错误":

E, [2015-07-22T16:05:51.812454 #15110] ERROR -- : API call <POST http://127.0.0.1:8080/api/v3/internal/allowed> failed: 500 => <{"message":"500 Internal Server Error"}>.
Run Code Online (Sandbox Code Playgroud)

几个问题......我在哪里可以离开这里?必须有某种服务提供商没有运行.为什么不?它叫什么?我该如何开始呢?

我签到/var/log/gitlab/nginx/gitlab_access.log并发现了这些线条,但我没有看到任何有趣的东西:

172.31.201.164 - - [22/Jul/2015:16:05:50 +0000] "GET /duffrw/testing.git/info/refs?service=git-receive-pack HTTP/1.1" 401 0 "-" "git/1.9.5.msysgit.1"
172.31.201.164 - - [22/Jul/2015:16:05:50 +0000] "GET /duffrw/testing.git/info/refs?service=git-receive-pack HTTP/1.1" 401 0 "-" "git/1.9.5.msysgit.1"
172.31.201.164 - duffrw [22/Jul/2015:16:05:51 +0000] "GET /duffrw/testing.git/info/refs?service=git-receive-pack HTTP/1.1" 200 179 "-" "git/1.9.5.msysgit.1"
172.31.201.164 - duffrw [22/Jul/2015:16:05:51 +0000] "POST /duffrw/testing.git/git-receive-pack HTTP/1.1" 200 124 "-" "git/1.9.5.msysgit.1"
Run Code Online (Sandbox Code Playgroud)

推送此存储库没有任何错误,/var/log/gitlab/nginx/gitlab_error.log并且/var/log/gitlab/nginx/error.log完全为空.

我错过了什么?

更新:

使用该gitlab-ctl tail命令非常方便!它显示了一个堆栈跟踪,我发送给GitLab,他们告诉我这是7.12.00中的错误.它固定在7.13.00.

小智 23

如果使用gitlab.com,则服务器正在更新或出现问题.

您可以访问https://status.gitlab.com查看GitLab团队的更新.

您还可以关注Twitter帐户:https://twitter.com/gitlabstatus


Pie*_*reF 6

您必须在GitLab的配置文件中为GitLab API设置正确的URL.

正如我们在您gitlab-shell.log的API地址中看到的那样,当前设置为http://127.0.0.1:8080/.如果更改运行GitLab的默认URL或更改了其默认端口,则必须更改它.

此参数可在/etc/gitlab/gitlab.rb以下位置配置:

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'http://127.0.0.1:3000'
[...]
Run Code Online (Sandbox Code Playgroud)

这是默认值(因为端口3000是GitLab omnibus中的默认值unicorn).更新后,您必须运行a sudo gitlab-ctl reconfigure来应用此参数.

它会覆盖文件opt/gitlab/embedded/service/gitlab-shell/config.yml标题注释中提到的文件.


fat*_*tel 5

当我们将gitlab托管在来自Google云的“计算引擎”上时,我们遇到了此问题。出现这种情况的原因是在我们的计算机中未配置“交换”。Gitlab无法分配额外的内存。

我们决定扩展内存,而不是创建交换分区,但这是您的选择... :)