Skip to content

cfn test > InvalidRequest #122

Closed
Closed
@wnkz

Description

@wnkz

Command cfn test from cloudformation-cli generates exception in plugin / lib.

cloudformation_cli_python_lib.exceptions.InvalidRequest: __init__() missing 1 required positional argument: 'responseEndpoint' (TypeError)

Using versions:

  • cloudformation-cli==0.1.10
  • cloudformation-cli-python-plugin==2.1.1
  • cloudformation-cli-python-lib==2.1.1

This is following the release of new versions and the close of issue #112.

Steps to reproduce

Init project

> pipenv --python 3.7.7 install cloudformation-cli cloudformation-cli-python-plugin
> mkdir foo-bar-baz
> cd foo-bar-baz
> pipenv run cfn init
Initializing new project
What's the name of your resource type?
(Organization::Service::Resource)
>> Foo::Bar::Baz
Select a language for code generation:
[1] python36
[2] python37
(enter an integer):
>> 2
Use docker for platform-independent packaging (Y/n)?
This is highly recommended unless you are experienced
with cross-platform Python packaging.
>> Y
Initialized a new project in /private/var/folders/bf/f_z6y6n959193x3csh_pcb0m0000gn/T/tmp.Zk4oqzlM/foo-bar-baz

Build

> pipenv run cfn generate
Generated files for Foo::Bar::Baz
> pipenv run cfn submit --dry-run
Starting Docker build. This may take several minutes if the image 'lambci/lambda:build-python3.7' needs to be pulled first.
Dry run complete: /private/var/folders/bf/f_z6y6n959193x3csh_pcb0m0000gn/T/tmp.Zk4oqzlM/foo-bar-baz/foo-bar-baz.zip

Test

On two separate shells run

  • sam local start-lambda
  • pipenv run cfn test

Lambda output (sam)

START RequestId: b5370d6b-fc74-190a-1bbc-79286a89ddab Version: $LATEST
[ERROR]	2020-09-15T14:23:24.348Z	b5370d6b-fc74-190a-1bbc-79286a89ddab	Invalid request
Traceback (most recent call last):
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 142, in _parse_request
    event = HandlerRequest.deserialize(event_data)
  File "/var/task/cloudformation_cli_python_lib/utils.py", line 98, in deserialize
    event = HandlerRequest(**json_data)
TypeError: __init__() missing 1 required positional argument: 'responseEndpoint'
Handler error
Traceback (most recent call last):
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 142, in _parse_request
    event = HandlerRequest.deserialize(event_data)
  File "/var/task/cloudformation_cli_python_lib/utils.py", line 98, in deserialize
    event = HandlerRequest(**json_data)
TypeError: __init__() missing 1 required positional argument: 'responseEndpoint'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 187, in __call__
    sessions, action, callback, event = self._parse_request(event_data)
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 150, in _parse_request
    raise InvalidRequest(f"{e} ({type(e).__name__})") from e
cloudformation_cli_python_lib.exceptions.InvalidRequest: __init__() missing 1 required positional argument: 'responseEndpoint' (TypeError)
END RequestId: b5370d6b-fc74-190a-1bbc-79286a89ddab
REPORT RequestId: b5370d6b-fc74-190a-1bbc-79286a89ddab	Init Duration: 480.13 ms	Duration: 7.30 ms	Billed Duration: 100 ms	Memory Size: 256 MB	Max Memory Used: 32 MB

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions