6

I have seen a couple of posts, but it did not help me. I have created around 10 Linux machines in Azure and added them to agent pools.

First, the build succeeded, but when I queued the build again, it failed at get sources with the below error.

My build definition was configured:

  • clean: true
  • clean options: sources

Error:

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Bobby
  • 97
  • 2
  • 8

1 Answers1

1

Based on the logs, it seems delete for the duilddir/support-files directory is not allowed (you can also check the permission by referring to the post Why can't I delete a file where I have group write permissions on?).

Please set the permission enable to delete under your agent's work folder.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Marina Liu
  • 36,876
  • 5
  • 61
  • 74
  • 1
    This Clean up is done when I trigger the build . It is run in get sources phase , Is there a way I can edit the get soruces script to run as sudo ? – Bobby Mar 15 '18 at 17:29
  • Current build will clean the previous build source/directory etc in Get sources step. And there is no way to specify Get sources step. And if each agent can build successful only for the first time and failed after the first time build, that means the private agent does not have delete permission. – Marina Liu Mar 16 '18 at 06:33
  • 1
    how to set up the private agent as a power (sudo) user. I have tried that by getting into the machine. Do you have any other ways that you can remember to share with me. – Bobby Mar 16 '18 at 18:31
  • For windows, the problem can be solved by changing the private log on account as the username you are using to log on the PC in services (https://imgur.com/a/rG7KW). So you can change the username for your private agent by using the way on linux OS. – Marina Liu Mar 19 '18 at 08:57