Skip to content

OCI Function - Error using ResourcePrincipalAuthenticationDetailsProvider with ObjectStorageClient (Node.js) #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lucasfontesgaspareto opened this issue May 22, 2025 · 0 comments

Comments

@lucasfontesgaspareto
Copy link

Hey community

I'm developing an OCI Function that uploads files to an OCI Object Storage bucket. I'm using the following libraries:

const common = require('oci-common');
const os = require('oci-objectstorage');

The function runs in the OCI Functions environment, and for authentication, I'm trying to use ResourcePrincipalAuthenticationDetailsProvider.

However, when initializing the ObjectStorageClient like this:

const provider = new common.ResourcePrincipalAuthenticationDetailsProvider();

const client = new os.ObjectStorageClient({
  authenticationDetailsProvider: provider
});

I get the following error during function execution:

Image

Additional Information:
package.json

{
  "name": "oci-function-upload",
  "version": "0.0.1",
  "description": "example function",
  "main": "func.js",
  "author": "",
  "license": "Apache-2.0",
  "dependencies": {
    "@fnproject/fdk": "^0.0.78",
    "busboy": "^1.6.0",
    "oci-common": "^2.109.0",
    "oci-objectstorage": "^2.109.0"
  }
}

func.yaml

schema_version: 20180708
name: upload
version: 0.0.1
runtime: node
entrypoint: node func.js
memory: 256
timeout: 30

Is there any specific configuration required for ResourcePrincipalAuthenticationDetailsProvider to work properly inside an OCI Function with Node.js?

Thank you in advance to anyone who can help or provide any guidance on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant