3
votes

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
2
Do you see any errors in key manager logs?Bee
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
You mean you have keymanger and gateway worker together in the same server?Bee
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
So you don't use OAuth2 to secure APIs? Could you please explain your usecase?Bee

2 Answers

1
votes

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>
1
votes

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..