Open Lupusonwork opened 2 years ago
What is the value of the schedule (stored in NextRun
) that is causing the exception?
Also are you able to advise what version of Veeam you are using? Typically this error occurs for me when Veeam is using a different value to signify no value. In the past Veeam has used the value 1/01/0001 12:00:00 AM
to signify no schedule is set, but some versions change this to something else
NextRun has no value.
Version: 11.0.1.1261 P20220302
Are you able to advise whether the value is null or an empty string?
One of
$someObject.NextRun -eq $null
or
$someObject.NextRun -eq ""
should return True
, where $someObject
is the object you stored the Veeam backuo job info in
$job=Get-VBRJob -name XXXXX $job.ScheduleOptions.NextRun -eq '' > True
To correct this, within static [int]GetNextBackupStartTimeInSeconds($nextRun)
in line 747, change the first if
statement from if($nextRun -eq "01/01/0001 00:00:00")
to if($nextRun -eq "01/01/0001 00:00:00" -or [string]::IsNullOrEmpty($nextRun))
- just like in static [string]GetNextBackupStartTimeText($nextRun)
.
For others looking for this error: Message in English is "An exception occurred while trying to process backups: String was not recognized as a valid DateTime."
We also use schedules that run after other backups (parent jobs). These lead to this error. As a work a round I have included the following in the script to intercept the call: if ($this.job.ParentScheduleId -eq $null -or $this.job.ParentScheduleId -eq ""){ ...[TimeFormatter]::GetNextBackupStartTimeText($epSchedule.NextRun) }
It would be nicer if the schedule could be read from the parent job.