Cron example from docs not working in code (puppet failure)

I am getting the following error from puppet/sensuctl, saying that I cannot create a resource (check) because what I put in the “cron” field is invalid:

Notice: /Stage[main]/Profile_sensu::Checks::Postgres/Sensu_check[postgres_active_connections in team15]/cron: defined 'cron' as '* * * * *'
Error: /Stage[main]/Profile_sensu::Checks::Postgres/Sensu_check[postgres_active_connections in team15]: Could not evaluate: sensuctl create postgres_active_connections in team15 failed
Error message: Execution of '/usr/bin/sensuctl create --file /tmp/sensuctl20200604-107855-1qo18jp' returned 1: Error: error putting resource #0 with name "postgres_active_connections" and namespace "team15" (/api/core/v2/namespaces/team15/checks/postgres_active_connections): resource is invalid: must only specify either an interval or a cron schedule

However, specifying the cron interval of ‘* * * * *’ is listed in the sensu docs example as a valid cron statement: https://docs.sensu.io/sensu-go/latest/reference/checks/#cron-scheduling

Examples of valid cron values include:

cron: CRON_TZ=Asia/Tokyo * * * * *
cron: TZ=Asia/Tokyo * * * * *
cron: '* * * * *'

So I don’t know why it’s saying ‘* * * * *’ is not a valid cron schedule.

Hmm I have sensu 5.20.2 installed and sensuctl is able to create that cron schedule for me.
I just did
sensuctl check create --interactive without issue
I was able to do use:
sensuctl check create cron_test --cron "CRON_TZ=Asia/Tokyo * * * * *" --command "echo 'cron test'" -s "test".

This may be a puppet specific escape string issue so the string is passed verbatim? Sorry I can’t help with the puppet specific issues, but sensuctl definitely seems to be working for me.

@amccrea what’s your puppet manifest for the check look like?

Nevermind, Sensu support helped me with this one – Turns out “interval” as well as “cron” was set for the check. I’m using puppet, and the “Interval” parameter was pulled out and put at the top of the puppet manifest to be applied to ALL sensu checks, so I’d completely forgotten when I wrote this new check at the bottom with an added cron parameter. Thanks anyway!