-
Notifications
You must be signed in to change notification settings - Fork 617
Add documentation for using health indicators without access to the default database. #2019
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
Comments
Gerrit Meier commented Thanks for bringing this to our attention. |
Sledge Hammer commented I copied the sample you made above with some slight clean up. This is my movies config. The fitness config is exactly the same minus the bean names, etc. and of course no primary. So I would have thought the movies driver would be up and the fitness driver down if anything :). I'll try step through the health check and see if I see anything. It would difficult to rip this out into a standalone demo with all the entities and stuff.
} |
Sledge Hammer commented Some preliminary findings: The Neo4jReactiveHealthIndicator constructor does in fact get called twice as expected. 2020-12-07 15:26:32.545 INFO 55000 --- [ main] Driver : Direct driver instance 1419816353 created for server address localhost:7687 First call, I get passed driver 54a0ada1 which is the 14198 one. Second call, I get passed driver 51b22f06 which is the 13706 one. Then I get called repeatedly where only 54a0ada1 gets passed in. Kind of hard to follow what's what... but it seems like you should account for all driver beans rather then just the one. I don't seem to be getting any generic driver or auto-configured driver since I'm not using the standard properties, but I don't seem to be able to see anything like database, etc. in the debugger |
Sledge Hammer commented Aside from it appearing that only one driver been seems to be updating, isn't this an issue too?
In my code to get the path stuff working, I did something like this:
Copied from AutoCloseableQueryRunner. I had to get the session for the database rather then just the default one |
Hello Sledge Hammer. I cannot find your handle on GitHub, so I just hope you might see this issue. This is not something we can fix in Spring Data Neo4j. I updated my example you linked in the issue with one possible solution. Feel free to open a ticket at Boot to about that topic. I'm super happy to help the colleagues over there to create something similar built in. The driver itself does not know anything about a database or not, just about the server or cluster. |
…s to the default database. This closes #2019.
…s to the default database. This closes #2019.
Sledge Hammer opened DATAGRAPH-1458 and commented
Based on your sample here for multiple databases with different usernames and security:
https://github.com/michael-simons/neo4j-examples-and-tips/tree/master/examples/sdn6-multidb-multi-connections/src/main/java/org/neo4j/tips/sdn/sdn6multidbmulticonnections
All is working in the app :) and I am able to connect to both DBs. However, I recently tested with Spring Boot Admin which calls the actuator health checks in my app and discovered that the health check doesn't seem to be consuming the correct beans / credentials.
I'm marking all the movie beans as primary, but oddly, the fitness driver is showing up, but the movies driver is showing down.
neo4jDOWN
fitnessDriverUP
server Neo4j/4.0.0@localhost:7687
edition enterprise
database fitness
moviesDriverDOWN
error org.neo4j.driver.exceptions.ClientException: Database access is not allowed for user 'movies' with roles [movies_reader].
The full stack trace is:
org.neo4j.driver.exceptions.ClientException: Database access is not allowed for user 'movies' with roles [movies_reader].
at org.neo4j.driver.internal.util.ErrorUtil.newNeo4jError(ErrorUtil.java:80)
at org.neo4j.driver.internal.async.inbound.InboundMessageDispatcher.handleFailureMessage(InboundMessageDispatcher.java:105)
at org.neo4j.driver.internal.messaging.v1.MessageReaderV1.unpackFailureMessage(MessageReaderV1.java:83)
at org.neo4j.driver.internal.messaging.v1.MessageReaderV1.read(MessageReaderV1.java:59)
at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:83)
at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:35)
at org.neo4j.driver.internal.shaded.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at org.neo4j.driver.internal.async.inbound.MessageDecoder.channelRead(MessageDecoder.java:47)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at org.neo4j.driver.internal.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
Affects: 6.0.1 (2020.0.1)
The text was updated successfully, but these errors were encountered: