Closed
Description
So we can address your issue, please include the following:
Version of MarkLogic Java Client API
See Readme.txt
Version of MarkLogic Server
9.0-nightly
See admin gui on port 8001 or run xdmp:version() in Query Console - port 8000)
Java version
8
Run java -version
OS and version
For MAC, run sw_vers
.
For Windows, run systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
For Linux, run cat /etc/os-release
and uname -r
Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end
Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)
- This issue is seen during whitelisting the load balancer host in a Write or QueryBatcher when forest is present in only one node in a 3 node cluster.
- WhiteListing the loadbalancer host calls the "/v1/internal/forestinfo" endpoint . The response from this endpoint is different when the request is sent to the node with forest compared to the one when the node doesn't have the forest.
- Response when the request is made to node with forest: [{"id":"9452417359753237858", "name":"Documents", "updatesAllowed":"all", "database":"Documents", "host":"ip-10-0-64-213.us-west-2.compute.internal", "requestHost":"ageorge-b-elasticl-11k9wnna7aftn-118865705.us-west-2.elb.amazonaws.com"}]
Response when the request is made to node without forest: [{"id":"9452417359753237858", "name":"Documents", "updatesAllowed":"all", "database":"Documents", "host":"ip-10-0-64-213.us-west-2.compute.internal"}] - Since the second response doesn't contain the requestHost, validHosts.length returns zero in line 166 of FilteredForestConfiguration.java and the following exception is thrown
java.lang.IllegalStateException: White list or black list rules are too restrictive: no valid hosts are left
at com.marklogic.client.datamovement.FilteredForestConfiguration.lambda$8(FilteredForestConfiguration.java:167)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:545)
at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:438)
at com.marklogic.client.datamovement.FilteredForestConfiguration.listForests(FilteredForestConfiguration.java:195)
at com.marklogic.client.datamovement.impl.WriteBatcherImpl.withForestConfig(WriteBatcherImpl.java:786)
at com.marklogic.client.datamovement.impl.WriteBatcherImpl.withForestConfig(WriteBatcherImpl.java:1)
at com.marklogic.client.datamovement.functionaltests.Common.initBatcher(Common.java:19)
at com.marklogic.client.datamovement.functionaltests.StringQueryHostBatcherTest.testQueryBatcherCallbackClient(StringQueryHostBatcherTest.java:1125)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Expected output: What specifically did you expect to happen?
The host has to be whitelisted.