首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Docker + Ansible +google-compute engine debian包-一个令人困惑的故事

Docker + Ansible +google-compute engine debian包-一个令人困惑的故事
EN

Server Fault用户
提问于 2018-07-27 12:50:00
回答 1查看 402关注 0票数 4

亲爱的服务器故障同胞!

我偶然发现了一个困扰我的问题,而你是我唯一的帮助!长话短说: 1.我有一套可配置的游戏手册,用于配置服务器2。这些游戏手册通过Google和DigitalOcean 3进行测试和验证。本周,在最新的Google实例(eu-West4a-a)上启动停靠容器的剧本开始出现故障,只有在那里--旧的计算实例和其他ISP中的实例才能正常运行。

如果出现以下错误,则无法执行:

代码语言:javascript
复制
fatal: [example_hostname]: FAILED! => {"changed": false, 
"msg": "Error starting container b57a81e7e1a39da89f91c6d6439b51cf4078f87f5a6997a7dcdd7098f84a7485: 
500 Server Error: Internal Server Error (\"OCI runtime create failed: 
container_linux.go:348: starting container process caused \"process_linux.go:402: 
container init caused \\\"invalid argument\\\"\": unknown\")"}

当容器由docker启动时,运行(参数与ansible剧本中的参数相同)容器将成功启动。只有一张图片也不是这样--任何容器都不能通过ansible启动。同时,由docker直接在服务器上运行启动它们也很好。

Docker守护进程失败,出现以下错误:

代码语言:javascript
复制
time="2018-07-25T11:54:10.809711044+02:00" level=debug msg="Calling GET /_ping"
time="2018-07-25T11:54:10.810917212+02:00" level=debug msg="Calling POST /v1.38/containers/node_exporter/restart"
time="2018-07-25T11:54:10.813468661+02:00" level=debug msg="container mounted via layerStore: &{/var/lib/docker/overlay2/a11e836fe1015928ca1181298f0934a8ee70c122e4eb1e09635b2d31c11eb3b1/merged 0x55808cfe7620 0x55808cfe7620}"
time="2018-07-25T11:54:10.813897061+02:00" level=debug msg="container mounted via layerStore: &{/var/lib/docker/overlay2/a11e836fe1015928ca1181298f0934a8ee70c122e4eb1e09635b2d31c11eb3b1/merged 0x55808cfe7620 0x55808cfe7620}"
time="2018-07-25T11:54:10.820720679+02:00" level=debug msg="EnableService a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0 START"
time="2018-07-25T11:54:10.821163095+02:00" level=debug msg="EnableService a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0 DONE"
time="2018-07-25T11:54:10.826647553+02:00" level=debug msg="bundle dir created" bundle=/var/run/docker/containerd/a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0 module=libcontainerd namespace=moby root=/var/lib/docker/overlay2/a11e836fe1015928ca1181298f0934a8ee70c122e4eb1e09635b2d31c11eb3b1/merged
time="2018-07-25T11:54:10+02:00" level=debug msg="event published" ns=moby topic="/containers/create" type=containerd.events.ContainerCreate
time="2018-07-25T11:54:10+02:00" level=info msg="shim docker-containerd-shim started" address="/containerd-shim/moby/a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0/shim.sock" debug=true pid=7576
time="2018-07-25T11:54:10+02:00" level=debug msg="registering ttrpc server"
time="2018-07-25T11:54:10+02:00" level=debug msg="serving api on unix socket" socket="[inherited from parent]"
time="2018-07-25T11:54:10+02:00" level=info msg="shim reaped" id=a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0
time="2018-07-25T11:54:10.870453438+02:00" level=error msg="stream copy error: reading from a closed fifo"
time="2018-07-25T11:54:10.870900093+02:00" level=error msg="stream copy error: reading from a closed fifo"
time="2018-07-25T11:54:10+02:00" level=debug msg="event published" ns=moby topic="/containers/delete" type=containerd.events.ContainerDelete
time="2018-07-25T11:54:10.883501549+02:00" level=error msg="a31ae80856cef0bc72298b68660739e04bc710cd815ce2a746d7276065464ab0 cleanup: failed to delete container from containerd: no such container"
time="2018-07-25T11:54:10.885529863+02:00" level=debug msg="FIXME: Got an API for which error does not match any expected type!!!: Cannot restart container node_exporter: OCI runtime create failed: container_linux.go:348: starting container process caused \"process_linux.go:402: container init caused \\\"invalid argument\\\"\": unknown" error_type="*errors.errorString" module=api
time="2018-07-25T11:54:10.885962960+02:00" level=error msg="Handler for POST /v1.38/containers/node_exporter/restart returned error: Cannot restart container node_exporter: OCI runtime create failed: container_linux.go:348: starting container process caused \"process_linux.go:402: container init caused \\\"invalid argument\\\"\": unknown"
time="2018-07-25T11:54:10.886356247+02:00" level=debug msg="FIXME: Got an API for which error does not match any expected type!!!: Cannot restart container node_exporter: OCI runtime create failed: container_linux.go:348: starting container process caused \"process_linux.go:402: container init caused \\\"invalid argument\\\"\": unknown" error_type="*errors.errorString" module=api

所有这些在通过码头运行时都不会运行。最初被认为是一个与ansible或python有关的问题,但是在完全相同的版本中安装了相同的软件包和库,这让我开始向前看。所以最终,允许我通过ansible启动码头集装箱的是.

代码语言:javascript
复制
apt purge -y google-compute-engine google-compute-engine-oslogin

一旦这些软件包消失,实例被重新启动,一切都完美无缺!与GCE中的其他服务器进行验证,这些包的当前版本如下:

代码语言:javascript
复制
ii  google-compute-engine                 2.8.3-1                        all          Google Compute Engine guest environment.
ii  google-compute-engine-oslogin         1.3.0-1+deb9                   amd64        Google Compute Engine OS Login

在其他情况下,每件事情都按预期工作:

代码语言:javascript
复制
ii  google-compute-engine                 2.7.6-1                        all          Google Compute Engine guest environment.
ii  google-compute-engine-oslogin         1.1.5-1+deb9                   amd64        Google Compute Engine OS Login

我不能降级这些包,因为他们显然不在回购。

现在关于OSLogin -我没有使用这个特性,并且显式地通过实例元数据(启用-oslogin= FALSE)来阻止它,不会改变任何事情。解决这个问题的唯一可靠的“修复”方法是删除包--但是由于它是“突然”中断的,所以它感觉不像是正确的方法。

以及删除这些包之后(& removing SSHd可能就足够了)。执行

代码语言:javascript
复制
/usr/bin/google_oslogin_control deactivate

也不修复任何东西(即使在整个VM重新启动之后)。我想不出该检查什么和看什么--我觉得移除包裹并不是真正可行的方法,因为它们存在于其他越南船民身上,而且似乎是最近的一种行为变化,我无法确定具体在哪里。

任何形式的回复都是欢迎和赞赏的!

EN

回答 1

Server Fault用户

回答已采纳

发布于 2018-08-24 07:58:02

根据谷歌的问题跟踪器:https://issuetracker.google.com/issues/111907041

造成这个问题的原因是主机名过长(在我的例子中是50个字符)--减少了主机名,解决了这个问题,并允许容器启动。我邀请所有感兴趣的人看看谷歌的问题,以获得更多的细节。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/923820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档