REST API call fails with PERL

Document ID : KB000084564
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Error Message :
"code" : 45110,
"error" : "An Automation Engine internal error occured.",
"details" : "No detail information available."

REST API calls fail when issued with PERL.

Investigation

Run a code like below :

use REST::Client;
use JSON;
# Data::Dumper makes it easy to see what the JSON returned actually looks like
# when converted into Perl data structures.
use Data::Dumper;
use MIME::Base64;

$lgnr="4655512026";
$klgnr="465551202";
$parameter="BRGEV";
$stadtwerke=" ";
$transid="K0000626";
$dsn="P.ABR.TAB";
$sprache="D";
$date="210917";
$ftpfilepath="c:\\temp";
#$transid="api.txt";

my $username = 'AUTOMIC/AUTOMIC';
my $password = 'AUTOMIC';

my %request_abronl_map = (
'object_name' => "ABRE.$demand1",
'inputs' => {'VLGNR#' => "$lgnr", 'BLGNR#' => "$lgnr",'VLGNRK#' => "$klgnr",'BLGNRK#' => "$klgnr",'P2950#' => "$parameter",'STWK#' => "$stadtwerke",'JOBNAM#' => "$transid",'DSN#' => "$dsn",'SPRA#' => "$sprache",'DATUM#' => "$datum"}
);

my $encoded_auth = encode_base64("$username:$password", '');

my $client = REST::Client->new();

$client->setHost('http://<AE_host:8088/ae/api/v1');
# POST to the incident table
$client->POST('/3/executions',
encode_json(\%request_abronl_map),
{'Authorization' => "Basic $encoded_auth",
'Content-Type' => 'application/json',
'Accept' => 'application/json'}
);

print 'Response: ' . $client->responseContent() . "\n";

Results

The request will fail and get this JSON response :
Response: {
"code" : 45110,
"error" : "An Automation Engine internal error occured.",
"details" : "No detail information available."
}
Cause:
Cause type:
Defect
Root Cause: As mentioned this seems to be a multithreading issue with declarative services. Exact cause unknown, it seems like the DS version we are currently using (1.4.100.v20130515) cannot handle nested components threadsafely if they are all set to immediate instantiation. This causes DS to skip calling the bind method in one component.

Setting component instantiation to "on-demand" (immediate=false) seems to bypass this issue.
Resolution:
Update the Automation Engine to version 12.1.1 or later.

Fix Status: Released

Fix Version(s):
Component(s): Automation Engine - REST API

Automation Engine 12.1.1 - Available
Additional Information:
Workaround :
N/A