Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GitLab Omnibus Docker引导循环(以前工作)修复程序?_Docker_Gitlab_Reverse Proxy_Gitlab Omnibus - Fatal编程技术网

GitLab Omnibus Docker引导循环(以前工作)修复程序?

GitLab Omnibus Docker引导循环(以前工作)修复程序?,docker,gitlab,reverse-proxy,gitlab-omnibus,Docker,Gitlab,Reverse Proxy,Gitlab Omnibus,因此,在最终设置GitLab并使用它一天后,我决定尝试启用GitLab注册表。但是,在运行gitlab ctl reconfigure之后,系统进入一个引导循环(每次引导持续10-15秒) 现在,我一直在到处寻找解决这个问题的方法,结束引导循环,或者获取详细说明容器为何不断重新启动的日志 我正在数字海洋水滴VPS上运行GitLab(最新版本)的综合Docker映像。GitLab配置为不使用https,因为我使用反向代理(apache)进行连接(此连接通过https) 反向代理配置 浏览器=>ex

因此,在最终设置GitLab并使用它一天后,我决定尝试启用GitLab注册表。但是,在运行
gitlab ctl reconfigure
之后,系统进入一个引导循环(每次引导持续10-15秒)

现在,我一直在到处寻找解决这个问题的方法,结束引导循环,或者获取详细说明容器为何不断重新启动的日志

我正在数字海洋水滴VPS上运行GitLab(最新版本)的综合Docker映像。GitLab配置为不使用https,因为我使用反向代理(apache)进行连接(此连接通过https)

反向代理配置 浏览器=>example.com:443(https)=>localhost:8888(http)

Docker ps输出

c13e26a20f7d        gitlab/gitlab-ce:latest       "/assets/wrapper"        24 hours ago        Up 2 seconds (health: starting)   0.0.0.0:2222->22/tcp, 0.0.0.0:8888->80/tcp, 0.0.0.0:4444->443/tcp   gitlab
我的尝试(没有成功):

  • 还原以前工作配置的快照
  • 使用gitlab ctl命令恢复文件权限
  • 在可用的日志文件(仅访问日志)中查找任何类型的提示

如有任何建议和/或我将如何解决此问题,将不胜感激!

修复:关闭Docker容器,检查重新配置日志(位于安装文件夹内的日志/重新配置目录中)以及根据日志中明显的错误对配置文件进行调整

修复启动循环(一步一步)

注意:如果您不是以root身份运行,我建议您暂时以root身份运行(使用
sudo su
),以避免权限被拒绝的错误

手动停止Docker容器后,我能够查看位于
/srv/gitlab/logs/reconfigure
(带有最新时间戳)的完整日志

摘自最新的重新配置日志:

[2018-05-19T00:24:50+00:00] INFO: *** Chef 13.6.4 ***
[2018-05-19T00:24:50+00:00] INFO: Platform: x86_64-linux
[2018-05-19T00:24:50+00:00] INFO: Chef-client pid: 25
[2018-05-19T00:24:50+00:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
[2018-05-19T00:24:52+00:00] WARN: Plugin Network: unable to detect ipaddress
[2018-05-19T00:24:52+00:00] INFO: Setting the run_list to ["recipe[gitlab]"] from CLI options
[2018-05-19T00:24:52+00:00] INFO: Run List is [recipe[gitlab]]
[2018-05-19T00:24:52+00:00] INFO: Run List expands to [gitlab]
[2018-05-19T00:24:52+00:00] INFO: Starting Chef Run for [REDACTED]
[2018-05-19T00:24:52+00:00] INFO: Running start handlers
[2018-05-19T00:24:52+00:00] INFO: Start handlers complete.
[2018-05-19T00:24:54+00:00] INFO: Loading cookbooks [gitlab@0.0.1, package@0.1.0, postgresql@0.1.0, registry@0.1.0, mattermost@0.1.0, consul@0.0.0, gitaly@0.1.0, letsencrypt@0.1.0, nginx@0.1.0, runit@0.14.2, acme@3.1.0, crond@0.1.0, compat_resource@12.19.0]
[2018-05-19T00:24:56+00:00] WARN: Runtime directory '/run' is not a tmpfs.
错误消息是一个良好的开端,但不会揭示根本问题

[2018-05-19T00:24:56+00:00] ERROR: Running exception handlers
[2018-05-19T00:24:56+00:00] ERROR: Exception handlers complete
现在日志的最后3行显示了问题

[2018-05-19T00:24:56+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2018-05-19T00:24:56+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-19T00:24:56+00:00] FATAL: RuntimeError: Unsupported GitLab Registry external URL path: /gitlab/registry
现在,在看到最后一行之后,我发现我的配置无效,是致命问题的原因

为了解决这个问题,我在docker容器处于未绑定状态时编辑了配置(配置文件位于
/srv/gitlab/config/gitlab.rb
)。在修复了配置之后,在我的情况下是注释掉所有gitlab注册表配置选项(因为我决定暂时等待测试此功能)

配置差异

################################################################################
## Container Registry settings
##! Docs: https://docs.gitlab.com/ce/administration/container_registry.html
################################################################################

- registry_external_url 'http://[REDACTED]:4567/gitlab/registry'
+ # registry_external_url 'http://[REDACTED]:4567/gitlab/registry'

### Settings used by GitLab application
- gitlab_rails['registry_enabled'] = true
+ # gitlab_rails['registry_enabled'] = true
- gitlab_rails['registry_host'] = "[REDACTED]"
+ # gitlab_rails['registry_host'] = "[REDACTED]"
- gitlab_rails['registry_port'] = "4567"
+ # gitlab_rails['registry_port'] = "4567"
- gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
+ # gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
我运行了以下命令来引导容器并应用新配置

docker start gitlab
sudo docker exec gitlab gitlab-ctl reconfigure
由于容器在我发出命令后没有立即重新启动,因此立即获得了令人满意的结果

Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
  - gitlab (0.0.1)
  - package (0.1.0)
  - registry (0.1.0)
  - postgresql (0.1.0)
  - letsencrypt (0.1.0)
  - mattermost (0.1.0)
  - runit (0.14.2)
  - nginx (0.1.0)
  - gitaly (0.1.0)
  - consul (0.0.0)
  - acme (3.1.0)
  - crond (0.1.0)
  - compat_resource (12.19.0)
Installing Cookbook Gems:
...
就是这样!现在一切都正常工作了。事实证明,用户错误是问题的原因