Tanzu Data Flow: Troubleshooting Task Schedule Creation Failures and HTTP 400/500 / IllegalArgumentException Errors in Tanzu Data Flow via cURL / REST API
search cancel

Tanzu Data Flow: Troubleshooting Task Schedule Creation Failures and HTTP 400/500 / IllegalArgumentException Errors in Tanzu Data Flow via cURL / REST API

book

Article ID: 454527

calendar_today

Updated On:

Products

VMware Tanzu Data VMware Tanzu Data Suite VMware Tanzu Data Suite VMware Tanzu Data Intelligence

Issue/Introduction

Task schedule creation succeeds in the Tanzu Data Flow / Spring Cloud Data Flow (SCDF) UI in most cases, but fails when using cURL or direct REST API calls.POST /tasks/schedules returns 400 Bad Request or 500 Internal Server Error with one of the following messages:

  • request's scheduleProperties must have a spring.cloud.scheduler.cron.expression or spring.cloud.deployer.cloudfoundry.cron.expression that is not null nor empty
  • Only deployment property keys starting with 'app.' or 'deployer.' or 'version.' allowed.
  • MissingServletRequestParameterException: Required request parameter 'taskDefinitionName' ... is not present

Note: The second error can also appear in the UI on certain older Tanzu Data Flow versions due to incorrect property prefix injection.

Environment

  • VMware Tanzu Data Flow / Spring Cloud Data Flow
  • Platform: Pivotal Cloud Foundry / Tanzu Application Service (TAS)
  • Scheduler: PCF Scheduler (Quartz-style 6-field cron expressions)

Cause

  1. Property Prefix / Namespacing Misconfiguration
    The SCDF server strictly validates that all deployment properties start with app., deployer., or version..
    For Cloud Foundry task schedules the cron expression must be supplied under a fully-qualified deployer key (commonly deployer..cloudfoundry.cron.expression).
    Using a bare scheduler.cron.expression, an incomplete key, or a key that does not match the expected form for the installed version triggers the validation or “must have a …cron.expression” errors.
    Exact key names can vary slightly by Tanzu Data Flow / SCDF version and platform (Cloud Foundry vs Kubernetes).
  2. Cron Expression Encoding / Parsing Error
    Unencoded spaces and special characters (?, *) inside a 6-field Quartz cron expression (e.g. 0 0 13 ? * MON-FRI) cause the form-urlencoded parser to truncate the value. The server therefore receives an incomplete or empty cron property.
  3. Missing Required Parameters
    Omitting taskDefinitionName (or, on some configurations, platform) produces the MissingServletRequestParameterException.

Resolution

1. Use the correct fully-qualified property key for Cloud Foundry:

deployer..cloudfoundry.cron.expression=

2. Always URL-encode property values that contain spaces or special characters. Prefer --data-urlencode with cURL.

3. Include the platform parameter (normally default).

Recommended cURL example

curl -H "Authorization: $(cf oauth-token)" \
  -X POST "https://<SCDF_HOST>/tasks/schedules" \
  -d "scheduleName=my-schedule" \
  -d "taskDefinitionName=my-task-v1" \
  -d "platform=default" \
  -d "properties=deployer.my-task-v1.cloudfoundry.cron.expression=0%200%2013%20?%20*%20MON-FRI" \
  -d "properties=deployer.my-task-v1.cloudfoundry.services=my-service" \
  --data-urlencode "arguments=--spring.profiles.active=prod,cloud"

 

Alternative (single properties parameter)

You may also pass a comma-separated list inside one --data-urlencode "properties=..." statement; the multi-parameter form above is clearer and less error-prone.

Additional Information

Additional Guidance

  • Prefer the Data Flow shell command when possible — it handles encoding and property translation automatically:

    task schedule create --name my-schedule --definitionName my-task-v1 --expression "0 0 13 ? * MON-FRI" --platform default

  • After creation, verify with:
    • GET /tasks/schedules (REST)
    • task schedule list (shell)
  • Inspect a schedule that was successfully created via the UI to confirm the exact property key stored by your particular Tanzu Data Flow / SCDF version.

  • The same encoding rules apply to any other property value that contains spaces or special characters.

Verification

A successful response returns HTTP 201 (or 200 in some versions) and the new schedule appears in the schedule list with the expected cron expression.

Reference: