[AMAGENTS-258] If the Web agent Installation take more than 4 sec , it will throw "error validating OpenAM agent configuration" Created: 09/Nov/16  Updated: 26/Sep/18  Resolved: 28/Aug/18

Status: Closed
Project: OpenAM Agents
Component/s: Web Agents
Fix Version/s: 5.0.0.0, 4.2.0.0

Type: Improvement Priority: Major
Reporter: Sam Phua Assignee: Mareks Malnacs
Resolution: Fixed Votes: 0
Labels: 4p1-known-issue, QA-Agent5, release-notes
Σ Remaining Estimate: 0h Remaining Estimate: 0h
Σ Time Spent: 1.05h Time Spent: 1.05h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Depends
depends on AMAGENTS-272 Bug in agent's net_client send/recv h... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
AMAGENTS-1888 Document AM_NET_TIMEOUT environment v... Doc Sub-Task Resolved Gene Hirayama  
Verified Version/s:
Cases: 14506, 16466, 16830
Support Ticket IDs:
Epic Link: Web Agent 4.1.1 Release

 Description   

Whenever the web agent installer, OpenAM will search for the "web agent" userid in all the datastores configured in it

It has been reported that if the sql query take a long time ( > 4 sec ) , the web agent installation will fail due to the default timeout of 4 sec

with the following exception in the installation log

2016-11-09 19:51:48  OpenAM Web Agent for Apache server silent installation
2016-11-09 19:51:48  license accepted with --acceptLicence option
2016-11-09 19:51:48  license was accepted earlier
2016-11-09 19:51:48  Found user daemon, uid 2, gid 2
2016-11-09 19:51:48  Found group daemon, gid 2
2016-11-09 19:51:48  validating configuration parameters...
2016-11-09 19:51:48  send_authcontext_request(): sending 478 bytes to http://openam.example.com:8080/openam/authservice
2016-11-09 19:51:48  send_authcontext_request(): response status code: 200
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResponseSet vers="1.0" svcid="auth" reqid="0">
<Response><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<AuthContext version="1.0"><Response authIdentifier="AQIC5wM2LY4SfcxNLEus6KL8UsRPKe4RllCMrr8FUWeHJN4.*AAJTSQACMDEAAlNLABQtMzY0OTY0MDkyODAyNDI5NjU2OAACUzEAAA..*"><LoginStatus status="in_progress"></LoginStatus></Response></AuthContext>]]></Response>
</ResponseSet>
2016-11-09 19:51:48  create_cookie_header(): request header: Cookie: JSESSIONID=560865713D547572387F4A9C331752BC; amlbcookie=01^M
2016-11-09 19:51:48  send_login_request(): sending 1207 bytes to http://openam.example.com:8080/openam/authservice

Notice the timestamp differences of 4 sec <======= 

2016-11-09 19:51:52  send_login_request(): authenticate response status code: 0
(empty)
2016-11-09 19:51:52  am_agent_login(): closing connection after failure
2016-11-09 19:51:52  error validating OpenAM agent configuration
2016-11-09 19:51:52  installation error
2016-11-09 19:51:52  installation exit

This exception can be easily replicated by "freezing" the OpenDJ using a kill -STOP <OpenDJ PID> command

It will be good if we can have a configurable timeout for the installer



 Comments   
Comment by Alex Levin [ 05/Dec/16 ]

Parameter name: AM_NET_TIMEOUT

Comment by Charles Sparey [ 14/Aug/18 ]

Changing versions from 4.1.x. to 4.2 as that will be the next and final 4 series agent release.

Comment by Alex Levin [ 28/Aug/18 ]

reopened to create doc bug.

Comment by Ľubomír Mlích [ 28/Aug/18 ]

Don't see as fixed in 4.1.1-RC2

My reproduction steps:

  1. install AM and slow network responses of AM server - https://jvns.ca/blog/2017/04/01/slow-down-your-internet-with-tc/
  2. try to install agent on second machine with new env OS parameters
### AM server
tc qdisc add dev ens192 root netem delay 4000ms

### agent server
$ export AM_NET_TIMEOUT=10
$ export AM_INSTALL_NET_TIMEOUT=100
$ export AM_NET_POOL_TIMEOUT=100

$ ./agentadmin --s "/etc/httpd/conf/httpd.conf" "http://amqa-clone74.test.forgerock.com:8080/openam" "http://amqa-clone70.test.forgerock.com:80" "/" "clone70" "/root/pwd" --changeOwner --acceptLicence

OpenAM Web Agent for Apache Server installation.


Validating...

Error validating OpenAM - Agent configuration.

Installation failed.
See installation log /opt/web_agents_4.1.1-RC2/apache22_agent/bin/../log/install_20180828095024.log file for more details. Exiting.

$ cat /opt/web_agents_4.1.1-RC2/apache22_agent/bin/../log/install_20180828095024.log
2018-08-28 09:50:24  OpenAM Web Agent for Apache server silent installation
2018-08-28 09:50:24  license accepted with --acceptLicence option
2018-08-28 09:50:24  license was accepted earlier
2018-08-28 09:50:24  Found user apache, uid 48, gid 48
2018-08-28 09:50:24  Found group apache, gid 48
2018-08-28 09:50:24  validating configuration parameters...
2018-08-28 09:50:28  send_authcontext_request(): sending 492 bytes to http://amqa-clone74.test.forgerock.com:8080/openam/authservice
2018-08-28 09:50:32  send_authcontext_request(): response status code: 0
(empty)
2018-08-28 09:50:32  am_agent_login(): closing connection after failure
2018-08-28 09:50:32  error validating OpenAM agent configuration
2018-08-28 09:50:32  installation error
2018-08-28 09:50:32  installation exit
Comment by Mareks Malnacs [ 28/Aug/18 ]

There are no AM_INSTALL_NET_TIMEOUT or AM_NET_POOL_TIMEOUT environment variables in the agent.

Comment by Ľubomír Mlích [ 28/Aug/18 ]

first one didn't work, so I was trying other options to be sure thanks for the note

Comment by Mareks Malnacs [ 28/Aug/18 ]

I'm seeing this:

2018-08-28 12:19:13 validating configuration parameters...
2018-08-28 12:19:33 am_agent_login(): error -13 (operation timed out) connecting to

with
AM_NET_TIMEOUT=20 ./agentadmin ....

The default value is 4 second timeout.

Comment by Ľubomír Mlích [ 28/Aug/18 ]

I still see 4 seconds timeout even if I try with env variable before command

Comment by Ľubomír Mlích [ 28/Aug/18 ]

It is possible that somehow env variable is not taken? Do I have wrong version of agent?

Comment by Ľubomír Mlích [ 06/Sep/18 ]

works well with 4.2.0.0-M1

Comment by Charles Sparey [ 26/Sep/18 ]

Closing as per verification statement above.

Generated at Sun Sep 27 07:34:15 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.