Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-1201

APIMAN Import issue - Client/Clientapp receives 500 error on the first request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.3.x, 1.3.4.Final
    • None
    • Gateway API
    • None

      When I export data from APIMAN 1.2.6 and import the same data back into another fresh instance of APIMAN 1.2.6, my first request to API gives following error. If I hit the refresh, request goes through. Please find detailed steps for you to reproduce it.

      Detailed steps to reproduce the error

      1. Install apiman-1.2.6.Final quickstart overlay in wildfly 10.0.0
      2. Once it's up and running, create an organization, a plan with rate limiting policy, an API, and a client w/ contract that uses that API
      3. lock, register, and publish everything
      4. Export the configuration
      5. Import the configuration in a fresh instance of apiman-1.2.6.Final
      6. Hit the public managed endpoint with the apikey

      Expected result:

      The endpoint works and passes through to the underlying service.

      Actual result:

      On the first try, the following response:

      { 
          "responseCode": 500, 
          "message": "com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$CRYPT': was expecting ('true', 'false' or 'null')
       at [Source: $CRYPT::xxmjOWK0XZOWp/nWdFYC4vJwABacW0Pf/EH/4Z+t/sH2bYEcPD6jXPONbmPvTwWgnQY2rHQFDxfhalvKu0FiTA==; line: 1, column: 7]", 
          "trace": "io.apiman.gateway.engine.beans.exceptions.ConfigurationParseException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$CRYPT': was expecting ('true', 'false' or 'null')
       at [Source: $CRYPT::xxmjOWK0XZOWp/nWdFYC4vJwABacW0Pf/EH/4Z+t/sH2bYEcPD6jXPONbmPvTwWgnQY2rHQFDxfhalvKu0FiTA==; line: 1, column: 7]
              at io.apiman.gateway.engine.policies.AbstractMappedPolicy.parseConfiguration(AbstractMappedPolicy.java:54)
              at io.apiman.gateway.engine.policy.PolicyFactoryImpl.loadConfig(PolicyFactoryImpl.java:74)
              at io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.lambda$loadPolicies$7(ApiRequestExecutorImpl.java:607)
              at io.apiman.gateway.engine.policy.PolicyFactoryImpl.doLoadFromClasspath(PolicyFactoryImpl.java:148)
              at io.apiman.gateway.engine.policy.PolicyFactoryImpl.loadPolicy(PolicyFactoryImpl.java:107)
              at io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.loadPolicies(ApiRequestExecutorImpl.java:603)
              at io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.lambda$execute$6(ApiRequestExecutorImpl.java:391)
              at io.apiman.gateway.engine.impl.SecureRegistryWrapper$3.handle(SecureRegistryWrapper.java:172)
              at io.apiman.gateway.engine.impl.SecureRegistryWrapper$3.handle(SecureRegistryWrapper.java:154)
              at io.apiman.gateway.engine.es.CachingESRegistry.getContract(CachingESRegistry.java:101)
              at io.apiman.gateway.engine.impl.SecureRegistryWrapper.getContract(SecureRegistryWrapper.java:154)
              at io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.execute(ApiRequestExecutorImpl.java:357)
              at io.apiman.gateway.platforms.servlet.GatewayServlet.doAction(GatewayServlet.java:179)
              at io.apiman.gateway.platforms.servlet.GatewayServlet.service(GatewayServlet.java:79)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$CRYPT': was expecting ('true', 'false' or 'null')
       at [Source: $CRYPT::xxmjOWK0XZOWp/nWdFYC4vJwABacW0Pf/EH/4Z+t/sH2bYEcPD6jXPONbmPvTwWgnQY2rHQFDxfhalvKu0FiTA==; line: 1, column: 7]
              at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1487)
              at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2299)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1458)
              at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)
              at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:345)
              at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1426)
              at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1081)
              at io.apiman.gateway.engine.policies.AbstractMappedPolicy.parseConfiguration(AbstractMappedPolicy.java:52)
              ... 41 more
      "
      }
      
      

      Everything seems to work as expected on successive tries. Note that if I restart wildfly I will again get the 500 on the first try only.

              msavy_jira Marc Savy (Inactive)
              mjoyappa_jira Mohan Joyappa (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: