VSTS 构建代理因获取源而失败:权限被拒绝

VSTS build agent failed with get sources: Permission denied

我看过几个帖子,但对我没有帮助。我在 Azure 中创建了大约 10 Linux 台机器并将它们添加到代理池中。

首先,构建成功,但是当我再次对构建进行排队时,它在获取源时失败并出现以下错误。

我的构建定义已配置:

错误:

018-03-14T18:08:10.9360932Z ##[command]git clean -fdx

2018-03-14T18:08:11.1202177Z warning: failed to remove builddir/support-files/wsrep.cnf: Permission denied

2018-03-14T18:08:11.1221821Z warning: failed to remove builddir/support-files/sysusers.conf: Permission denied

2018-03-14T18:08:11.1248161Z warning: failed to remove builddir/support-files/CTestTestfile.cmake: Permission denied

2018-03-14T18:08:11.1268109Z warning: failed to remove builddir/support-files/mariadb.pc: Permission denied

2018-03-14T18:08:11.1285043Z warning: failed to remove builddir/support-files/wsrep_notify: Permission denied

2018-03-14T18:08:11.1297658Z warning: failed to remove builddir/support-files/mysql.server: Permission denied

2018-03-14T18:08:11.1309669Z warning: failed to remove builddir/support-files/cmake_install.cmake: Permission denied

2018-03-14T18:08:11.1321349Z warning: failed to remove builddir/support-files/CMakeFiles/CMakeDirectoryInformation.cmake: Permission denied

2018-03-14T18:08:11.1333209Z warning: failed to remove builddir/support-files/CMakeFiles/progress.marks: Permission denied

2018-03-14T18:08:11.1345486Z warning: failed to remove builddir/support-files/mysqld_multi.server: Permission denied

根据日志,似乎不允许删除duilddir/support-files目录(您也可以参考post Why can't I delete a file where I have group write permissions on?查看权限).

请在代理的工作文件夹下设置权限启用删除。