Comments (12)
@dant3 2.2.2 of this module was released with this fix
from micronaut-discovery-client.
@timmki I can't reproduce this. I have consul running in docker:
==> Starting Consul agent...
Version: 'v1.8.0'
sample-projects $ mn -V
Micronaut Version: 2.0.0
JVM Version: 1.8.0_252
mn create-app test-consul --features discovery-consul
Running ./gradlew run
11:23:26 AM: Executing task 'run'...
> Task :compileJava
> Task :processResources
> Task :classes
> Task :run
11:23:30.257 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 2100ms. Server Running: http://localhost:8080
11:23:30.566 [nioEventLoopGroup-1-2] INFO i.m.d.registration.AutoRegistration - Registered service [test-consul] with Consul
from micronaut-discovery-client.
Can you try it again with a Consul v1.7.4? As I stated in my report, we updated our Consul to a v1.7.x version. Maybe the problem is gone with 1.8.0 which would be fine for me also.
Our consul configuration looks like this:
consul:
client:
enabled: true
defaultZone: "consul:8500"
registration:
enabled: true
tags:
- "default"
deregister: true
prefer-ip-address: true
ip-addr: "${SERVICE_ADDRESS:}"
health-path: /health
check:
id: ${random.shortuuid}
enabled: true
interval: 15s
deregister-critical-service-after: 60s
http: true
from micronaut-discovery-client.
@timmki I'm not able to reproduce with default config with 1.7.4. With that config I'm getting
09:10:48.974 [nioEventLoopGroup-1-5] ERROR i.m.d.registration.AutoRegistration - Error occurred during service registration with Consul: Request decode failed: json: unknown field "direct"
from micronaut-discovery-client.
@timmki I'm not able to reproduce with default config with 1.7.4. With that config I'm getting
09:10:48.974 [nioEventLoopGroup-1-5] ERROR i.m.d.registration.AutoRegistration - Error occurred during service registration with Consul: Request decode failed: json: unknown field "direct"
Thanks for checking. Then it might be some error on my configuration. Sorry for not providing the snippet above in the bug report. Do you have a hint for me what is wrong with my configuration? Your error message is still not revealing any further hints for me to solve the issue.
from micronaut-discovery-client.
@timmki can you try with Micronaut 2.0.0?
from micronaut-discovery-client.
We're seeing this with Micronaut 2.0.1 again. Consul is 1.9.0
The exact stacktrace logged from DiscoveryServiceAutoRegistration$1 is
io.micronaut.http.client.exceptions.HttpClientResponseException: Request decode failed: json: unknown field "ID"
at io.micronaut.http.client.netty.DefaultHttpClient$12.channelRead0(DefaultHttpClient.java:2097)
at io.micronaut.http.client.netty.DefaultHttpClient$12.channelRead0(DefaultHttpClient.java:2015)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.micronaut.http.netty.stream.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:193)
at io.micronaut.http.netty.stream.HttpStreamsClientHandler.channelRead(HttpStreamsClientHandler.java:183)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
Application is shutting down afterwards.
from micronaut-discovery-client.
The problem is the json micronaut generates to register:
{"Name":"backend","Address":"redacted","Port":8080,"Tags":["stage"],"Meta":{},"Checks":[{"DeregisterCriticalServiceAfter":null,"Name":null,"Status":"passing","Notes":null,"TTL":"25s","ID":null}],"ID":"backend:8080"}
Notice that Checks[0] has field "ID":null
After Consul 1.7 this field is invalid, it should be "CheckID"
from micronaut-discovery-client.
The specific problematic class is NewCheck which encodes id as "ID", while it should be "CheckID"
from micronaut-discovery-client.
Temporary workaround is to set registration.check.enabled = false in your configs, if it's acceptable in your usecase until this issue gets fixed
from micronaut-discovery-client.
I am facing the same issue with Micronaut 2.2.3 and consul - 1.9.1
[default-nioEventLoopGroup-1-5] ERROR i.m.d.registration.AutoRegistration - Error occurred during service registration with Consul: Request decode failed: json: unknown field "ID
io.micronaut.http.client.exceptions.HttpClientResponseException: Request decode failed: json: unknown field "ID"
at io.micronaut.http.client.netty.DefaultHttpClient$12.channelRead0(DefaultHttpClient.java:2140)
at io.micronaut.http.client.netty.DefaultHttpClient$12.channelRead0(DefaultHttpClient.java:2055)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.micronaut.http.netty.stream.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:193)
at io.micronaut.http.netty.stream.HttpStreamsClientHandler.channelRead(HttpStreamsClientHandler.java:183)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:832)
from micronaut-discovery-client.
Which release will include this fix?
from micronaut-discovery-client.
Related Issues (20)
- Attempt to replace Jackson with Micronaut Serialization HOT 1
- Migrate to new configuration ascidoc macro
- Add flag for use name as prefix HOT 2
- Add native test
- VaultConfigurationClient failed if 1 path is not found HOT 1
- Dash '-' not working for activeName for Consul PropertySource name HOT 2
- Consul deregistration not working for multi-registered application HOT 1
- Error occurred during service registration with Consul, app throw UnimplementedAdviceException HOT 10
- Micronaut won't start (throws exception) when "discovery-client" feature is enabled HOT 2
- version 4 do no contains some fixes done in version 3
- Microanut service registration for consul and eureka does not startup, will not fully register the service HOT 13
- Unable to run test locally HOT 1
- Microanut service registration for consul client will resutle in a failure even if the service is registered HOT 8
- CI Java 21 for Discovery Client
- Issue with resolving environment in consul config
- Registration with Eureka doesn't work when using Micronaut serialization
- GRPC service execution is throwing exceptions when updating to 4.2 micronaut HOT 1
- Del @Deprecated Discovery Client
- SpringCloud Config Client doesn't work with Micronaut Serialization
- Consul Client doesn't work when using Micronaut serialization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronaut-discovery-client.