99x / 99x/serverless-dynamodb-local

Not possible to use absolute path to sources

Open
#242 0 comments 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**

Failure when trying to use absolute path to sources (`/tmp/users` below).

**Expected Behaviour**

It should be possible to use absolute path to sources.

**Steps to reproduce it**

serverless.yaml:

```yaml
custom:
dynamodb:
stages:
- dev
start:
port: 8000
migrate: true
convertEmptyValues: true
noStart: false
inMemory: true
sharedDb: true
seed: true
seed:
test:
sources:
- table: users
sources: [/tmp/users]
```

**Log**

```
Dynamodb Local Started, Visit: http://localhost:8000/shell
Serverless: DynamoDB - created table users
Error --------------------------------------------------
Error: source file /home/user/project/tmp/users does not exist
at /home/user/project/node_modules/serverless-dynamodb-local/src/seeder.js:138:15
at tryCatcher (/home/user/project/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/user/project/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/user/project/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/user/project/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/user/project/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/home/user/project/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/user/project/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/user/project/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/user/project/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:439:21)
at process.topLevelDomainCallback (domain.js:131:23)
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: 12.13.0
Framework Version: 1.61.1
Plugin Version: 3.4.1
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0
```

Contributor guide

Open the contributing guide

Research direction

Start in seeder.js at the reported failure around line 138 and reproduce the issue with the serverless.yaml configuration shown. Check how the source path is resolved before the existence check. Done means an absolute source such as /tmp/users is used as written while relative paths continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.