- Account Management PoC using Voice Biometrics
- Part of the Biometrics In Low-Tech Environments project
- Setup Guide
- Development
- Deployment
- Twilio Setup
- Troubleshooting
Error: EACCES: permission denied, open '{...}/dist/handlers/{someFunction}/index.js
The security token included in the request is invalid.
Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
Lambda responded with undefined status code
orindex.get is undefined or not exported
Before proceeding, please ensure the following are installed on your development machine:
- Node
- Git
- Yarn Classic (optional, recommended)
- AWS CLI
- Docker
- Docker Compose
- AWS SAM
- Checkout the project code locally
- Run
yarn
to install project dependencies - Check the
.env
file to update any values specific to your environment (e.g.AWS_PROFILE
)
-
Run
yarn dev
to watch for file changes and start a fast local server -
Run
yarn dev:clean
to remove any conflicting containers from a previous sessionIf necessary, run aws config to insert your information.
Documentation for handlers can be found here
Documentation for tests can be found here
Deployment information can be found here
- Buy a virtual phone number on Twilio If you are in the trial account and if it is necessary, release your current trial number: https://www.twilio.com/console/phone-numbers/incoming Then, buy a local number using the same link.
- Obtain webhook URL
- If local development, start the server then use ngrok to make it globally accessible (npx ngrok http 3000)
- If deployed version, copy the API server url from the CloudFormation Output
- Change the "A Call Comes In" webhook URL on the Twilio dashboard for your Webhook URL
- Select HTTP GET method
- Dial the virtual number and test your application
This error sometimes occurs when running yarn dev
. The command does two
things: creates some docker containers to run our functions, and starts webpack
in watch mode to compile our code. Ideally, webpack compiles the code first to
create the correct directory structure. Sometimes though, the docker containers
are created first, and they implicitly create a volume (owned by root
) where
our code should go. To resolve this, you can chown -R
the dist
directory to
give webpack permission to write there again.
This is an error normally caused when a function can't find the DynamoDB table.
Generally this is caused when the TABLE_NAME
variable is incorrectly set -
check dev/envVars.json
to ensure your function is
receiving it correctly.
The AWS SDK is unable to authenticate you. This is normally caused by a similar
error as above (TABLE_NAME
incorrectly set). Add AWS_ACCESS_KEY_ID
and
AWS_SECRET_ACCESS_KEY
and AWS_REGION
to dev/envVars.json
for your
function.
This is normally a sign that the lambda function has not been built correctly.
Try running yarn build
before yarn dev
again. This will often be related to
the Error: EACCES: permission denied
error above.