在远程服务器上运行 Fabric 任务时,我得到以下堆栈跟踪:
[x.x.x.x] run: git fetch && git reset --hard origin/develop
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/var/lib/jenkins/jobs/deploy/workspace/.pyenv/lib/python2.6/site-packages/ssh/agent.py", line 115, in run
self._communicate()
File "/var/lib/jenkins/jobs/deploy/workspace/.pyenv/lib/python2.6/site-packages/ssh/agent.py", line 125, in _communicate
events = select([self._agent._conn, self.__inr], [], [], 0.5)
TypeError: argument must be an int, or have a fileno() method.
Fabric 任务正在尝试执行git fetch并且在ssh/agent.py中引发异常的事实让我认为 SSH 身份验证有问题。
同一用户可以在 Fabric 之外运行git fetch ,并且该任务在我的笔记本电脑上运行良好。
这里发生了什么?我该如何解决这个问题?