3

The following ERROR is logged on the gateway worker nodes on start-up.

2016-08-23 12:32:42,344 [-] [Timer-5] ERROR KeyTemplateRetriever Exception when retrieving throttling data from remote endpoint
Unexpected character (<) at position 0.
    at org.json.simple.parser.Yylex.yylex(Unknown Source)
    at org.json.simple.parser.JSONParser.nextToken(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at org.json.simple.parser.JSONParser.parse(Unknown Source)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.retrieveKeyTemplateData(KeyTemplateRetriever.java:100)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.loadKeyTemplatesFromWebService(KeyTemplateRetriever.java:111)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.run(KeyTemplateRetriever.java:54)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Despite the error the gateway worker nodes startup and the environment can be used to successfully invoke a sample API.

All the apim nodes, bar the traffic manager, however report these warnings

2016-08-22 16:40:56,652 [-] [Timer-5]  WARN KeyTemplateRetriever Failed retrieving throttling data from remote endpoint: Connection refused. Retrying after 15 seconds...
2016-08-22 16:40:56,653 [-] [Timer-4]  WARN BlockingConditionRetriever Failed retrieving Blocking Conditions from remote endpoint: Connection refused. Retrying after 15 seconds...

Environment:

  • APIM 2.0.0 cluster
  • publisher (default profile)
  • store (default profile)
  • gw manager and 2 gw workers (default profiles)
  • traffic manager (using traffic-manager profile)
  • Database: MariaDB Server, wsrep_25.10.r4144
  • Userstore : Read/write LDAP
  • JVM: java version "1.8.0_92"
  • OS: CentOS Linux release 7.0.1406 (Core)
  • n.b. key manager un-configured using default pack settings
Simon Trimboy
  • 61
  • 1
  • 5
  • Do you see any errors in key manager logs? – Bee Aug 23 '16 at 14:10
  • No, we have tried to minimize the footprint, and not deploy a dedicated key manager which has been ok with 1.9.1. Unfortunately this has had the side effect of not being able to take advantage of the proper product profiles for pub, store and gateways. – Simon Trimboy Aug 23 '16 at 14:41
  • You mean you have keymanger and gateway worker together in the same server? – Bee Aug 23 '16 at 14:54
  • No actually we have not created a key manager. Prior to this release and the introduction of the traffic manager component, we were able to work without having to configure a key manager. – Simon Trimboy Aug 23 '16 at 15:18
  • So you don't use OAuth2 to secure APIs? Could you please explain your usecase? – Bee Aug 23 '16 at 15:26
  • Sorry this is a demo environment more about showing use of puppet and hashicorp cloud automation tools to build a distributed wso2. However we do want to showcase what would be regarded as a minimum viable distributed deployment - would you suggest dedicated nodes for each product profile ? – Simon Trimboy Aug 23 '16 at 15:33
  • 1) Traffic manager is only required if you use new throttling engine. 2) if you don't need store to be exposed to outside, you can have both store and publisher in the same node. 3) Better to have separate nodes for gateway and key managers. – Bee Aug 23 '16 at 15:39
  • See my answer to get rid of above error, since you don't have key managers. – Bee Aug 23 '16 at 15:42

2 Answers2

2

If you disable Advanced Throttling in api-manager.xml like below, that error will go away. If you enable that, it requires a key manager node.

<EnableAdvanceThrottling>false</EnableAdvanceThrottling>
Bee
  • 12,251
  • 11
  • 46
  • 73
  • I have a setup which uses WSO2 Key Manager for authentication and a third party key manager for authorization. In that case how we need to configure this? – Chintha May 08 '18 at 11:28
1

I encountered the issue recently and the issue was throttle#data#v1.war (repository/deployment/server/webapps/throttle#data#v1.war) hasn't been deployed at the time worker starts up. If you have a distributed AM 2.0 deployment make sure Keymanager is up and throttle#data#v1.war is deployed in keymanager before worker srartup..

  • His deployment is a bit strange. He doesn't have a key manager node. – Bee Aug 25 '16 at 14:08
  • some node should provide the keymanager functionality.. So that node should have the webapp deployed.. KeyManager hostname used for webapp endpoint is derived from "RevokeAPIURL" (in api-manager.xml) configuration internally. – Supun Malinga Aug 25 '16 at 14:45
  • Do we need to configure the RevokeAPIURL in Gateway instance? According to the documentation RevokeAPIURL should be configured in API Store to point to Gateway. – Chintha May 08 '18 at 11:25