AE REST API - callback option of executions endpoint results in HTTP Return Code 500 in the in REST Process log
search cancel

AE REST API - callback option of executions endpoint results in HTTP Return Code 500 in the in REST Process log

book

Article ID: 367062

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Submitting a Callback REST API instruction with the 'curl' command of the following type 

curl \--location 'https://<HOSTNAME>:<PORT_NR>/ae/api/v1/0001/executions' \
\--header 'Content-Type: application/json' \
\--header 'Accept: application/json' \
\--header 'Authorization: Basic XXXXXXXXXXXX' \
\--data '@/C:/<FOLDER1>/<FOLDER2>/POST_executions_with_callback_500.json'

with an empty json file  (--data parameter in the call) reruns an HTTP 500 error code.

This is a misleading behavior, in case of incorrect content (missing parameters, wrong syntax) the return code should always be 4XX.

In the shell where the curl instruction was submitted, a Java stack error containing an HTTP 500 return code shows up:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 java.lang.NullPointerException</title>
</head>
<body><h2>HTTP ERROR 500 java.lang.NullPointerException</h2>
<table>
.........
</table> <h3>Caused by:</h3><pre>java.lang.NullPointerException ......... </pre> </body> </html>

Interestingly, the same REST API submitted via Postman, with the same empty file in the request body, gets this response

{
&nbsp; &nbsp; "code": 45106,
&nbsp; &nbsp; "error": "The request is invalid and cannot be processed by the Automation Engine.",
&nbsp; &nbsp; "details": "No detail information available."
}

Environment

Automation Engine 24.0

Cause

This is a defect of the Automation Engine 24.0.0

Description:

A problem has been solved where the Rest-API returned HTTP Code 500 (Internal Server Error) on the /executions endpoint when an empty request body was used. Now it returns HTTP Code 400 (Bad Request)

Resolution

This bug is fixed in:

Version 24.1.0 of the Automation Engine.

 

Additional Information

Bug ID: AE-36881
Bug Title: AE REST API - callback option of executions endpoint results in HTTP RC 500 & NPE in REST Process log