[英]GitLab can't reach PlantUml in docker container
So I have GitLab EE server (Omnibus) installed and set up on Ubuntu 20.04.所以我在 Ubuntu 20.04 上安装并设置了 GitLab EE 服务器(综合)。 Next, following official documentation found on GitLab PlantUML integration , I started PlantUML in a docker container which I did with the following command:
接下来,按照在GitLab PlantUML 集成上找到的官方文档,我在 docker 容器中启动了 PlantUML,我使用以下命令执行了该操作:
docker run -d --name plantuml -p 8084:8080 plantuml/plantuml-server:tomcat
Next, I also configured /etc/gitlab/gitlab.rb file and added next line for redirection as my GitLab server is using SSL:接下来,我还配置了 /etc/gitlab/gitlab.rb文件并添加了下一行进行重定向,因为我的 GitLab 服务器正在使用 SSL:
nginx['custom_gitlab_server_config'] = "location /-/plantuml/ { \n proxy_cache off; \n proxy_pass http://plantuml:8080/; \n}\n"
In the GitLab server GUI in admin panel, in Settings -> General, when I expand PlantUML, I set the value of PlantUML URL to (two ways):在管理面板的 GitLab 服务器 GUI 中,在 Settings -> General 中,当我展开 PlantUML 时,我将PlantUML URL的值设置为(两种方式):
1st approach :第一种方法:
https://HOST_SERVER_IP:8084/-/plantuml
https://HOST_SERVER_IP:8084/-/plantuml
Then, when trying to reach it through the browser through this address(https://HOST_SERVER_IP:8084/-/plantuml), I get然后,当试图通过浏览器通过这个地址(https://HOST_SERVER_IP:8084/-/plantuml)访问它时,我得到
This site can't provide a secure connection.
此站点无法提供安全连接。
HOST_SERVER_IP sent an invalid response.
HOST_SERVER_IP 发送了无效响应。
ERR_SSL_PROTOCOL_ERROR
ERR_SSL_PROTOCOL_ERROR
2nd approach : Also I tried to put before that I tried different value in in Settings -> General -> PlantUML -> PlantUML URL :第二种方法:我还尝试在设置 -> 常规 -> PlantUML -> PlantUML URL中尝试不同的值:
https://HOST_SERVER_IP/-/plantuml
https://HOST_SERVER_IP/-/plantuml
Then, when trying to reach it through the browser through this address (https://HOST_SERVER_IP/-/plantuml), I get然后,当尝试通过该地址(https://HOST_SERVER_IP/-/plantuml)通过浏览器访问它时,我得到
502
502
Whoops, GitLab is taking too much time to respond
糟糕,GitLab 响应时间过长
In both cases when I trace logs with gitlab-ctl tail
I get the same errors:在这两种情况下,当我使用
gitlab-ctl tail
跟踪日志时,都会遇到相同的错误:
[crit] *901 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: CLIENT_IP, server: 0.0.0.0:443
[error] 1123593#0: *4 connect() failed (113: No route to host) while connecting to upstream
My question is which of the above two ways is correct to access PlantUML with the above configuration and is there any configuration I am missing?我的问题是,以上两种方式中哪一种是正确访问具有上述配置的 PlantUML 的,我是否缺少任何配置?
I believe the issue is that you are running the plantuml in a docker container and then trying to reach it via gitlab (on localhost) with name.我相信问题在于您正在 docker 容器中运行 plantuml,然后尝试通过 gitlab (在本地主机上)使用名称来访问它。
In order to check if that is the issue please change为了检查这是否是问题,请更改
proxy_pass http://plantuml:8080/
to至
proxy_pass http://localhost:8080/
and trying again with the first approach.并再次尝试第一种方法。
Your second approach seems to be missing the container port in the url.您的第二种方法似乎缺少 url 中的容器端口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.