cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error with Cron Schedule

eddbarrientos19
Frequent Guest

When attempting to configure a query for the Database Extension 2.0 with a "cron schedule" to run every day at 22:00 (syntax: 0 22 * * * ), I receive the following error:

"Error message: Extension validation error. Constraint violations: $.sqlServer[0].schedule: is not defined in the schema and the schema does not allow additional properties"

Since this is a simple setup, I would like to know why this error occurs and whether this type of scheduling is supported.

4 REPLIES 4

david_lopes
Dynatrace Mentor
Dynatrace Mentor

Replace the last '*' with a '?'. And update your minDynatraceVersion to at least 1.299

The SQL Datasource  uses an engine called Quartz Scheduler.

This website: https://www.javainuse.com/cron can be used to test the expressions

NOTE: The SQL Datasource adds an extra zero at the beginning of the string, which are the seconds, so to test your expression add an extra zero on the website.

Example, to use this schedule in Dynatrace: `0 8 ? * 1-5`, validate it with `0 0 8 ? * 1-5` on the website.

The schema documents this as well (either 2nd or 4th index must be a ?)
New cron format release notes: https://github.com/dynatrace-extensions/extensions-schemas/releases/tag/1.299.0

Thanks @david_lopes 👨‍💻 for providing applicable solution 😉 :dynaspin:.

@eddbarrientos19 You can proceed with an attempt and keep us posted.

Also PFA resources for more info:

Hoping it adds value.

BR,
Peter

eddbarrientos19
Frequent Guest
Thanks a lot, @david_lopes , for your help and tips! They were super useful for understanding how the expressions work and how to use them. I followed your advice and managed to get the expression working.

@Peter_Youssef , thanks to you too for the extra info—it was really helpful.

I really appreciate both of you. Cheers!

Hi @eddbarrientos19 
It's our pleasure to contribute together towards reaching applicable solutions.

 

Featured Posts