bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Error running multiple tasks on a single target node at one time

Open kruegerkyle95 opened this issue 1 year ago • 3 comments

Describe the Bug

When using Bolt to run more than one task against a Windows target node at one time, I frequently see the following error: "Failed to execute the task for the non blocking 'task run' request (transaction ###). Error: Failed to download file with: Downloading the file failed. Reason: File operation error: failed to move over the temporary file's downloaded contents". There is another similar error that mentions the file is "being used by another process", though that flavor of the issue seems less common.

The parallelize or background plan function is used to run multiple tasks simultaneously. This error occurs when using the PCP connection type. I have mitigated this error for the most part by manually spacing out the tasks i run against a node using the "crtl::sleep" function to space out the tasks by 5 seconds. Even with this set to stagger the tasks by 5 seconds, i do still occasionally see this error though much less frequently.

Is it expected that an error would occur when two tasks are run simultaneously on a node from one plan? I expect i could further reduce the likelihood of this error occurring if i space out the tasks ever further, but ideally this isn't necessary. Should the PXP agent service be expected to queue these incoming task requests in order to avoid trying to create multiple log files/folders simultaneously?

Expected Behavior

I expect both of the task to run without issue

Steps to Reproduce

Use parallelize function to run a task multiple times on the same node. The error doesn't occur every time, but does occasionally.

Environment

Target node is using Windows server 2019

kruegerkyle95 avatar Dec 21 '23 15:12 kruegerkyle95

What version of puppet-agent are you running?

donoghuc avatar Dec 21 '23 17:12 donoghuc

This was using agent version 7.21.0

kruegerkyle95 avatar Dec 21 '23 21:12 kruegerkyle95

Curious if there's been any other investigation on this one. I occasionally still see the issue when staggering the task runs on the same node by 10 seconds

kruegerkyle95 avatar Feb 20 '24 16:02 kruegerkyle95

Thanks this should be fixed in the latest PE version

donoghuc avatar Jun 17 '24 16:06 donoghuc