python-2.7 - Jenkins 构建失败并出现 OSError:[Errno 2] 没有这样的文件或目录
问题描述
我有一个执行 rsync 命令的构建脚本。
rsync_cmd = [
'rsync', '-rcv',
src_dir,
dest_dir]
print "Running {}".format(' '.join(rsync_cmd))
rsync_proc = subprocess.Popen(rsync_cmd)
try:
rsync_proc.wait()
except KeyboardInterrupt:
rsync_proc.terminate()
rsync_proc.wait()
raise
当我在构建服务器上运行命令行时,它运行良好。但是当同样通过 Jenkins 运行时,我得到以下错误
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
这是几天前运行的。我没有改变任何东西。运行构建的服务器使用的是 Ubuntu 16.04,我最近对其进行了软件包更新。这是我唯一能想到的。但不确定是否相关。我正在使用的python版本是
python:
Installed: 2.7.12-1~16.04
Candidate: 2.7.12-1~16.04
解决方案
推荐阅读
- .net - 如果导入项目是 .NET Core SDK 项目,如何签入 props 文件
- php - 路径查找算法来查找从一个地方到另一个地方的路线
- ios - 为什么 ViewController 不能完全适应 iPad 的屏幕?
- php - 如何在 laravel 5.6 中检查特定 id 是否有密码?
- typescript - 在 Observable 中使用正则表达式过滤
- react-native - 如何使用 react-native-material-dropdown 显示图像和文本?
- javascript - 格式化响应对象 - 续集 ORM。循环内的异步函数
- tableau-api - 如何在 Tableau 中获取同一列中的值?
- android - Osmdroid 地图在 android 设备中模糊
- http - 在网站 weer.nl 上使用 telnet get 请求时 - 我收到无法修复的 301 错误