Every job fails with "Cannot find path 'C:\Temp\powerJobs Processor\*' because it does not exist."

Description

Every job fails with the error message

Cannot find path 'C:\Temp\powerJobs Processor\<GUID>\Very\long\path\file.ipt' because it does not exist.
at , C:\ProgramData\coolOrange\powerJobs\Modules\coolOrange.FileSystem.psm1: line 16
at Remove-EmptyFolders, C:\ProgramData\coolOrange\powerJobs\Modules\coolOrange.FileSystem.psm1: line 16
at Clean-Up, C:\ProgramData\coolOrange\powerJobs\Modules\coolOrange.FileSystem.psm1: line 51
at , C:\ProgramData\coolOrange\powerJobs\Setup_Job.ps1: line 56

Cause

This happens because a file was downloaded which exceeds the Windows path limit of 260 characters. Usually this should only be possible when long path names are activated, which is not supported by Vault. Though we found that even without this setting it is possible to create such a file through various means.

Solution

In order to allow the jobs to still process, even if some temporary files can't be removed, the error needs to be handled in setup_job.ps1.

Open "C:\ProgramData\coolOrange\powerJobs\setup_job.ps1"

Replace the line

Clean-Up -folder $workingDirectory.Parent.FullName

with

try {
    Clean-Up -folder $workingDirectory.Parent.FullName
}
catch {
    Write-Warning "Couldn't delete '$($workingDirectory.Parent.FullName)'"
}

Though this does not address the actual cause of the issue. This workaround just allows the jobs to run. To address the actual cause of this issue you need to reduce the path size of the affected Vault files.