Skip to content

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

@butla

Description

@butla

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
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions