当前位置:  开发笔记 > 后端 > 正文

Gitlab 8与nginx代理无法下载zip,克隆公共repo作为guest,也无法构建CI

如何解决《Gitlab8与nginx代理无法下载zip,克隆公共repo作为guest,也无法构建CI》经验,为你挑选了0个好方法。

我认为所有3个问题都与同一个问题有关,所以我要将所有问题都放在这里.

Gitlab本身正在工作,我甚至设法将它从8.2.2更新到8.2.3.我可以创建项目,推送我的代码,拉动它,当我有正确的ssh键时重新放入它,等等.

但:

    我无法将代码下载为zip文件,而是获得了JSON:

{"RepoPath":"/ var/opt/gitlab/git-data/repositories/me/myrepo.git","ArchivePrefix":"...

    人们无法克隆我的公共仓库(空仓库错误).

    CI无法构建我的测试:

警告:您已克隆空存储库.检查12345为开发...致命:引用不是树:123456789mycommithash987654321

错误:构建失败:退出状态1

注意:我翻译了法语版的错误消息.

我想问题出现在我的Nginx配置中,但是有很多文档我不确定哪一个是好的:有主力的那些,当我必须更改gitlab.rb的gitlab_git_http_server等时.

我的配置如下:

Gitlab 8.2.3

Ubuntu Trusty(14.04)

Nginx 1.8

我的gitlab使用SLL托管在子域上,所以我添加了一个Nginx代理

/etc/gitlab/gitlab.rb:

external_url 'https://gitlab.mydomain.com'
nginx['listen_addresses'] = ['127.0.0.1', "[::1]"]
nginx['listen_port'] = 8080 
nginx['listen_https'] = false 

/ etc/nginx/site_enabled/gitlab:

server {
  listen *:80 default_server;
  listen [::]:80 ipv6only=on default_server;
  server_name gitlab.mydomain.com;
  return 301 https://$server_name$request_uri;

  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;
}

server{
  # listen 443 ssl;
  listen 0.0.0.0:443 ssl default_server;
  listen [::]:443 ipv6only=on ssl default_server; 
  server_name gitlab.mydomain.com;
  server_tokens off;

  location /{
    proxy_pass http://localhost:8080;
    proxy_redirect off;
    proxy_set_header    Host                $http_host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto   $scheme;
  }

  location ~ ^/(assets)/ {
    root /opt/gitlab/embedded/service/gitlab-rails/public;
    gzip_static on; # to serve pre-gzipped version
    expires max;
    add_header Cache-Control public;
  }

  client_max_body_size 250m;

  # ...
  # A lot a of SSL stuff (HSTS, OCSP, dhparam, etc)
  # ...

  access_log  /var/log/nginx/gitlab_access.log;
  error_log   /var/log/nginx/gitlab_error.log;

  error_page 502 /502.html;

更新:

刚刚将Gilab升级到8.3.0.

现在Git 502.

申请:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.2-to-8.3.md.

走着瞧.

更新2:

毕竟没有完成指令,停止一切并重新启动所有内容两次(Gitlab和Nginx)终于设法让事情发生了.

CI/Zip/PublicCloning仍存在同样的问题.

更新3:

只需更新到8.2.3 apt-get update apt-get install gitlab-ce

502.

重启nginx gitlab-ctl restart

gitlab-rake gitlab:app:check

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 

Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.7)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.6.1)
Active users: 2

Checking GitLab ... Finished

如果有人可以引导我提供适当的文档或更改,那将是非常棒的.

++ Greg

推荐阅读
帆侮听我悄悄说星星
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有