99x / 99x/serverless-dynamodb-local

Unable to seed online database

Open
#247 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
621
Forks
232
PR merge metrics
No merged PRs in 30d

Description

**Actual Behaviour**

I'm not currently able to seed my online DynamoDB tables. Below I paste my dynamodb local config (at serverless.yml):
```
...
dynamodb:
stages:
- dev
start:
port: 8000
inMemory: true
heapInitial: 200m
heapMax: 1g
migrate: true
seed: true

seed:
domain:
sources:
- table: Users
sources: [./.fixtures/users.json]
- table: BudgetHistory
sources: [./.fixtures/budgetHistory.json]
- table: PartnerOffices
sources: [./.fixtures/partnerOffices.json]
...
```
Please, let me know if I should paste db schema resources here and please consider that my local dynamo instance work like a charm (it's just online throwing this error).

**Expected Behaviour**

I expected to seed my dynamo online instance. i.e, I suppose I could see the just seeded db on AWS Console

**Steps to reproduce it**

1. I first created local seeds files as .json so I reference them in serverless.yml under custom variables.
2. Deploy with sls with `sls deploy`
3. Run `sls dynamodb seed --online --region sa-east-1`
4. See the error and cry

**LogCat for the issue**
Here is my log:
```
> sls dynamodb seed --online --region sa-east-1

Serverless: Connecting to online tables...

Resource Not Found Exception ---------------------------

ResourceNotFoundException: Requested resource not found
at Request.extractError (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/protocol/json.js:51:27)
at Request.callListeners (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at Request.emit (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
at callNextListener (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
at IncomingMessage.onEnd (/home/arjuna/git/preco-de-cartorio/node_modules/aws-sdk/lib/event_listeners.js:307:13)
at IncomingMessage.emit (events.js:328:22)
at IncomingMessage.EventEmitter.emit (domain.js:485:12)
at endReadableNT (_stream_readable.js:1201:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: linux
Node Version: 13.10.1
Framework Version: 1.61.2
Plugin Version: 3.2.7
SDK Version: 2.2.1
Components Core Version: 1.1.2
Components CLI Version: 1.4.0

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! preco-de-cartorio@1.0.0 seed:deploy: `sls dynamodb seed --online --region sa-east-1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the preco-de-cartorio@1.0.0 seed:deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/arjuna/.npm/_logs/2020-03-25T17_40_51_804Z-debug.log
```

**Screenshots of the issue**

![image](https://user-images.githubusercontent.com/29443505/77568266-222a1b00-6ea7-11ea-9f6b-c7de011c15fd.png)

**Would you like to work on the issue?**
I do not feel able to start digging the holes toward solving this issue, since I'm not this repo contributor nor have knowledge of how do things work. I've looked for issues like this one #198. Neverthless I couldn't figure out which could be a reasonable solution. Any ideas?

Contributor guide

Open the contributing guide

Research direction

Start with the `dynamodb seed --online` command and the `serverless.yml` configuration shown in the report, reproducing it with the supplied region and seed sources. Trace why the online tables produce `ResourceNotFoundException`; done means the command seeds the deployed tables and the records appear in the AWS Console.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.