0

I had an issue in nodejs, when I use the API link https://hostname:8089

  return new NoSQLClient({

                serviceType: ServiceType.KVSTORE,

                endpoint: 'localhost:8089'

            });

I'm getting error like this,

Error: [REQUEST_TIMEOUT] Operation timed out after 10000 ms and 6 retries; Caused by: [NETWORK_ERROR] Network error; Caused by: socket hang up

Mugi Coder
  • 11
  • 4

2 Answers2

0

There is nothing wrong with the query, it's about the port, you have to expose the port first and then try it...or disable the firewall

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 09 '22 at 14:24
0

This error happens when you are trying to access a secure KVStore using a non-secure connection call ( http://localhost:8089 )

NoSQLTimeoutError: [REQUEST_TIMEOUT] Operation timed out after 10000 ms 
and 6 retries; Caused by: [NETWORK_ERROR] Network error; 
Caused by: socket hang up

When accessing a secure KVstore, you need also to provide a user/pwd. If not, you will have the following error

NoSQLArgumentError: [ILLEGAL_ARGUMENT] TABLE_REQUEST: Illegal Argument:
Missing authentication information

Here is an example of a connection string (see https, if this value is not set you will use http by default):

return new NoSQLClient({
    serviceType: ServiceType.KVSTORE,
    endpoint: 'https://localhost:8089'
   , auth: {
        kvstore: {
            user: "driver_user",
            password: "DriverPass@@123"
        }
    }
});

In a secure mode, the proxy requires an SSL Certificate and private key. You need to provide the certificate, before running your application, set the environment variable NODE_EXTRA_CA_CERTS

export NODE_EXTRA_CA_CERTS=<yourpath>/certificate.pem

Without the certificate, you will have the following error:

NoSQLAuthorizationError: [REQUEST_TIMEOUT] Authorization error: 
[operation timeout]: Failed to login to kvstore.  
Operation timed out, see the cause

You also need to validate the requested domain name to match the server's certificate.

$ curl --cacert ~/certificate.pem  https://localhost:8089
curl: (51) Unable to communicate securely with peer: requested domain name
does not match the server's certificate.

In this case, you need to change the certificate or use the appropriate URL

$ openssl x509 -text -noout -in ~/certificate.pem | grep CN
        Issuer: CN=kvlite
        Subject: CN=kvlite

$ curl --cacert ~/certificate.pem  https://kvlite:8080

If your CN is not localhost, use an url matching with the certificate (e.g.)

return new NoSQLClient({
    serviceType: ServiceType.KVSTORE,
    endpoint: 'https://kvlite:8089'
   , auth: {
        kvstore: {
            user: "driver_user",
            password: "DriverPass@@123"
        }
    }
});
Dario
  • 440
  • 1
  • 3
  • 8
  • Thanks Dario. Upto this I've done and everything is fine. But, after this I got another error like ERROR: [ILLEGAL_ARGUMENT] PUT: illegal argument : store is not yet configured and cannot accept data – Mugi Coder Apr 13 '22 at 11:06
  • Can you share how the store was created? steps done during installation, seems that something else is missing. Is it a multi-node or single node deployment for tests? – Dario Apr 13 '22 at 14:09
  • It's single node for testing. – Mugi Coder Apr 14 '22 at 07:17
  • The same steps as mentioned in Oracle nosql document. I didn't skip any steps – Mugi Coder Apr 14 '22 at 07:19
  • I was not able to reproduce it. can you share the output of the command `ping` and the output for the command `verify configuration`? if we cannot find what is wrong in your current configuration. is it possible for you to start from scratch with no existing root dir for your store? – Dario Apr 16 '22 at 08:10