Skip to content

[DATABRICKS ERROR]: "FetchError: socket hang up" #260

Closed

Description

@kumarav16

Hi, we have encountered a socket hang-up error while performing a longevity test.
we have used Node version: 20.11.1 and @databricks/sql package version: 1.7.1

kindly find the below error and screenshot for the same:

" error occurred while resolving the DB query!, FetchError: request to https://adb-4989540552326160.0.azuredatabricks.net/sql/1.0/warehouses/d332f02ce1613e30 failed, reason: socket hang up"

image

Please help us to resolve the issue and let us know in-case of more information needed.

Activity

  1. kravets-levko commented on Jun 10, 2024

    @kravets-levko
    Contributor

    Hi @kumarav16! I will ask you few question that crossed my mind right away:

    • do you see this error with latest version of the library?
    • do you use proxy?
    • on which stage (opening session, running query, getting the result, etc.) this is happening?
    • how large is your result set?

    But it would be perfect if you can provide a minimal reproducible example, because this error look somewhat generic

  2. kumarav16 commented on Jun 12, 2024

    @kumarav16
    Author

    Hi @kravets-levko Kindly find the answer to the above questions below:

    • do you see this error with latest version of the library? We have not yet tried with the latest version which is 1.8.4, we are getting the error with version 1.7.1

    • do you use proxy? No proxy has been used

    • on which stage (opening session, running query, getting the result, etc.) this is happening? while running a query

    • how large is your result set? max 600-700 KB

  3. DevPro1993 commented on Jul 1, 2024

    @DevPro1993

    Is this issue resolved? I am also getting the same issue. On local it is working fine but when I deploy my code to lambda, I am getting this error.

  4. kumarav16 commented on Jul 26, 2024

    @kumarav16
    Author

    Hi @kravets-levko, hope you are doing well!
    could you please suggest solution for the above issues as still we are facing the same issues while running longevity test.

  5. haggholm commented on May 15, 2025

    @haggholm

    We sporadically encounter this issue (driver version 1.10.0), with errors like

    FetchError: Invalid response body while trying to fetch https://<redacted>.cloud.databricks.com/sql/1.0/warehouses/<id>: Premature close
    

    (Unfortunately, I cannot provide repro steps, so I'm not sure how useful this comment is for debugging; I just wanted to note that other people are experiencing the issue.)

  6. eranga-acerta commented on Jul 2, 2025

    @eranga-acerta

    We have the same issue. In our case the amount of data being fetched by is huge and is greater than 100 MB. This error is unhandled by the SDK so we are getting an unhandled promise rejection.

    @databricks/sql version - 1.10.0
    Node version - 22.17.0

    FetchError: request to https://dbstorages<redacted>.blob.core.windows.net/jobs/<redacted>/sql/2025-07-01/15/results_2025-07-01T15:20:51Z_b973fc56-4b47-4a87-b51f-f3b2e39d9774?sig=<redacted>=2025-07-01T15%3A35%3A58Z&sv=2019-02-02&spr=https&sp=r&sr=b failed, 
    reason: socket hang up
        at ClientRequest.<anonymous> (/usr/app/node_modules/node-fetch/lib/index.js:1501:11)
        at ClientRequest.emit (node:events:518:28)
        at emitErrorEvent (node:_http_client:104:11)
        at TLSSocket.socketOnEnd (node:_http_client:542:5)
        at TLSSocket.emit (node:events:530:35)
        at endReadableNT (node:internal/streams/readable:1698:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
    { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET' }
    

    Databricks query history:

    Image

  7. added a commit that references this issue on Jun 8, 2026
    9c76ed8
  8. added a commit that references this issue on Jun 8, 2026
    7040a95
  9. vuanhphung commented on Nov 5, 2026

    @vuanhphung
    Collaborator

    Fixed in 1.16.0 by #424. Please upgrade to 1.16.0 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions