Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[policy] [api-key] NoSuchMethod error for an api-key with an expiredAt value #1888

Closed
mknair75 opened this Issue Feb 4, 2019 · 4 comments

Comments

Projects
None yet
5 participants
@mknair75
Copy link

mknair75 commented Feb 4, 2019

After installing the docker images using the docker-compose.yml (followed the link here) , tried the Quick start sample as documented here - https://docs.gravitee.io/apim_quickstart_publish.html

Expected Behavior

Tried URL : GatewayIP:8000/myfirstapi
Echo Server invoked and header and query parameters passed should be reflected

Current Behavior

A blank response with 500 internal error as given below
image

Steps to Reproduce (for bugs)

  1. Created a new API added context and backend
  2. Created a plan with key
  3. Published the API
  4. Created an application
  5. Subscribed to the plan and associated application
  6. Tried the API :8000/myfirstapi with key

Context

Your Environment

Gravitee Docker containers in an Ubuntu 16.04 VM

REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE
mongo                                           3.4                 91170ab1aa1a        9 days ago          374MB
graviteeio/management-ui                        latest              75933f7e8ab4        2 weeks ago         76.5MB
graviteeio/management-api                       latest              c3842393be1d        2 weeks ago         295MB
graviteeio/gateway                              latest              5546c6f456d7        2 weeks ago         275MB
docker.elastic.co/elasticsearch/elasticsearch   5.4.3               2ae8547160a7        19 months ago       548MB
@aelamrani

This comment has been minimized.

Copy link
Member

aelamrani commented Feb 4, 2019

Hi @mknair75

please provide stack trace

@mknair75

This comment has been minimized.

Copy link
Author

mknair75 commented Feb 4, 2019

An error occurs in policy[api-key] error[io.gravitee.gateway.policy.PolicyChainException: io.gravitee.gateway.policy.PolicyException: java.lang.reflect.InvocationTargetException at io.gravitee.gateway.policy.impl.RequestPolicyChain.execute(RequestPolicyChain.java:46) at io.gravitee.gateway.policy.impl.PolicyChain.doNext(PolicyChain.java:74) at io.gravitee.gateway.policy.impl.StreamablePolicyChain.doNext(StreamablePolicyChain.java:55) at io.gravitee.gateway.policy.impl.PolicyChain.process(PolicyChain.java:101) at io.gravitee.gateway.core.processor.ProviderProcessorChain.process(ProviderProcessorChain.java:83) at io.gravitee.gateway.handlers.api.ApiReactorHandler.handleClientRequest(ApiReactorHandler.java:139) at io.gravitee.gateway.handlers.api.ApiReactorHandler.doHandle(ApiReactorHandler.java:123) at io.gravitee.gateway.reactor.handler.AbstractReactorHandler.handle(AbstractReactorHandler.java:88) at io.gravitee.gateway.reactor.impl.DefaultReactor.lambda$route$0(DefaultReactor.java:81) at io.gravitee.gateway.reactor.handler.transaction.TransactionHandler.handle(TransactionHandler.java:57) at io.gravitee.gateway.reactor.handler.transaction.TransactionHandler.handle(TransactionHandler.java:28) at io.gravitee.gateway.reactor.impl.DefaultReactor.route(DefaultReactor.java:92) at io.gravitee.gateway.standalone.vertx.VertxReactorHandler.handle(VertxReactorHandler.java:42) at io.gravitee.gateway.standalone.vertx.VertxReactorHandler.handle(VertxReactorHandler.java:29) at io.vertx.core.http.impl.Http1xServerConnection.processMessage(Http1xServerConnection.java:453) at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:144) at io.vertx.core.http.impl.Http1xServerHandler.handleMessage(Http1xServerHandler.java:74) at io.vertx.core.http.impl.Http1xServerHandler.handleMessage(Http1xServerHandler.java:35) at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146) at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:195) at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:144) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.vertx.core.http.impl.HttpServerImpl$Http2UpgradeHandler.channelRead(HttpServerImpl.java:984) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.vertx.core.http.impl.Http1xOrH2CHandler.end(Http1xOrH2CHandler.java:61) at io.vertx.core.http.impl.Http1xOrH2CHandler.channelRead(Http1xOrH2CHandler.java:38) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) Caused by: io.gravitee.gateway.policy.PolicyException: java.lang.reflect.InvocationTargetException at io.gravitee.gateway.policy.impl.PolicyImpl.invoke(PolicyImpl.java:96) at io.gravitee.gateway.policy.impl.PolicyImpl.onRequest(PolicyImpl.java:49) at io.gravitee.gateway.policy.impl.RequestPolicyChain.execute(RequestPolicyChain.java:44) ... 50 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.gravitee.gateway.policy.impl.PolicyImpl.invoke(PolicyImpl.java:94) ... 52 more Caused by: java.lang.NoSuchMethodError: io.gravitee.gateway.api.Request.timestamp()Ljava/time/Instant; at io.gravitee.policy.apikey.ApiKeyPolicy.onRequest(ApiKeyPolicy.java:93) ... 57 more ]

@mknair75

This comment has been minimized.

Copy link
Author

mknair75 commented Feb 4, 2019

Just noted that the above error is observed only with Key. Keyless API is working fine.

brasseld added a commit to gravitee-io/gravitee-policy-apikey that referenced this issue Feb 4, 2019

@brasseld

This comment has been minimized.

Copy link
Member

brasseld commented Feb 4, 2019

Hi @mknair75

We have a fix. Waiting for validation and release.

@brasseld brasseld changed the title API Management Docker Installation - 500 Internal Error [policy] [api-key] NoSuchMethod error for an api-key with an expiredAt value Feb 4, 2019

@brasseld brasseld added this to the 1.21.5 milestone Feb 6, 2019

NicolasGeraud added a commit to gravitee-io/gravitee-policy-apikey that referenced this issue Feb 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.