Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'starting_position' in config.py:155 when running without arguments #151

Open
butla opened this issue Dec 21, 2017 · 2 comments
Open

Comments

@butla
Copy link

butla commented Dec 21, 2017

I've never used lambda-uploader before, but I decided to give it a go, because I'm starting with AWS Lambda. So I put some python code in the project's directory, added lambda.json (content below), and simply ran lambda-uploader without any arguments and saw this error:

�� Unexpected error. Please report this traceback.
Uploader: 1.2.0
Botocore: 1.4.8
Boto3: 1.8.3

Traceback (most recent call last):
  File "/home/butla/.local/lib/python3.6/site-packages/lambda_uploader/shell.py", line 193, in main
    _execute(args)
  File "/home/butla/.local/lib/python3.6/site-packages/lambda_uploader/shell.py", line 58, in _execute
    variables=args.variables)
  File "/home/butla/.local/lib/python3.6/site-packages/lambda_uploader/config.py", line 54, in __init__
    self._validate_subscription()
  File "/home/butla/.local/lib/python3.6/site-packages/lambda_uploader/config.py", line 169, in _validate_subscription
    validate_kinesis()
  File "/home/butla/.local/lib/python3.6/site-packages/lambda_uploader/config.py", line 155, in validate_kinesis
    if ksub['starting_position'] not in valid_starting_pos:
KeyError: 'starting_position'

More info:

  • I have requirements.txt in the directory.
  • I'm on Kubuntu 17.10.
  • installed lambda-uploader with pip3 install --user
  • my lambda.json is below. Still have to ignore a bunch of files. Also, changed some names and descriptions for "secrecy" :)
{
  "name": "kinesis-worker",
  "description": "Takes events off the Kinesis queue and puts them into the DB.",
  "region": "us-east-1",
  "runtime": "python3.6",
  "handler": "kinesis_worker.dump_records_to_db",
  "role": "arn:aws:iam::609235665469:role/test_worker_role",
  "ignore": [
    "asd"
  ],
  "subscription": {
    "kinesis": {
      "stream": "arn:aws:kinesis:us-east-1:609235665469:stream/test_stream",
      "batch_size": 500
    }
  }
}
@martinb3
Copy link
Contributor

martinb3 commented Dec 21, 2017

Thanks for the report! It looks like perhaps stream, batch_size, and starting_position are required fields, but we left off starting_position from the example in the README.md. It should be set to TRIM_HORIZON, LATEST, or AT_TIMESTAMP. Try that and let us know if that fixes it?

@butla
Copy link
Author

butla commented Dec 21, 2017

Oh. I kind of assumed that all the missing values will be filled in with the values from the current configuration in AWS. Too be fair, that might have been a stretch :) Definitely, a clear error message will help. Should I leave the issue open until the example is fixed and/or error message is added?

BTW, I was able to upload the lambda now, but I got another error. Will report it in a separate issue in a second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants