Issue
Some jobs fail with the error message
"Cannot bind argument to parameter 'LocalFile' because it is null"
Error in german:
"Das Argument kann nicht an den Parameter "LocalFile" gebunden werden, da es NULL ist."
Cause
This error will always happen when there are issues downloading the files from Vault.
There are two known causes.
- The download permissions for one of the dependencies is set to denied.
- The windows path length of the main file or one of the dependencies exceeds the maximum ntfs path length
Solution
Permissions
First you should verify if this is related to the download permissions and if so, which files are affected
- Login to Vault Client with the same user that is logged in to the Jobprocessor.
- Search for the affected drawing
- Right click on the drawing and select "Get..."
- In the Get dialog select "Include Children"
- Press Ok
If you don't have permissions to download any of the dependencies an error dialog will appear that lists all those files. Take a look at those file's lifecycle and make sure to grant the job user download permissions for that particular lifecycle and state. Please refer to the Vault documentation for information how to change the lifecycle security.
NTFS Path Length
To check whether one of your files exceeds the ntfs path limit you can use the PowerShell script below.
- Login to Vault Client with the same user that is logged in to the Jobprocessor.
- Search for the affected drawing
- Right click on the drawing and select "Get..."
- In the Get dialog select "Include Children"
- Press Ok
- In Windows search for ISE and run Windows PowerShell ISE
- In ISE in the white pane insert the below script
- Change the line "$vaultWorkspace = 'C:\VaultWorkspaces\Vault'" to your actual local Vault workspace. For example "$vaultWorkspace = 'C:\Vault'"
- Save the script
- Press F5 to run the script
class FileCount {
[string] $Path
[int] $Length
FileCount([string]$path) {
$this.Path = $path
$this.Length = $path.Length
}
}
$vaultWorkspace = 'C:\VaultWorkspaces\Vault'
$fileCounts = @()
$filePaths = Get-ChildItem -LiteralPath $VaultWorkspace -Recurse -File | Select-Object -ExpandProperty FullName
foreach ($filePath in $filePaths) {
$fileCounts += [FileCount]::new($filePath)
}
$largestPath = $fileCounts | Sort-Object -Property Length -Descending | Select-Object -ExpandProperty Path -First 1
$powerJobsRoot = 'C:\TEMP\powerJobs Processor\00000000-0000-0000-0000-000000000000'
$filePathWithoutWorkspace = $largestPath.Replace($vaultWorkspace, '')
$largestTempPath = Join-Path -Path $powerJobsRoot -ChildPath $filePathWithoutWorkspace
Write-Host "The largest file path in the temporary powerJobs file will be $($largestTempPath.Length): '$($largestTempPath)'"
If the path length exceeds the limit you can adapt your folder structure in Vault to shorten the paths.