CA WA Agent for Application Intermittent error java.net.SocketException Invalid argument for HTTP job
search cancel

CA WA Agent for Application Intermittent error java.net.SocketException Invalid argument for HTTP job

book

Article ID: 100396

calendar_today

Updated On:

Products

Workload Automation Agent CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation DE - Business Agents (dSeries)

Issue/Introduction

We are using the HTTP job type to send a POST to an internal restful web service and we are sometimes receiving the following error:

Unhandled exception: Invalid argument
java.net.SocketException: Invalid argument @at java.net.SocketInputStream.socketRead(SocketInputStream.java:127)
@at java.net.SocketInputStream.read(SocketInputStream.java:181)
@at java.net.SocketInputStream.read(SocketInputStream.java:152)
@at com.ibm.jsse2.a.a(a.java:79)
@at com.ibm.jsse2.a.a(a.java:182)
@at com.ibm.jsse2.as.a(as.java:883)
@at com.ibm.jsse2.as.a(as.java:382)
@at com.ibm.jsse2.e.read(e.java:16)

Environment

CA Workload Automation Agent for Application Services

Cause

The initial connection failed with 401 Unauthorized "Invalid user name or password".

The commons_wrapper_log.log has the complete sequence:
- POST sent
- 401 Unauthorized response received
- POST sent
- socket disconnected with no response

>> "POST /passengerservrpt/psr/report/priiadelay/email HTTP/1.1[\r][\n]"
>> "Content-Length: 34[\r][\n]"
>> "Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1[\r][\n]"
>> "Host: psrs.cn.ca[\r][\n]"
>> "Connection: Keep-Alive[\r][\n]"
>> "User-Agent: Apache-HttpClient/4.1.2 (java 1.5)[\r][\n]"
>> "[\r][\n]"
>> "originDate=2018-03-31&options=BOTH"
<< "HTTP/1.1 401 Unauthorized[\r][\n]"
<< "X-Powered-By: Servlet/3.0[\r][\n]"
<< "WWW-Authenticate: Basic realm="psr"[\r][\n]"
<< "Content-Type: text/html[\r][\n]"
<< "$WSEP: [\r][\n]"
<< "Date: Mon, 02 Apr 2018 12:34:10 GMT[\r][\n]"
<< "Last-Modified: Tue, 27 Feb 2018 19:11:09 GMT[\r][\n]"
<< "Content-Length: 379[\r][\n]"
<< "Content-Language: en-US[\r][\n]"
<< "[\r][\n]"
<< "<!doctype html>[\r][\n]"
<< "<html lang="en-US">[\r][\n]"
<< "<head>[\r][\n]"
<< " <meta http-equiv="Content-Type" content="text/html; charset=utf-8">[\r][\n]"
<< " <title>Login Error</title>[\r][\n]"
<< " <link rel="shortcut icon" href="favicon.ico">[\r][\n]"
<< " <link rel="icon" href="favicon.ico">[\r][\n]"
<< " <link rel="stylesheet" type="text/css" href="styles.css"> [\r][\n]"
<< "</head>[\r][\n]"
<< "[\r][\n]"
<< "<body>[\r][\n]"
<< " <h2>Invalid user name or password.</h2>[\r][\n]"
<< "</body>[\r][\n]"
<< "</html>
 

Resolution

The default setting is to retry failed connections 3 times, but the server seems configured to disconnect instead of responding when retries come in too quickly .

The default retry setting can be changed by adding this line to the agent's agentparm.txt and restarting the agent:

http.client.retry=0

Note - The default value used to be 0, but the underlying libraries changed and the default became 3. You need to restart the agent for the change to be effected.