[OPENAM-11773] amster throws missleading error '502 bad gateway' Created: 18/Sep/17  Updated: 10/Oct/17

Status: Open
Project: OpenAM
Component/s: None
Affects Version/s: 14.0.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Bernhard Thalmayr Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: AME, Customer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tomcat 8.5
Java 8
OpenAM 14.0.0


Issue Links:
Relates
Epic Link: AMster (Phase III)
Support Ticket IDs:

 Description   

Bug description

_amster throws error '502 bad gateway' if a REST call could not be handled by the server within the read-timeout. This is misleading because it suggests some HTTP intermediary is in the play. _

How to reproduce the issue

see OPENAM-11770

Expected behaviour
503 error
Current behaviour
502 bad gateway error is raised
excerpt from HTTP RFC
6.6.3.  502 Bad Gateway

   The 502 (Bad Gateway) status code indicates that the server, while
   acting as a gateway or proxy, received an invalid response from an
   inbound server it accessed while attempting to fulfill the request.

---> The server does not act as a gateway or proxy in that case, so the error is not really appropriate.

[main] DEBUG org.forgerock.openam.amster.loadster.importer.Importer - Exception occurred when reading file. 
org.forgerock.openam.sdk.http.ServerErrorException: 502 Bad Gateway
 at org.forgerock.openam.sdk.http.DefaultErrorHandler.onServerError(DefaultErrorHandler.java:62)
 at org.forgerock.openam.sdk.http.HttpSessionImpl.handleUnsuccessfulResponse(HttpSessionImpl.java:273)
 at org.forgerock.openam.sdk.http.HttpSessionImpl.send(HttpSessionImpl.java:169)
 at org.forgerock.openam.sdk.http.RequestBuilder.put(RequestBuilder.java:226)
 at org.forgerock.openam.sdk.crest.CrestResourceProviderAsync.updateInstance(CrestResourceProviderAsync.java:185)
 at org.forgerock.openam.sdk.crest.CrestResourceProviderAsync.update(CrestResourceProviderAsync.java:155)
 at org.forgerock.openam.sdk.crest.HttpCrestResourceProvider.update(HttpCrestResourceProvider.java:158)
 at org.forgerock.openam.sdk.operations.CrestOperations.update(CrestOperations.java:119)
 at org.forgerock.openam.amster.loadster.importer.GenericImporter.importEntity(GenericImporter.groovy:55)
 at org.forgerock.openam.amster.loadster.importer.GenericImporter.importFile(GenericImporter.groovy:33)
 at org.forgerock.openam.amster.loadster.importer.Importer.importFile(Importer.groovy:178)
 at org.forgerock.openam.amster.loadster.importer.Importer.access$0(Importer.groovy)
 at org.forgerock.openam.amster.loadster.importer.Importer$_importGlobalEntities_closure4.doCall(Importer.groovy:134)
< skippe > 
[main] DEBUG org.forgerock.openam.amster.loadster.importer.Importer - Importing file /work/openam5.0.0-amster-import-23913/exported-configuration-data/global/AmsterModule.json
[main] DEBUG org.forgerock.openam.sdk.http.HttpSessionImpl - Sending request org.forgerock.sdk.org.forgerock.http.protocol.Request@237dfbbe
[main] DEBUG org.forgerock.sdk.org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://openam.internal.example.com:8080][total kept alive: 0; route allocated: 0 of 64; total allocated: 0 of 64]
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection leased: [id: 46][route: {}->http://openam.internal.example.com:8080][total kept alive: 0; route allocated: 1 of 64; total allocated: 1 of 64]
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.execchain.MainClientExec - Opening connection {}->http://openam.internal.example.com:8080
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to openam.internal.example.com/172.28.1.229:8080
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connection established 172.28.1.229:50016<->172.28.1.229:8080
[main] DEBUG org.forgerock.sdk.org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-46: set socket timeout to 10000

Generated at Mon Sep 28 00:27:23 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.