Open KingDarBoja opened 4 years ago
I ran into this today. It's probably because the plugin has hard-coded values for the access key, secret, and region. You'll have to update your shell and any other code that is trying to use the table to have the same values. There is a PR (#204), but it looks like it's gone a little stale. Anywho... the values are as follows:
Actual Behaviour
Even though I followed the install steps and provided the below configuration, trying to access the table on one of my lambda functions throws
ResourceNotFoundException: Cannot do operations on a non-existent table
.dynamoConfig.ts
Expected Behaviour
State here what the feature should enable the user to do.
Steps to reproduce it
Install whatever plugin you need, in my case, I make use of the following on my
serverless.yml
file:Install the dynamodb plugin following the readme and provide custom options like as:
Run
SLS_DEBUG=* serverless offline start
The environment variables are being properly initialized, as I am trying to test it offline.
LogCat for the issue
**Log from sls offline start**
```console Serverless: Load command interactiveCli Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command create Serverless: Load command install Serverless: Load command package Serverless: Load command deploy Serverless: Load command deploy:function Serverless: Load command deploy:list Serverless: Load command deploy:list:functions Serverless: Load command invoke Serverless: Load command invoke:local Serverless: Load command info Serverless: Load command logs Serverless: Load command metrics Serverless: Load command print Serverless: Load command remove Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command slstats Serverless: Load command plugin Serverless: Load command plugin Serverless: Load command plugin:install Serverless: Load command plugin Serverless: Load command plugin:uninstall Serverless: Load command plugin Serverless: Load command plugin:list Serverless: Load command plugin Serverless: Load command plugin:search Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command upgrade Serverless: Load command uninstall Serverless: DOTENV: Loading environment variables from .env: Serverless: - IS_OFFLINE Serverless: - ACCESS_KEY_ID Serverless: - SECRET_ACCESS_KEY Serverless: Load command dynamodb Serverless: Load command dynamodb:migrate Serverless: Load command dynamodb:seed Serverless: Load command dynamodb:start Serverless: Load command dynamodb:noStart Serverless: Load command dynamodb:remove Serverless: Load command dynamodb:install Serverless: Load command offline Serverless: Load command offline:start Serverless: Load command login Serverless: Load command logout Serverless: Load command generate-event Serverless: Load command test Serverless: Load command dashboard Serverless: Invoke offline:start Serverless: Compiling with Typescript... Serverless: Using local tsconfig.json Serverless: Typescript compiled. Serverless: Watching typescript files... Dynamodb Local Started, Visit: http://localhost:8000/shell Serverless: DynamoDB - created table production-careers_types Serverless: DynamoDB - created table production-category_types offline: Starting Offline: production/us-east-1. [offline] options: { apiKey: 'd41d8cd98f00b204e9800998ecf8427e', corsAllowCredentials: true, corsAllowHeaders: [ 'accept', 'content-type', 'x-api-key', 'authorization' ], corsAllowOrigin: [ '*' ], corsExposedHeaders: [ 'WWW-Authenticate', 'Server-Authorization' ], disableCookieValidation: false, enforceSecureCookies: false, hideStackTraces: false, host: 'localhost', httpPort: 3000, httpsProtocol: '', lambdaPort: 3002, noAuth: false, noTimeout: false, printOutput: false, resourceRoutes: false, useChildProcesses: false, useWorkerThreads: false, websocketPort: 3001, useDocker: false, stage: undefined, region: undefined, corsConfig: { credentials: true, exposedHeaders: [ 'WWW-Authenticate', 'Server-Authorization' ], headers: [ 'accept', 'content-type', 'x-api-key', 'authorization' ], origin: [ '*' ] } } offline: Offline [http for lambda] listening on http://localhost:3002 ...some lambda endpoints... [offline] Loading handler... (D:\Programming\ts_projects\Angular-serverless-sample\.build\api\types) null { TableNames: [ 'production-careers_types', 'production-category_types' ] } ResourceNotFoundException: Cannot do operations on a non-existent table at Request.extractError (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\protocol\json.js:51:27) at Request.callListeners (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\sequential_executor.js:106:20) at Request.emit (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\sequential_executor.js:78:10) at Request.emit (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\request.js:683:14) at Request.transition (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\request.js:22:10) at AcceptorStateMachine.runTo (D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\state_machine.js:14:12) at D:\Programming\ts_projects\Angular-serverless-sample\node_modules\aws-sdk\lib\state_machine.js:26:10 at Request.Screenshots of the issue
Navigating to![no-tables-shell](https://user-images.githubusercontent.com/30560560/74841037-ff2fa880-52f5-11ea-94c8-8c6c65a4b00d.png)
http://localhost:8000/shell/
and using the list tables example code, doesn't show the tables on the output list. Where-ever possible attach a screenshot of the issue.Would you like to work on the issue?
Not at the moment.