# Error with Cron Schedule

**URL:** <https://community.dynatrace.com/t/error-with-cron-schedule/49486>\
**Category:** Extensions\
**Tags:** extensions\
**Created:** [December 24, 2024, 8:02pm UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486 "2024-12-24T20:02:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddbarrientos19](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/eddbarrientos19/32/39313_2.png) [@eddbarrientos19](https://community.dynatrace.com/u/eddbarrientos19)\
**Post date:** [December 24, 2024, 8:02pm UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486/1 "2024-12-24T20:02:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![david\_lopes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_lopes/32/27273_2.png) [@david\_lopes](https://community.dynatrace.com/u/david_lopes)\
**Post date:** [December 24, 2024, 9:53pm UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486/2 "2024-12-24T21:53:50Z")

</div>

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

The [SQL Datasource](https://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)&nbsp; uses an engine called Quartz Scheduler.

This website: [https://www.javainuse.com/cron](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: [Release 1.299.0 · dynatrace-extensions/extensions-schemas · GitHub](https://github.com/dynatrace-extensions/extensions-schemas/releases/tag/1.299.0)

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [December 26, 2024, 10:26am UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486/3 "2024-12-26T10:26:23Z")

</div>

Thanks&nbsp;[@david\_lopes](https://community.dynatrace.com/user/4044)&nbsp;👨‍💻 for providing applicable solution&nbsp;😉&nbsp;:dynaspin:.

[@eddbarrientos19](https://community.dynatrace.com/user/65330)&nbsp;You can proceed with an attempt and keep us posted.

Also PFA resources for more info:

- [https://www.dynatrace.com/hub/detail/custom-database-extension/](https://www.dynatrace.com/hub/detail/custom-database-extension/)
- [About Extensions — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/extensions20/extensions-concepts)
- [SQL data source — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/extensions20/data-sources/sql)

Hoping it adds value.

BR,  
Peter

---

<div class="post-metadata">

**Author:** ![eddbarrientos19](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/eddbarrientos19/32/39313_2.png) [@eddbarrientos19](https://community.dynatrace.com/u/eddbarrientos19)\
**Post date:** [December 26, 2024, 6:03pm UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486/4 "2024-12-26T18:03:39Z")

</div>

Thanks a lot, [@david\_lopes](https://community.dynatrace.com/user/4044)&nbsp;, 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](https://community.dynatrace.com/user/51369)&nbsp;, thanks to you too for the extra info—it was really helpful.

I really appreciate both of you. Cheers!

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [December 26, 2024, 6:06pm UTC](https://community.dynatrace.com/t/error-with-cron-schedule/49486/5 "2024-12-26T18:06:34Z")

</div>

Hi&nbsp;[@eddbarrientos19](https://community.dynatrace.com/user/65330)&nbsp;  
It’s our pleasure to contribute together towards reaching applicable solutions.
