Task execution fails in Spring Cloud Data Flow when using the same name as the app
search cancel

Task execution fails in Spring Cloud Data Flow when using the same name as the app

book

Article ID: 402587

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

When creating a task definition with same name as the task app was registered, the task execution will fail with following error. 

2025-02-26T15:50:18.490+01:00 [APP/TASK/577674ea-5394-4229-8b98-c95e4c82fd1c-|-1a8ce706-af62-4296-860c-c8f5463f9e7e/0] [OUT] 2025-02-26T14:50:18.487Z ERROR 7 --- [batch-sb3-nouveau] [ main] o.s.boot.SpringApplication : Application run failed
2025-02-26T15:50:18.490+01:00 [APP/TASK/577674ea-5394-4229-8b98-c95e4c82fd1c-|-1a8ce706-af62-4296-860c-c8f5463f9e7e/0] [OUT] org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO BATCH_JOB_EXECUTION_PARAMS(JOB_EXECUTION_ID, PARAMETER_NAME, PARAMETER_TYPE, PARAMETER_VALUE, IDENTIFYING)
2025-02-26T15:50:18.490+01:00 [APP/TASK/577674ea-5394-4229-8b98-c95e4c82fd1c-|-1a8ce706-af62-4296-860c-c8f5463f9e7e/0] [OUT] VALUES (?, ?, ?, ?, ?)
2

Environment

Spring Cloud Data Flow for Cloud Foundry prior to 1.14.7

Cause

This is a bug where SCDF adds schema properties to the deployer properties for the task incorrectly.
In previous releases, there was a check to see if the task was a Composed Task Runner (CTR). If so, SCDF would resolve schema properties to each child app within the CTR; if not, it would resolve them to the app specified in the task definition.
The bug is that this check was removed. Now, every task attempts this style of resolution. As a result, if the name of the app matches a definition name in the list of definitions, SCDF uses the CTR resolution strategy, applying the properties for the app name found in the task definition(that shares the name of the used in the launching task definition), rather than the one that was actually run.

Resolution

The issue will be fixed in Spring Cloud Data Flow for Cloud Foundry 1.14.7

As a workaround, avoid naming apps with same name as task definitions.