如何调试Jenkins代理启动错误?

问题描述 投票:0回答:1

我通过使用Alpine图像的Docker插件代理模板添加了一个新的worker / slave。代理程序被实例化,调用并且身份验证成功,但是从属服务器上的代理程序启动失败并出现以下错误(我从Jenkins>节点> my_node_id>请参阅日志以获取更多详细信息):

[03/27/19 18:11:39] [SSH] Authentication successful.
SSH connection reports a garbage before a command execution.
Check your .bashrc, .profile, and so on to make sure it is quiet.
The received junk text is as follows:
nologin: this account is not available

null
[03/27/19 18:11:39] Launch failed - cleaning up connection
[03/27/19 18:11:39] [SSH] Connection closed.

我没有足够的信息来调试这个 - 只是来自某个未知命令的错误输出。看起来代理正在使用nologin参数发出一些命令,该参数被误解为用户标识。我的猜测是它的一些从属映像配置或包安装问题。

有什么方法可以确切地找出代理人发出的命令吗?有什么方法可以获得更完整的代理启动日志?

FWIW这是我的奴隶Dockerfile:

FROM docker:stable-dind

RUN apk update; \
apk upgrade; \
apk add git; \
apk add python3; \
pip3 install pyyaml pexpect requests ruamel.yaml; \
apk add openjdk8; \
apk add curl; \
apk add sudo; \
apk add bash; \
apk add openssh-server; \
rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key; \
/usr/bin/ssh-keygen -A

EXPOSE 22

# Docker and Jenkins users
RUN addgroup -g 1001 -S docker; \
adduser -D -u 1001 -S appuser -G docker; \
addgroup -S jenkins; adduser -S jenkins -G jenkins; \
echo "jenkins:xxxxxxxxx" | chpasswd; \
chown -R jenkins:jenkins /home/jenkins

CMD ["/usr/sbin/sshd", "-D"]
docker jenkins alpine
1个回答
0
投票

nologin: this account is not available问题是因为Jenkins代理需要bash而不是sh。所以更改Dockerfile adduser修复了这个问题:

adduser -S jenkins -G jenkins --shell /bin/bash

现在转到下一个错误:-)

注意我没有找到如何获取有关代理命令或日志的更多详细信息。如果有人知道我会有兴趣知道如何。

© www.soinside.com 2019 - 2024. All rights reserved.