Can't create schedules from within a dashboard

Hello,

I’m trying to create script from within a dashboard page which will create a Schedule that will be run in the next few minutes (one time only) to create an identity and variable which will be used as a password for the user. The problem is that although the schedule is being added and is visible in the schedules section I’m getting an info about “Object reference not set to an instance of an object.” in the admin area and the schedule does not run

Can you please look in the log file for that error? It should have a stack trace that can point to why this is occurring.

You can get to the logs by navigating to Settings \ General \ Diagnostics.

That’s what I got in the logs :

2023-01-12 13:12:59.728 +00:00 [ERR] Failed to schedule job. Value cannot be null. (Parameter ‘cronExpression’)
2023-01-12 13:12:59.728 +00:00 [ERR] Failed to read configuration file. schedules.ps1
System.NullReferenceException: Object reference not set to an instance of an object.
at UniversalAutomation.JobService.AddOrUpdateRecurringJob(Script script, Schedule schedule) in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\Automation\JobService.cs:line 296
at UniversalAutomation.JobService.ScheduleJob(Script script, Schedule schedule) in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\Automation\JobService.cs:line 256
at UniversalAutomation.Services.SchedulesConfigurationScript.OnReadAfterUpdateAsync(Schedule schedule) in C:\actions-runner_work\universal\universal\src\Universal.Server\Services\Configuration\Schedules.cs:line 100
at UniversalAutomation.Services.ConfigurationScript`1.ReadAsync(Boolean initialSync) in C:\actions-runner_work\universal\universal\src\PowerShellUniversal\ConfigurationScript.cs:line 268

It looks like it’s trying to get cron there while I selected the switch to run it one time only and the date given was correct

Can you share the New-PSUSchedule command you are using?

New-PSUSchedule -Script “Reusable\Tableau\Scripts\Tableau-Script-CreatePSUUser.ps1” -OneTime $Date -Username $EventData.txtEmail -Password $pswdd -Role $Role -Name $EventData.txtEmail -Integrated