I'm assuming you're running on Windows. This can usually happen because of
open file handles. Could you use the sysinternals tools
<https://docs.microsoft.com/en-us/sysinternals/downloads/handle> to
identify processes that may be holding onto the files after the build
completes?

- Ketan



On Tue, Sep 17, 2019 at 2:21 AM Jason Smyth <[email protected]>
wrote:

> Hello,
>
> We have several Pipelines that are failing during the "clean working
> directory" task of a Job. The only error message provided is "Unable to
> delete file".
>
> This just started recently but I believe that, until recently, these same
> Jobs did not have the "Clean working directory" attribute set so the issue
> has likely existed for some time and we are just discovering it now. The
> issue affects multiple Pipelines but all affected Pipelines follow the same
> pattern:
>
> Stage 1: 1 job
> Stage 2: 2 jobs
>
> The issue only affects 1 Agent but this is the only Agent we have that is
> capable of running these jobs. The issue never seems to affect Stage 1 but
> what we see is that if Stage 1 completes and then Stage 2 for the same
> Pipeline starts immediately, both jobs fail with the same error message
> about being unable to delete a particular file.
>
> If we rerun Stage 2 a few minutes later, both jobs complete successfully.
> I have reviewed the Agent's log file and there is no additional information
> beyond the same "Unable to delete file" error message shown on the console.
>
> The file is inside GoCD's working directory and the GoCD user has full
> control of the entire directory tree so it should not be a permissions
> issue on the file. The file is a normal file, not a symlink that could lead
> outside the working directory to somewhere GoCD does not have access.
>
> How can we get additional information about why GoCD is failing to clean
> the working directory so that we can resolve the issue?
>
> At the moment we are working around the issue by manually re-running
> failed Stages but this is obviously far from ideal.
>
> Any insight here would be appreciated.
>
> Thank you,
> Jason
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/b060bcb6-7ac6-484a-8ae9-c1eb7136dcbd%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/b060bcb6-7ac6-484a-8ae9-c1eb7136dcbd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAMUPJd4-%2B39C0JX%2BSoFNKn43LQF13ghOJBTWoj871o9AsTsVOA%40mail.gmail.com.

Reply via email to