Getting DB Provider error with Adobe IO Rest Service | Community
Skip to main content
Level 2
November 12, 2021
Question

Getting DB Provider error with Adobe IO Rest Service

  • November 12, 2021
  • 1 reply
  • 2373 views

Adobe IO Rest service throwing error.  Here is the engineering ticekt raised for the below error.

IOEXT-65. Please provide the cause and solution.

 

Here is the code we are using.


  var processEnv = process.env;
  var namespace = processEnv.__OW_NAMESPACE;
  var auth = processEnv.__OW_API_KEY;
  //console.log("Namespace: " + namespace);
  //console.log("After processEnv");

  let state = await libState.init({ ow: { namespaceauth } });

 

 

 

Error:

2021-11-05 14:37:50.196 INFO [com.tdl.pwa.core.workflows.PushHomePageDataToWorkflow] /content/tcp-pwa/pwa/en/homepage payload response is {"payload":{"response":{"headers":{"date":"Fri, 05 Nov 2021 09:07:49 GMT","x-request-id":"ps4Fp5sx7nNbkS3Y7IsapCuMda4xfLrl","content-length":"636","x-azure-ref":"0ZfSEYQAAAADL1oxU5e3iQripQ6dy0+JoU0lOMzBFREdFMDIwOABiNzdiNjYzMy04ZjcwLTQyNWItOTJiZC03NmFlYmU5YWI5YzU=","x-openwhisk-activation-id":"bd8a5b1bf41a4e718a5b1bf41a1e71bf","access-control-allow-headers":"Authorization, Origin, X-Requested-With, Content-Type, Accept, User-Agent","x-frame-options":"deny","access-control-allow-methods":"OPTIONS, GET, DELETE, POST, PUT, HEAD, PATCH","strict-transport-security":"max-age=7884000; includeSubDomains","access-control-allow-origin":"*","x-content-type-options":"nosniff","x-xss-protection":"1; mode=block","connection":"close","content-type":"application/json","x-cache":"CONFIG_NOCACHE"},"request":{"headers":{"content-length":86,"content-type":"application/json","X-OW-EXTRA-LOGGING":"on","accept":"application/json"},"method":"POST","uri":{"path":"/api/v1/web/homepage-0.0.1/homepageService","hostname":"288455-319plumdinosaur.adobeioruntime.net","protocol":"https:","search":null,"auth":null,"port":443,"query":null,"host":"288455-319plumdinosaur.adobeioruntime.net","href":"https://288455-319plumdinosaur.adobeioruntime.net/api/v1/web/homepage-0.0.1/homepageService","hash":null,"pathname":"/api/v1/web/homepage-0.0.1/homepageService","slashes":true}},"body":{"payload":{"sdkDetails":{"key":"homepage_json"},"code":"ERROR_BAD_CREDENTIALS","stacktrace":"StateLibError: [StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid\n at new <anonymous> (/nodejsAction/OofwFjKo/index.js:719:9)\n at wrap (/nodejsAction/OofwFjKo/index.js:2558:19)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","sdk":"StateLib","message":"[StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid"}},"statusCode":500},"name":"StatusCodeError","options":{"headers":{"X-OW-EXTRA-LOGGING":"on"},"method":"POST","json":true,"simple":true,"body":{"pageInfo.pageName":"Homepage","update":true,"device":"PWA","tcpId":"serversideuser"},"resolveWithFullResponse":false,"transform2xxOnly":false,"uri":"https://288455-319plumdinosaur.adobeioruntime.net/api/v1/web/homepage-0.0.1/homepageService"},"error":{"payload":{"sdkDetails":{"key":"homepage_json"},"code":"ERROR_BAD_CREDENTIALS","stacktrace":"StateLibError: [StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid\n at new <anonymous> (/nodejsAction/OofwFjKo/index.js:719:9)\n at wrap (/nodejsAction/OofwFjKo/index.js:2558:19)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","sdk":"StateLib","message":"[StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid"}},"message":"500 - {\"payload\":{\"code\":\"ERROR_BAD_CREDENTIALS\",\"message\":\"[StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid\",\"sdk\":\"StateLib\",\"sdkDetails\":{\"key\":\"homepage_json\"},\"stacktrace\":\"StateLibError: [StateLib:ERROR_BAD_CREDENTIALS] cannot access underlying DB provider, make sure your credentials are valid\\n at new <anonymous> (/nodejsAction/OofwFjKo/index.js:719:9)\\n at _wrap (/nodejsAction/OofwFjKo/index.js:2558:19)\\n at runMicrotasks (<anonymous>)\\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\"}}","statusCode":500},"error":true}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Adobe Employee
November 12, 2021

@sahithimalyala - could you try state init without custom ow auth. Simply this:

let state = await libState.init();

Why do you need to pass the custom Openwhisk namespace + auth?

Level 2
November 16, 2021

Hi Duynguyen,

 

We are using the ow auth to differentiate the service between dev, stage and Production environments. If we are not using the auth syntax the different environment libstate data is getting merged. This solution is not working for us. 

 

Please provide solution asap. 

Adobe Employee
November 16, 2021

@sahithimalyala - I got your requirement, but why isn't this solution working?

In your App Builder project, there are different workspaces for prod, stage, dev, etc. Each comes with its own Runtime namespace.

If you deploy your app to a namespace, let's say dev, libState.init (without any param) will automatically pick the dev namespace. And the libState data is specific to that dev namespace only.

If you deploy to stage later, you will have fresh data of stage. And the same for prod.

In summary, they don't share any data, because we guarantee tenant isolation between namespaces.