Timeout api with Nodejs SDK

Hi there,

I just configure the API sync in my Kuberntes cluster, but eventually I got timeout request in my local endpoint....

Unexpected error Error: timeout of 15000ms exceeded
at createError (/usr/src/job/node_modules/@1password/connect/node_modules/axios/lib/core/createError.js:16:15)
at RedirectableRequest.handleRequestTimeout (/usr/src/job/node_modules/@1password/connect/node_modules/axios/lib/adapters/http.js:280:16)
at RedirectableRequest.emit (events.js:314:20)
at Timeout._onTimeout (/usr/src/job/node_modules/@1password/connect/node_modules/follow-redirects/index.js:166:12)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7) {
config: {
url: 'http://{mylocaldns}/v1/vaults/',

I folowed the configuration below and are working well, but "eventually" I got timeout....

https://github.com/1password/onepassword-operator

I´m using the Nodejs SDK and the examples below...

https://github.com/1Password/connect-sdk-js

How can I avoid this sittuation?

Best regards,

Pierre


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • David_agDavid_ag

    Team Member
    edited August 27

    Hey Pierre -

    Are you asking whether you can extend the timeout period for the NodeJS SDK? You can provide a timeout option when configuring the SDK:

    const op = OnePasswordConnect({
        serverURL: "http://localhost:8080",
        token: "my-token",
        keepAlive: true,
        timeout: 9999999 // a value in milliseconds
    });
    

    If you're having issues connecting to your Connect server, can you try using cURL to verify it's reachable:

    curl -XGET -H 'Authorization: Bearer token_goes_here' 'http://localhost:8080/v1/vaults'
    
  • Hi David, I tried this configuration but I´m still getting this error... The eventual timeout is annoing me out and I don´t know how to solve that....

  • David_agDavid_ag

    Team Member

    Hi Pierre,

    Could you help me understand how you're using the NodeJS SDK? Are you running it inside a container and trying to read secrets managed by the Connect Operator?

    The Operator is simply a way to bring your 1Password secrets into your Kubernetes cluster. The Operator will inject secrets into your Kubernetes pods at run time and give the containers access to the secrets via environment variables.

    This means you aren't going to be able to directly hit http://localhost:8080/v1/vaults because you don't have any containers exposing that endpoint.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file