sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.15k stars 140 forks source link

ExpiredTokenException: The security token included in the request is expired #231

Open kldeb opened 3 months ago

kldeb commented 3 months ago

Steps to reproduce:

  1. Create a remix app
  2. Create a postress db
  3. Link postgres to remix
  4. npm install drizzle, @aws-sdk/client-rds-data
  5. export const db = drizzle(new RDSDataClient({}), { database: Resource.MyDatabase.database, secretArn: Resource.MyDatabase.secretArn, resourceArn: Resource.MyDatabase.clusterArn, });
  6. run npm run dev
  7. Let the localhost app sit idle for \~20 mins
  8. see the following error:
ExpiredTokenException: The security token included in the request is expired
    at throwDefaultError (/Users/kldeb/dev/lop-ion/node_modules/@smithy/smithy-client/dist-cjs/index.js:838:20)
    at /Users/kldeb/dev/lop-ion/node_modules/@smithy/smithy-client/dist-cjs/index.js:847:5
    at de_CommandError (/Users/kldeb/dev/lop-ion/node_modules/@aws-sdk/client-rds-data/dist-cjs/index.js:830:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/kldeb/dev/lop-ion/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20
    at async /Users/kldeb/dev/lop-ion/node_modules/@smithy/core/dist-cjs/index.js:165:18
    at async /Users/kldeb/dev/lop-ion/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
    at async /Users/kldeb/dev/lop-ion/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:33:22
    at async AwsDataApiPreparedQuery.values (file:///Users/kldeb/dev/lop-ion/node_modules/drizzle-orm/aws-data-api/pg/session.js:65:20)
    at async AwsDataApiPreparedQuery.execute (file:///Users/kldeb/dev/lop-ion/node_modules/drizzle-orm/aws-data-api/pg/session.js:41:18)
    at async loader (/Users/kldeb/dev/lop-ion/app/routes/_app.leads.$id.step-4.tsx:56:29)
    at async Object.callRouteLoaderRR (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/server-runtime/dist/data.js:52:16)
    at async callLoaderOrAction (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/router/dist/router.cjs.js:4166:16)
    at async Promise.all (index 1)
    at async loadRouteData (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/router/dist/router.cjs.js:3638:19)
    at async queryImpl (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/router/dist/router.cjs.js:3481:20)
    at async Object.query (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/router/dist/router.cjs.js:3381:18)
    at async handleDocumentRequestRR (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/server-runtime/dist/server.js:184:15)
    at async requestHandler (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/server-runtime/dist/server.js:108:18)
    at async nodeHandler (/Users/kldeb/dev/lop-ion/node_modules/@remix-run/dev/dist/vite/plugin.js:837:27)
    at async /Users/kldeb/dev/lop-ion/node_modules/@remix-run/dev/dist/vite/plugin.js:840:15```
thdxr commented 3 months ago

does it work when restarted?

kldeb commented 3 months ago

Yes

magicspon commented 2 weeks ago

Do I need to worry about this in production?

jayair commented 2 weeks ago

This is related to sst dev I think. So it shouldn't be production related.