Skip to content
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

plugin-cloud expiring S3 credentials #8404

Open
denolfe opened this issue Sep 25, 2024 · 3 comments
Open

plugin-cloud expiring S3 credentials #8404

denolfe opened this issue Sep 25, 2024 · 3 comments
Assignees

Comments

@denolfe
Copy link
Member

denolfe commented Sep 25, 2024

Environment Info

payload: 3.0.0-beta.108
next: 15.0.0-canary.160

Describe the Bug

The internal S3 client within plugin-cloud appears to have an expiring token after a certain amount of time.

Need to investigate how credentials could be getting stale and ensure they are being refreshed accordingly.

This should be addressed in v2 and v3.

Reports are showing the following error:

[12:56:11] ERROR (payload): Error getting file from cloud storage
    err: {
      "type": "S3ServiceException",
      "message": "The provided token has expired.",
      "stack":
          ExpiredToken: The provided token has expired.
              at throwDefaultError (/home/node/app/node_modules/@smithy/smithy-client/dist-cjs/index.js:838:20)
              at /home/node/app/node_modules/@smithy/smithy-client/dist-cjs/index.js:847:5
              at de_CommandError (/home/node/app/node_modules/@aws-sdk/client-s3/dist-cjs/index.js:4756:14)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async /home/node/app/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20
              at async /home/node/app/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js:225:18
              at async /home/node/app/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
              at async /home/node/app/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js:173:18
              at async /home/node/app/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:97:20
              at async /home/node/app/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js:120:14
      "name": "ExpiredToken",
      "$fault": "client",
      "$metadata": {
        "httpStatusCode": 400,
        "requestId": "6QVCCRS3PJQB4BPR",
        "extendedRequestId": "asdf",
        "attempts": 1,
        "totalRetryDelay": 0
      "$fault": "client",
      },
      "Code": "ExpiredToken",
      "Token-0": "REDACTED",
      "RequestId": "6QVCCRS3PJQB4BPR",
      "HostId": "asdf"
    }

Reproduction Steps

Unclear, consistent recreation steps

Adapters and Plugins

No response

@denolfe denolfe added status: needs-triage Possible bug which hasn't been reproduced yet plugin: cloud @payloadcms/plugin-cloud v3 prioritized labels Sep 25, 2024
@WebsiteFactoryTM
Copy link

Hello, just to mention that this seems to be a v2 problem as well. I keep getting this error on my deployed app.

@kendelljoseph kendelljoseph self-assigned this Oct 25, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 25, 2024
@kendelljoseph
Copy link
Contributor

isValid() use in in payload-cloud

isValid() implementation in - amazon-cognito-idenity-js

@kendelljoseph
Copy link
Contributor

PR Opened: #8904

@denolfe denolfe removed the v3 label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants