1

We have a resource group which contains Azure Databricks service and Azure Maps Account. The goal is to call Azure Maps endpoints related to Geo coding. For some reason, I keep on receiving

java.net.SocketException: Connection reset

no matter the very same request executes successfully via Postman. enter image description here

In order to prepare my HTTP request for Scala (the language that I use in my Databricks notebook) I use this library/package. So, the notebook content looks something like this:

val response: HttpResponse[String] = Http("https://atlas.microsoft.com/search/address/json?subscription-key=my_key&api-version=1.0&query=my_query_str")
.option(HttpOptions.connTimeout(10000)).asString
//.timeout(connTimeoutMs = 100000, readTimeoutMs = 500000).asString

response.code

and then, the detailed error looks like this:

java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:210)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
    at sun.security.ssl.InputRecord.read(InputRecord.java:503)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setNewClient(AbstractDelegateHttpsURLConnection.java:100)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setNewClient(AbstractDelegateHttpsURLConnection.java:80)
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:706)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1591)
    at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:92)
    at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1490)
    at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1488)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:784)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1487)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352)
    at scalaj.http.HttpRequest.scalaj$http$HttpRequest$$doConnection(Http.scala:367)
    at scalaj.http.HttpRequest.exec(Http.scala:343)
    at scalaj.http.HttpRequest.asString(Http.scala:492)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw$$iw$$iw$$iw$$iw$$iw.<init>(command-3596544709550112:4)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw$$iw$$iw$$iw$$iw.<init>(command-3596544709550112:55)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw$$iw$$iw$$iw.<init>(command-3596544709550112:57)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw$$iw$$iw.<init>(command-3596544709550112:59)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw$$iw.<init>(command-3596544709550112:61)
    at lined047365c6afd4053bf68147e840c60bb25.$read$$iw.<init>(command-3596544709550112:63)
    at lined047365c6afd4053bf68147e840c60bb25.$read.<init>(command-3596544709550112:65)
    at lined047365c6afd4053bf68147e840c60bb25.$read$.<init>(command-3596544709550112:69)
    at lined047365c6afd4053bf68147e840c60bb25.$read$.<clinit>(command-3596544709550112)
    at lined047365c6afd4053bf68147e840c60bb25.$eval$.$print$lzycompute(<notebook>:7)
    at lined047365c6afd4053bf68147e840c60bb25.$eval$.$print(<notebook>:6)
    at lined047365c6afd4053bf68147e840c60bb25.$eval.$print(<notebook>)
    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 scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:793)
    at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:1054)
    at scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:645)
    at scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:644)
    at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
    at scala.reflect.internal.util.AbstractFileClassLoader.asContext(AbstractFileClassLoader.scala:19)
    at scala.tools.nsc.interpreter.IMain$WrappedRequest.loadAndRunReq(IMain.scala:644)
    at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:576)
    at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:572)
    at com.databricks.backend.daemon.driver.DriverILoop.execute(DriverILoop.scala:215)
    at com.databricks.backend.daemon.driver.ScalaDriverLocal$$anonfun$repl$1.apply$mcV$sp(ScalaDriverLocal.scala:202)
    at com.databricks.backend.daemon.driver.ScalaDriverLocal$$anonfun$repl$1.apply(ScalaDriverLocal.scala:202)
    at com.databricks.backend.daemon.driver.ScalaDriverLocal$$anonfun$repl$1.apply(ScalaDriverLocal.scala:202)
    at com.databricks.backend.daemon.driver.DriverLocal$TrapExitInternal$.trapExit(DriverLocal.scala:699)
    at com.databricks.backend.daemon.driver.DriverLocal$TrapExit$.apply(DriverLocal.scala:652)
    at com.databricks.backend.daemon.driver.ScalaDriverLocal.repl(ScalaDriverLocal.scala:202)
    at com.databricks.backend.daemon.driver.DriverLocal$$anonfun$execute$9.apply(DriverLocal.scala:385)
    at com.databricks.backend.daemon.driver.DriverLocal$$anonfun$execute$9.apply(DriverLocal.scala:362)
    at com.databricks.logging.UsageLogging$$anonfun$withAttributionContext$1.apply(UsageLogging.scala:251)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
    at com.databricks.logging.UsageLogging$class.withAttributionContext(UsageLogging.scala:246)
    at com.databricks.backend.daemon.driver.DriverLocal.withAttributionContext(DriverLocal.scala:49)
    at com.databricks.logging.UsageLogging$class.withAttributionTags(UsageLogging.scala:288)
    at com.databricks.backend.daemon.driver.DriverLocal.withAttributionTags(DriverLocal.scala:49)
    at com.databricks.backend.daemon.driver.DriverLocal.execute(DriverLocal.scala:362)
    at com.databricks.backend.daemon.driver.DriverWrapper$$anonfun$tryExecutingCommand$2.apply(DriverWrapper.scala:644)
    at com.databricks.backend.daemon.driver.DriverWrapper$$anonfun$tryExecutingCommand$2.apply(DriverWrapper.scala:644)
    at scala.util.Try$.apply(Try.scala:192)
    at com.databricks.backend.daemon.driver.DriverWrapper.tryExecutingCommand(DriverWrapper.scala:639)
    at com.databricks.backend.daemon.driver.DriverWrapper.getCommandOutputAndError(DriverWrapper.scala:485)
    at com.databricks.backend.daemon.driver.DriverWrapper.executeCommand(DriverWrapper.scala:597)
    at com.databricks.backend.daemon.driver.DriverWrapper.runInnerLoop(DriverWrapper.scala:390)
    at com.databricks.backend.daemon.driver.DriverWrapper.runInner(DriverWrapper.scala:337)
    at com.databricks.backend.daemon.driver.DriverWrapper.run(DriverWrapper.scala:219)
    at java.lang.Thread.run(Thread.java:748)

UPDATE: No matter if we have a valid shared key in the URL or not, the error is still the same: https://atlas.microsoft.com/search/address/json?subscription-key=my_key&api-version=1.0&query=my_query_str

5
  • I don't believe this is an issue with Azure Maps, but perhaps has something to do with the implementation. Looking into this error, it appears a common reason for it is closing the connection before the response has been completely read. Note the response will be JSON, in case that changes anything with that library. Commented Jun 16, 2020 at 18:43
  • @rbrundritt Yes, it definitely is not an Azure Maps issue but rather Databricks to Azure Maps issue. For some reason, the connection gets closed before response was received. I have updated my question with some further observations. Commented Jun 17, 2020 at 7:16
  • Came across this, it looked similar: stackoverflow.com/questions/5507878/ssl-connection-reset Commented Jun 17, 2020 at 15:31
  • @user2128702 is your issue solved? Please post the solution as an answer. Thanks! Commented Jul 9, 2020 at 0:50
  • @asergaz not really. Commented Jul 9, 2020 at 8:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.