SAP-samples / hana-developer-cli-tool-example

Learn how to build a developer-centric SAP HANA command line tool, particularly designed to be used when performing SAP HANA development in non-SAP tooling (for example from VS Code).
Apache License 2.0
90 stars 24 forks source link

'Error: read ECONNRESET' in the last line of the console output #76

Closed jung-thomas closed 1 year ago

jung-thomas commented 2 years ago

Unable to reproduce in my environment. Looking forward to learning more about the reporter's setup and debug trace.

Meyer-J commented 2 years ago

The ECONNRESET error is returned from the dbConnection.disconnect() call in base.end().

The debug output is

  hana-cli Natural End +1ms
  hana-cli HANA Disconnect Started +0ms
  hana-cli Error +30ms
file:.../utils/base.js:500
        throw error
        ^

Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

Node.js v18.0.0

I'm running node.js v18 on Windows 10.

jung-thomas commented 2 years ago

Technically the module doesn't support Node v18 yet (mainly because several underlying SAP modules don't technically support Node 18 yet). You should get a warning on install and when you issue commands. image

But that still doesn't seem to be the root of this problem. I tested in my environment with Node 18.1.0 and couldn't get this error. I even tried that exact version you reported - 18.0.0 and it's the same - no ECONNREST.

I see Natural End, Disconnect Started, and then Disconnect Completed. image

Same successful disconnect from the Business Application Studio as well image

Is this really every command you try? Or just certain ones? For example, do you get it on the systemInfo command?

Meyer-J commented 2 years ago

I finally found some time to try a few things.

I've changed my node.js installation to 16.15.0 to make sure it's not caused by v18.

Inside the terminal of VS Code on Windows 10 I tried the following calls:

  1. I could run 'hana-cli systemInfo -a' a few times without error.
  2. Then 'hana-cli containers -a' ended with ECONNRESET.
  3. 'hana-cli systemInfo -a' again finished without error.
  4. 'hana-cli createGroup GRP -a' (for an existing group) finished with ECONNRESET
  5. now 'hana-cli systemInfo -a' also ends with ECONNRESET

After restarting VS Code, 'hana-cli systemInfo -a' again ends with ECONNRESET. After restarting my HANA server, the call still fails.

I guess that's something that is limited to my machine and that will be hard to find...