Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

com.microsoft.azure.documentdb.DocumentClient - Failed to retrieve database account information #12

Closed sgireddy closed 6 years ago

sgireddy commented 6 years ago

Hi!, Thank you for building RxJava client for cosmos, I got the following exception from my code and the example provided, I am using OSX.

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:61888,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/tools.jar:/Users/shashigireddy/code/git/azure-documentdb-rxjava/azure-documentdb-examples/target/test-classes:/Users/shashigireddy/.m2/repository/com/microsoft/azure/azure-documentdb-rx/0.9.0-rc2/azure-documentdb-rx-0.9.0-rc2.jar:/Users/shashigireddy/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar:/Users/shashigireddy/.m2/repository/io/reactivex/rxjava/1.2.5/rxjava-1.2.5.jar:/Users/shashigireddy/.m2/repository/io/reactivex/rxjava-string/1.1.1/rxjava-string-1.1.1.jar:/Users/shashigireddy/.m2/repository/com/microsoft/azure/azure-documentdb/1.13.0/azure-documentdb-1.13.0.jar:/Users/shashigireddy/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.3/jackson-databind-2.8.3.jar:/Users/shashigireddy/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/shashigireddy/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.3/jackson-core-2.8.3.jar:/Users/shashigireddy/.m2/repository/org/json/json/20140107/json-20140107.jar:/Users/shashigireddy/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar:/Users/shashigireddy/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/shashigireddy/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/shashigireddy/.m2/repository/org/apache/httpcomponents/httpcore/4.4.6/httpcore-4.4.6.jar:/Users/shashigireddy/.m2/repository/io/reactivex/rxnetty/0.4.20/rxnetty-0.4.20.jar:/Users/shashigireddy/.m2/repository/io/reactivex/rxnetty-servo/0.4.20/rxnetty-servo-0.4.20.jar:/Users/shashigireddy/.m2/repository/com/netflix/servo/servo-core/0.7.5/servo-core-0.7.5.jar:/Users/shashigireddy/.m2/repository/com/google/code/findbugs/annotations/2.0.0/annotations-2.0.0.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-codec-http/4.1.7.Final/netty-codec-http-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-codec/4.1.7.Final/netty-codec-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-handler/4.1.7.Final/netty-handler-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-buffer/4.1.7.Final/netty-buffer-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-transport/4.1.7.Final/netty-transport-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-resolver/4.1.7.Final/netty-resolver-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-transport-native-epoll/4.1.7.Final/netty-transport-native-epoll-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/io/netty/netty-common/4.1.7.Final/netty-common-4.1.7.Final.jar:/Users/shashigireddy/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/Users/shashigireddy/.m2/repository/io/reactivex/rxjava-guava/1.0.3/rxjava-guava-1.0.3.jar:/Users/shashigireddy/.m2/repository/com/google/guava/guava/19.0-rc1/guava-19.0-rc1.jar:/Users/shashigireddy/.m2/repository/junit/junit/4.12/junit-4.12.jar:/Users/shashigireddy/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/shashigireddy/.m2/repository/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar:/Users/shashigireddy/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar:/Users/shashigireddy/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar:/Users/shashigireddy/.m2/repository/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6.jar:/Users/shashigireddy/.m2/repository/org/slf4j/slf4j-log4j12/1.7.6/slf4j-log4j12-1.7.6.jar:/Users/shashigireddy/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest,testCreateDatabase_Async
Connected to the target VM, address: '127.0.0.1:61888', transport: 'socket'
2017-11-28 13:46:59,408       [main] INFO  com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl - Initializing DocumentClient with serviceEndpoint [https://xxxxxxxxxxxxxx.documents.azure.com:xxxxx/], ConnectionPolicy [ConnectionPolicy [requestTimeout=60, mediaRequestTimeout=300, connectionMode=Gateway, mediaReadMode=Buffered, maxPoolSize=100, idleConnectionTimeout=60, userAgentSuffix=, retryOptions=com.microsoft.azure.documentdb.RetryOptions@58c1c010, enableEndpointDiscovery=true, preferredLocations=null]], ConsistencyLevel [Session]
2017-11-28 13:46:59,903       [main] INFO  com.microsoft.azure.documentdb.DocumentClient - Initializing DocumentClient with serviceEndpoint [https://xxxxxxxxxxxxxx.documents.azure.com:xxxxx/], ConnectionPolicy [ConnectionPolicy [requestTimeout=60, mediaRequestTimeout=300, connectionMode=Gateway, mediaReadMode=Buffered, maxPoolSize=100, idleConnectionTimeout=60, userAgentSuffix=, retryOptions=com.microsoft.azure.documentdb.RetryOptions@58c1c010, enableEndpointDiscovery=true, preferredLocations=null]], ConsistencyLevel [Session]
2017-11-28 13:47:00,385       [main] WARN  com.microsoft.azure.documentdb.DocumentClient - Failed to retrieve database account information. org.apache.http.NoHttpResponseException: The target server failed to respond
2017-11-28 13:47:03,241       [main] INFO  com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest - cleanup databases invoked
2017-11-28 13:47:03,447       [RxDocdb-io1] WARN  com.microsoft.azure.documentdb.DocumentClient - Failed to retrieve database account information. org.apache.http.NoHttpResponseException: The target server failed to respond
java.lang.RuntimeException: org.apache.http.NoHttpResponseException: The target server failed to respond
    at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464)
    at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
    at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.cleanUpGeneratedDatabases(DatabaseAndCollectionCreationAsyncAPITest.java:243)
    at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.setUp(DatabaseAndCollectionCreationAsyncAPITest.java:100)
    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.RunBefores.evaluate(RunBefores.java:24)
    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.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.apache.http.NoHttpResponseException: The target server failed to respond
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
    at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
    at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at com.microsoft.azure.documentdb.internal.GatewayProxy.performPostRequest(GatewayProxy.java:270)
    at com.microsoft.azure.documentdb.internal.GatewayProxy.doQuery(GatewayProxy.java:129)
    at com.microsoft.azure.documentdb.internal.GatewayProxy.processMessage(GatewayProxy.java:343)
    at com.microsoft.azure.documentdb.DocumentClient$10.apply(DocumentClient.java:3021)
    at com.microsoft.azure.documentdb.internal.RetryUtility.executeDocumentClientRequest(RetryUtility.java:58)
    at com.microsoft.azure.documentdb.DocumentClient.doQuery(DocumentClient.java:3027)
    at com.microsoft.azure.documentdb.DocumentQueryClientInternal.doQuery(DocumentQueryClientInternal.java:40)
    at com.microsoft.azure.documentdb.internal.query.AbstractQueryExecutionContext.executeRequest(AbstractQueryExecutionContext.java:214)
    at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.executeOnce(DefaultQueryExecutionContext.java:131)
    at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.fillBuffer(DefaultQueryExecutionContext.java:101)
    at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:84)
    at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:33)
    at com.microsoft.azure.documentdb.internal.query.ProxyQueryExecutionContext.<init>(ProxyQueryExecutionContext.java:68)
    at com.microsoft.azure.documentdb.internal.query.QueryExecutionContextFactory.createQueryExecutionContext(QueryExecutionContextFactory.java:23)
    at com.microsoft.azure.documentdb.QueryIterable.createQueryExecutionContext(QueryIterable.java:70)
    at com.microsoft.azure.documentdb.QueryIterable.reset(QueryIterable.java:115)
    at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:57)
    at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:36)
    at com.microsoft.azure.documentdb.DocumentClient.queryDatabases(DocumentClient.java:537)
    at com.microsoft.azure.documentdb.rx.internal.RxWrapperDocumentClientImpl$9.invoke(RxWrapperDocumentClientImpl.java:305)
    at com.microsoft.azure.documentdb.rx.internal.RxWrapperDocumentClientImpl$9.invoke(RxWrapperDocumentClientImpl.java:302)
    at com.microsoft.azure.documentdb.rx.internal.RxWrapperDocumentClientImpl$3.call(RxWrapperDocumentClientImpl.java:190)
    at com.microsoft.azure.documentdb.rx.internal.RxWrapperDocumentClientImpl$3.call(RxWrapperDocumentClientImpl.java:185)
    at rx.Observable.unsafeSubscribe(Observable.java:10144)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.Observable.unsafeSubscribe(Observable.java:10144)
    at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at rx.internal.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:107)
    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:748)
2017-11-28 13:47:05,636       [rxnetty-nio-eventloop-3-1] WARN  com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl - Failed to retrieve database account information. java.io.IOException: Connection closed by peer before sending a response.
2017-11-28 13:47:05,638       [rxdocdb-computation1] WARN  com.microsoft.azure.documentdb.rx.internal.RetryFunctionFactory - unknown failure, cannot retry [java.io.IOException: Connection closed by peer before sending a response.], attempt number [1]
java.lang.RuntimeException: java.io.IOException: Connection closed by peer before sending a response.
    at rx.exceptions.Exceptions.propagate(Exceptions.java:58)
    at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464)
    at rx.observables.BlockingObservable.single(BlockingObservable.java:341)
    at com.microsoft.azure.documentdb.BridgeInternal$2.getDatabaseAccountFromEndpoint(BridgeInternal.java:95)
    at com.microsoft.azure.documentdb.GlobalEndpointManager.getDatabaseAccountFromAnyEndpoint(GlobalEndpointManager.java:121)
    at com.microsoft.azure.documentdb.GlobalEndpointManager.refreshEndpointListInternal(GlobalEndpointManager.java:155)
    at com.microsoft.azure.documentdb.GlobalEndpointManager.initialize(GlobalEndpointManager.java:148)
    at com.microsoft.azure.documentdb.GlobalEndpointManager.getWriteEndpoint(GlobalEndpointManager.java:73)
    at com.microsoft.azure.documentdb.GlobalEndpointManager.resolveServiceEndpoint(GlobalEndpointManager.java:91)
    at com.microsoft.azure.documentdb.rx.internal.RxGatewayStoreModel.getUri(RxGatewayStoreModel.java:214)
    at com.microsoft.azure.documentdb.rx.internal.RxGatewayStoreModel.performRequest(RxGatewayStoreModel.java:165)
    at com.microsoft.azure.documentdb.rx.internal.RxGatewayStoreModel.doCreate(RxGatewayStoreModel.java:111)
    at com.microsoft.azure.documentdb.rx.internal.RxGatewayStoreModel.processMessage(RxGatewayStoreModel.java:375)
    at com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl.lambda$doCreate$23(RxDocumentClientImpl.java:655)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.Observable.unsafeSubscribe(Observable.java:10144)
    at rx.internal.operators.OnSubscribeRedo$2.call(OnSubscribeRedo.java:273)
    at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.enqueue(TrampolineScheduler.java:73)
    at rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:52)
    at rx.internal.operators.OnSubscribeRedo$5.request(OnSubscribeRedo.java:361)
    at rx.Subscriber.setProducer(Subscriber.java:211)
    at rx.internal.operators.OnSubscribeRedo.call(OnSubscribeRedo.java:353)
    at rx.internal.operators.OnSubscribeRedo.call(OnSubscribeRedo.java:47)
    at rx.Observable.unsafeSubscribe(Observable.java:10144)
    at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
    at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:148)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
    at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onNext(OnSubscribeDoOnEach.java:101)
    at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
    at com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl.lambda$createPutMoreContentObservable$26(RxDocumentClientImpl.java:682)
    at rx.Observable.unsafeSubscribe(Observable.java:10144)
    at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at rx.internal.schedulers.ExecutorScheduler$ExecutorSchedulerWorker.run(ExecutorScheduler.java:107)
    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:748)
Caused by: java.io.IOException: Connection closed by peer before sending a response.
    at io.reactivex.netty.protocol.http.client.ClientRequestResponseConverter.<clinit>(ClientRequestResponseConverter.java:96)
    at io.reactivex.netty.protocol.http.client.ClientRequiredConfigurator.configureNewPipeline(ClientRequiredConfigurator.java:53)
    at io.reactivex.netty.pipeline.PipelineConfiguratorComposite.configureNewPipeline(PipelineConfiguratorComposite.java:55)
    at io.reactivex.netty.pipeline.PipelineConfiguratorComposite.configureNewPipeline(PipelineConfiguratorComposite.java:55)
    at io.reactivex.netty.client.RxClientImpl$2.initChannel(RxClientImpl.java:127)
    at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:113)
    at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:105)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:597)
    at io.netty.channel.DefaultChannelPipeline.access$000(DefaultChannelPipeline.java:44)
    at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1387)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1122)
    at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:647)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:506)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:419)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:478)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    ... 1 more
an error happened in database creation: actual cause: java.io.IOException: Connection closed by peer before sending a response.
Disconnected from the target VM, address: '127.0.0.1:61888', transport: 'socket'

Process finished with exit code 130 (interrupted by signal 2: SIGINT)
moderakh commented 6 years ago

@sgireddy these are end to end integration tests and require a valid endpoint.

Which endpoint are you using?

sgireddy commented 6 years ago

I am using a live cosmosdb on azure (mongoDB endpoint)

Also, the original code sample came with version "0.9.0-SNAPSHOT" but maven central has "0.9.0-rc2" which I believe the latest. I was trying to build the master branch ("0.9.0-SNAPSHOT"), deploy locally but got the following error, could you help setting up gpg secret key?

INFO] Building jar: /Users/shashigireddy/code/git/azure-documentdb-rxjava/azure-documentdb-rx/target/azure-documentdb-rx-0.9.0-SNAPSHOT-javadoc.jar
[INFO] 
[INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ azure-documentdb-rx ---
gpg: no default secret key: No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.906 s
[INFO] Finished at: 2017-11-28T16:24:48-08:00
[INFO] Final Memory: 31M/103M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project azure-documentdb-rx: Exit code: 2 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
sgireddy commented 6 years ago

Tried building azure-documentdb-rx project with my own gpg key then building examples project build worked fine but I am seeing runtime errors (below). I removed target & jars from maven local repo (tried with and without gpg goal in mvn build). Didn't work.

    java.lang.SecurityException: class "com.microsoft.azure.documentdb.BridgeInternal"'s signer information does not match signer information of other classes in the same package

    at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl.<init>(RxDocumentClientImpl.java:200)
    at com.microsoft.azure.documentdb.rx.AsyncDocumentClient$Builder.build(AsyncDocumentClient.java:174)
    at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.setUp(DatabaseAndCollectionCreationAsyncAPITest.java:97)
    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.RunBefores.evaluate(RunBefores.java:24)
    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.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

java.lang.NullPointerException
    at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.shutdown(DatabaseAndCollectionCreationAsyncAPITest.java:111)
    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.RunAfters.evaluate(RunAfters.java:33)
    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.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
moderakh commented 6 years ago

@sgireddy

java.lang.SecurityException: class "com.microsoft.azure.documentdb.BridgeInternal"'s signer information does not match signer information of other classes in the same package

You are getting this because com.microsoft.azure:azure-documentdb-rx has dependency and also some shared packages with com.microsoft.azure:azure-documentdb. So signing with Microsoft keys are required otherwise java security policy will complain.

Short term solution: If you want to build com.microsoft.azure:azure-documentdb-rx yourself either disable java's security feature or remove the signature from com.microsoft.azure:azure-documentdb.

you can remove signature from the main package (not safe for prod): find $HOME/.m2/repository/com/microsoft/azure/azure-documentdb -iname '.jar' -exec sh -c 'zip -d "{}" META-INF/.SF META-INF/*.RSA' \; || echo "maybe already fixed and cached!"

Long term solution: We are making some improvement which should be out in early 2018 and should fix this.

sgireddy commented 6 years ago

@moderakh

Thank you for details on gpg key issue.

Looks like my issue is related to the port number on the end point. The following endpoint (without port number) works perfectly fine using .Net connector:

<add key="endpoint" value="https://xxxxxxxxxx.documents.azure.com" />

But not using RxJava, got following:

[rxdocdb-computation1] WARN com.microsoft.azure.documentdb.rx.internal.RetryFunctionFactory - unknown failure, cannot retry [port out of range:-1], attempt number [1]
java.lang.IllegalArgumentException: port out of range:-1

I have been trying 8081 but it was supposed to be 443. Using endpoint https://xxxxxxxxxx.documents.azure.com:443 worked fine. Ideally it should automatically infer the port number 443 when the protocol is https. I am not blocked anymore so I am ok to close the issue or let it open until the library automatically infer the default port number.

moderakh commented 6 years ago

@sgireddy you seems to be unblocked for now. The other issue (port has to be explicitly passed) that's a limitation for the java sdk right now. We will fix it. Thanks.