标签: gitlab-omnibus

在traefik代理后面的docker中的gitlab失败(通常)

我有几个网站在Docker中运行LetsEncrypt凭据并通过traefik路由.我想在Docker中运行一个本地gitlab-ce,类似于LetsEncrypt和traefik.

所以我把它添加到我的traefik.toml文件中:

[[acme.domains]]
  main = "gitlab.mydomain.com"
Run Code Online (Sandbox Code Playgroud)

这到config/gitlab.rb:

external_url "http://gitlab.mydomain.com"
Run Code Online (Sandbox Code Playgroud)

我开始使用gitlab:

docker run -d --restart=always \
     --hostname gitlab.mydomain.com \
     --expose 80 \
     --volume /srv/gitlab/config:/etc/gitlab \
     --volume /srv/gitlab/data:/var/opt/gitlab \
     --volume /var/log/gitlab:/var/log/gitlab \
     --label traefik.frontend.rule=Host:gitlab.mydomain.com \
     --name gitlab gitlab/gitlab-ce:latest
Run Code Online (Sandbox Code Playgroud)

转到https://gitlab.mydomain.com/我得到一个带有LetsEncrypt生成证书的安全站点,但该站点未加载:

内部服务器错误

当我重新加载页面时,我看到docker logs gitlab -f:

==> /var/log/gitlab/sshd/current <==
2017-02-12_16:51:31.00446 Bad protocol version identification 'GET / HTTP/1.1' from 172.17.0.8 port 41138
2017-02-12_16:51:31.26238 Bad protocol version identification 'GET /favicon.ico HTTP/1.1' from 172.17.0.8 port 41140
Run Code Online (Sandbox Code Playgroud)

/error/i在日志中搜索我看到可能有问题的几件事(zruby/gems/2.3.0/gems/redis-3.2.2z中报告了很多错误)但没有"吸烟枪"AFAICT.

为了docker restart gitlab弥补疯狂,大约每十个左右(随机)时间,我运行的网站就完美了.我一直想把它留下来,但其中却是疯狂...... …

docker gitlab-omnibus traefik

6
推荐指数
2
解决办法
3902
查看次数

Gitlab:Peer的证书颁发者无法识别

我在全新安装gitlab时遇到此错误.消息看起来像:

fatal: unable to access 'https://gitlab-ci-
token:xxxxxxxxxxxxxxxxxxxx@gitlab.example.com/something.git/': Peer's 
Certificate issuer is not recognized.ERROR: Job 
failed: exit status 1
Run Code Online (Sandbox Code Playgroud)

有关如何解决它的任何建议?

gitlab gitlab-ci gitlab-omnibus

6
推荐指数
2
解决办法
1万
查看次数

在Premise Gitlab页面上:如何增加/调试公用文件夹允许的大小//错误:将工件上传到协调器...太大的存档

我正在GitLab CI的构建步骤中创建一个大型的(满意的)软件包存储库,并希望将其托管在GitLab Pages中(在内部安装中)。这可以完美地工作,直到公用文件夹的大小变大为止,不仅包版本而且下载文件也都存储在其中。我向pages任务添加了最后一步以显示文件夹大小:

$ du -h public
2.7G    public
Creating cache default...
public: found 564 matching files                   
vendor: found 3808 matching files                  
Created cache
Uploading artifacts...
public: found 564 matching files                   
ERROR: Uploading artifacts to coordinator... too large archive  id=494 responseStatus=413 Request Entity Too Large status=413 Request Entity Too Large token=kDf7gQEd
FATAL: Too large                                   
ERROR: Job failed: exit code 1
Run Code Online (Sandbox Code Playgroud)

当然,这很多。我设法删除了一些过时的次要版本,当时

950MB public
Run Code Online (Sandbox Code Playgroud)

还是一样的问题。经过一些调查,似乎有两个相关的限制:

  1. Gitlab页面系统配置:最大页面大小(无限设置为0)
  2. /etc/gitlab/gitlab.rb中的NGINX最大帖子大小(已设置为禁用,似乎默认为250M)。我改为nginx['client_max_body_size'] = '1024m'

还是一样的问题。即使在删除甚至更多的版本(减小到580M文件夹大小)后,也会出现相同的错误。一旦我禁用下载,因此<10M一切正常。

我该如何调试原因?还是有其他隐藏配置?

gitlab gitlab-omnibus gitlab-pages

6
推荐指数
1
解决办法
423
查看次数

解决Git索引过小的错误

我最近将托管我们代码仓库的开发服务器更新到了较新版本的Ubuntu(18.04)。作为该过程的一部分,git已升级到版本2.23.0。部署代码的实际应用服务器需要能够从git存储库中签出最新更改。当我尝试在这些服务器上执行“ git fetch”操作时,我收到一长串如下所示的错误:

错误:索引文件./objects/pack/._pack-5b58f700fea57ee6f8ff29514a376b945bb1c8a9.idx太小

我进行了一些挖掘,以查看是否可以提出解决方案,但到目前为止,该方法已奏效。我尝试了在这里列出的答案:git错误:“索引文件太小”。既未解决问题,也git index-packgit repack -a -d解决。我什至尝试从应用程序服务器中删除文件的本地副本,并使用git clone重新安装。克隆本身引发了一堆类似于以前的错误

远程:错误:索引文件./objects/pack/._pack-5b58f700fea57ee6f8ff29514a376b945bb1c8a9.idx太小

在这一点上,我没有想法。任何帮助,将不胜感激。

编辑:的输出du -h表明有足够的磁盘空间。

linux git ubuntu debian gitlab-omnibus

6
推荐指数
1
解决办法
112
查看次数

为什么 gitlab-registry.key “由于 only_if 被跳过”?

使用 Docker 和 Compose,我试图将 Gitlab 与作为另一个服务运行的外部注册表配对。我正在使用 Traefik 这样做。为了配对 Gitlab 和 Registry 服务,我需要 Gitlab 在 处创建一个密钥/var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key,但是我可以在启动期间在日志中看到它没有发生......我怀疑我没有设置我需要的所有环境变量? ?

docker-compose.yml

version: "3.7"

services:
  traefik:
    container_name: traefik
    image: "traefik:v2.2.0"
    hostname: "traefik.${WEBSITE}"
    restart: always
    ports:
      - "443:443"
      - "5000:5000"
    command: --configFile=/config/traefik.toml
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./traefik:/config:ro"
      - "/certs/letsencrypt/acme.json:/letsencrypt/acme.json"


  gitlab:
    container_name: gitlab
    image: gitlab/gitlab-ce:latest
    hostname: "git.${WEBSITE}"
    restart: always
    depends_on:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.git.tls=true"
      - "traefik.http.routers.git.tls.certresolver=letsencrypt"
      - "traefik.http.routers.git.entrypoints=web"
      - "traefik.http.routers.git.rule=host(`git.${WEBSITE}`)"
      - "traefik.http.routers.git.service=git"
      - "traefik.http.services.git.loadbalancer.server.port=80"
    ports:
      - "22:22"
    environment:
      gitlab_omnibus_config: |
        gitlab_rails['gitlab_shell_ssh_port'] = …
Run Code Online (Sandbox Code Playgroud)

authentication registry gitlab docker gitlab-omnibus

6
推荐指数
1
解决办法
200
查看次数

Gitlab:对等方的证书颁发者已被标记为不受用户信任

我有一个本地 gitlab,我正在尝试运行一些构建/管道,但出现以下错误 -

fatal: unable to access 'https://gitlab-ci-token:[MASKED]@gitlab.systems/testing/test-project-poc.git/': Peer's certificate issuer has been marked as not trusted by the user.
Run Code Online (Sandbox Code Playgroud)

我已经研究过这个 - Gitlab:Peer's Certificate Issuer is not recognize.pem并按照通过合并 来获取文件的步骤进行操作server certificateintermediate certificateroot certificate我仍然收到以下错误,并且确实很难找到根本原因。

/etc/gitlab/gitlab.rb config

##! enable/disable 2-way SSL client authentication
#nginx['ssl_verify_client'] = "off"

##! if ssl_verify_client on, verification depth in the client certificates chain
#nginx['ssl_verify_depth'] = "1"

nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.systems.pem"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.systems.key"
Run Code Online (Sandbox Code Playgroud)

是否还有其他配置需要更新/修改?非常感谢任何指导。

gitlab gitlab-ci-runner gitlab-omnibus

6
推荐指数
1
解决办法
2万
查看次数

Gitlab EE - 没有通配符域的 Gitlab 页面设置

我不知道如何在没有通配符域的自托管 Gitlab 实例上设置 Gitlab 页面。例如,我有1台服务器,有3个公共IP地址和域名:

  • 10.8.0.10 (git.example.com) - 主 GitLab 实例
  • 10.8.0.11 (registry.example.com) - 容器注册表
  • 10.8.0.12 (pages.example.com) - GitLab 页面

/etc/gitlab/gitlab.rb然后我像这样设置 Omnibus 配置:

external_url 'https://git.example.com'
nginx['enable'] = true
nginx['listen_addresses'] = ['10.8.0.10']


registry_external_url 'https://registry.example.com'
registry_nginx['enable'] = true
registry_nginx['listen_addresses'] = ['10.8.0.11']
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/git.example.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/git.example.com.key"

pages_external_url 'https://pages.example.com'
pages_nginx['enable'] = false
gitlab_pages['enable'] = true
gitlab_pages['cert'] = "/etc/gitlab/ssl/pages.example.com.crt"
gitlab_pages['cert_key'] = "/etc/gitlab/ssl/pages.example.com.key"
gitlab_pages['external_http'] = ['10.8.0.12:80']
gitlab_pages['external_https'] = ['10.8.0.12:443']
Run Code Online (Sandbox Code Playgroud)

例如,我有一个位于https://git.example.com/somegroupname/project的项目。我可以通过https://registry.example.com/somegroupname/project访问该项目的容器注册表,并使用命令拉取 Docker 映像docker pull registry.example.com/somegroupname/project

我知道 GitLab Pages …

self-hosting gitlab gitlab-omnibus gitlab-api gitlab-pages

6
推荐指数
1
解决办法
1591
查看次数

登录到位于 Gitlab 中的 docker 注册表

我创建了一个 docker 注册表并希望将它与 GitLab 连接。我遵循了这个文档https://docs.gitlab.com/ce/user/project/container_registry.html。之后我尝试登录 docker,但收到 401 或访问被拒绝,你知道如何解决这个问题吗?

docker login url
Username: gitlab-ci-token
Password: 
https://<url>/v2/: unauthorized: HTTP Basic: Access denied

docker login <url>
Username: knikolov
Password: 
https://<url>/v2/: unauthorized: HTTP Basic: Access denied

docker login <url>
Username: knikolov
Password: 
Error response from daemon: login attempt to https://<url>/v2/ failed with status: 401 Unauthorized
Run Code Online (Sandbox Code Playgroud)

生产日志

Started POST "/api/v4/jobs/request" for 172.17.0.1 at 2017-06-22 14:42:51 +0000
Started POST "/api/v4/jobs/request" for 172.17.0.1 at 2017-06-22 14:42:54 +0000
Started POST "/api/v4/jobs/request" for 172.17.0.1 at 2017-06-22 14:42:57 …
Run Code Online (Sandbox Code Playgroud)

gitlab gitlab-ci gitlab-ci-runner gitlab-omnibus gitlab-ce

5
推荐指数
2
解决办法
6299
查看次数

使用 gitlab api,如何获取活动用户列表?

Gitlab-CE v8.14.3

我正在阅读GitLAB API 文档,并试图获取活动用户列表。我是管理员并创建了个人令牌。我这样做

$ curl -XGET "Private-Token: kfjakjfkjkd" https://company.domain.com/api/v3/users?active=true
Run Code Online (Sandbox Code Playgroud)

并不断收到 401(未经授权)错误。就像我说的,我是管理员。是什么赋予了?

gitlab gitlab-omnibus gitlab-api

5
推荐指数
2
解决办法
6261
查看次数

即使存储库存在于 git_data_dirs 路径中,Gitlab 也会返回“No Repository”

概括

备份和迁移后,某些存储库在 Web 控制台中返回“No Repository”错误,并且无法克隆。已验证存储库是否存在 git_data_dirs 文件夹中指定的内容。

作为测试,我可以直接从存储库/文件夹中克隆“无存储库”项目,因此存储库本身似乎没有任何问题。

重现步骤

不确定如何复制它,但这是我经历的步骤:

  • 主服务器上的备份项目
  • 在新服务器上恢复 tarball
  • 转到新服务器的 Web 仪表板中的项目路径,并获得“No Repository”。

我为诊断问题而采取的步骤。假设项目名为 myapp/myapp.foo.git:

  • 转到http://newgitserver.local/myapp/myapp.foo.git
  • 获取“无存储库”
  • 查看/etc/gitlab/gitlab.rb中的git_data_dirs:

    git_data_dirs({ "default": { "path": "/var/opt/gitlab/git-data"}, "silo": {"path": "/mnt/reposbackup/git-data"} })

  • 请注意,我的项目在两个文件夹中都可用:/var/opt/gitlab/git-data/repositories/myapp/myapp.foo.git AND /mnt/reposbackup/git-data/repositories/myapp/myapp.foo.git

  • 尝试重新启动服务器 - 结果相同
  • 尝试 sudo gitlab-ctl reconfigure - 结果相同
  • 尝试重新启动 runv 服务: sudo systemctl restart gitlab-runsvdir - 结果相同

我还查看了数据库,“projects.repository_storage”值似乎是正确的。即使将其更改为“默认”与“筒仓”(这是我的备用目录)似乎也不起作用。

我试图了解 gitlab 如何确定存储库的位置,因为对 repo-path 的检查似乎是失败的原因。

解决方案

sudo gitlab-rake cache:clear迁移完成后运行。

gitlab gitlab-omnibus

5
推荐指数
1
解决办法
2373
查看次数