-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(triggers): deployments of trigger functions fail with TypeError [ERR_INVALID_ARG_TYPE]: The "msecs" argument must be of type number. Received type string
#23407
Comments
Hey @cecheta, where are you finding the |
Ah I see, thanks for being on top of this! |
After merging cdk 2.56.0 today my deployment failed with that error message. |
I'm seeing this error too. I'm not explicitly passing any invocation type. My lambda does have a timout though. Downgrading to the version before 2.56.0 works. |
Since I introduced the bug I will attempt to fix it :) I'm working on a PR |
Not honouring the types specified to the custom resource seems to be related to aws-cloudformation/cloudformation-coverage-roadmap#1037 I'm not sure exactly what the way forward with that specific issue is. I will implement it as string and revert it back in the function handler, but perhaps in the future we can revert that change. |
Is there any update on this as this stops us completely from updating cdk at the moment? |
Holidays are over, I will have time for it soon :) |
TypeError [ERR_INVALID_ARG_TYPE]: The "msecs" argument must be of type number. Received type string
references [23407](aws/aws-cdk#23407).
…23728) Reverts #23062. #23062 introduced #23407, which causes lambda functions that use triggers to fail to invoke with either this error ``` submit response to cloudformation { Status: 'FAILED', Reason: `TypeError [ERR_INVALID_ARG_TYPE]: The "msecs" argument must be of type number. Received type string ('120000')\n` + ' at new NodeError (internal/errors.js:322:7)\n' + ' at validateNumber (internal/validators.js:129:11)\n' + ' at getTimerDuration (internal/timers.js:384:3)\n' + ' at ClientRequest.setTimeout (_http_client.js:865:11)\n' + ' at features.constructor.handleRequest (/var/runtime/node_modules/aws-sdk/lib/http/node.js:82:12)\n' + ' at executeSend (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:370:29)\n' + ' at Request.SEND (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:384:9)\n' + ' at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:102:18)\n' + ' at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)\n' + ' at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14)', StackId: 'arn:aws:cloudformation:us-east-1:***:stack/TestStack/83f77790-806c-11ed-8956-0a55d38b49ed', RequestId: '86a74312-347d-40c4-873a-09eed5b8eddd', PhysicalResourceId: 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED', LogicalResourceId: 'Trigger', NoEcho: undefined, Data: undefined } ``` or ``` Error: Trigger handler failed with status code 202 at handler (/var/task/index.js:53:15) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Runtime.handler (/var/task/__entrypoint__.js:32:24) (RequestId: ab252a7a-e06b-4fcf-b2b4-f59b2dd88734) ``` Reverting for now, since people are unable to upgrade. To unblock this revert, I'm disabling the integration test `dependencies-pnpm`, because when running it locally (and in this PR build) the logical ID of the version changes every run. This has been reproduced by others locally, so it's being disabled until we can resolve that issue. Fixes #23407
|
…23728) Reverts #23062. #23062 introduced #23407, which causes lambda functions that use triggers to fail to invoke with either this error ``` submit response to cloudformation { Status: 'FAILED', Reason: `TypeError [ERR_INVALID_ARG_TYPE]: The "msecs" argument must be of type number. Received type string ('120000')\n` + ' at new NodeError (internal/errors.js:322:7)\n' + ' at validateNumber (internal/validators.js:129:11)\n' + ' at getTimerDuration (internal/timers.js:384:3)\n' + ' at ClientRequest.setTimeout (_http_client.js:865:11)\n' + ' at features.constructor.handleRequest (/var/runtime/node_modules/aws-sdk/lib/http/node.js:82:12)\n' + ' at executeSend (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:370:29)\n' + ' at Request.SEND (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:384:9)\n' + ' at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:102:18)\n' + ' at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)\n' + ' at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14)', StackId: 'arn:aws:cloudformation:us-east-1:***:stack/TestStack/83f77790-806c-11ed-8956-0a55d38b49ed', RequestId: '86a74312-347d-40c4-873a-09eed5b8eddd', PhysicalResourceId: 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED', LogicalResourceId: 'Trigger', NoEcho: undefined, Data: undefined } ``` or ``` Error: Trigger handler failed with status code 202 at handler (/var/task/index.js:53:15) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Runtime.handler (/var/task/__entrypoint__.js:32:24) (RequestId: ab252a7a-e06b-4fcf-b2b4-f59b2dd88734) ``` Reverting for now, since people are unable to upgrade. To unblock this revert, I'm disabling the integration test `dependencies-pnpm`, because when running it locally (and in this PR build) the logical ID of the version changes every run. This has been reproduced by others locally, so it's being disabled until we can resolve that issue. Fixes #23407
…timeouts (#24435) Reopened PR from #23650 and #23788 And re-revert from #23062 ([v2.61.1](https://github.com/aws/aws-cdk/releases/tag/v2.61.1)) Implements #23058 and fixes #23407 Worked on comments from @TheRealAmazonKendra as well. Added an integration test scenario where a Lambda function will be triggered by a Trigger construct, send a message to an SQS queue, which will be consumed by the integration test assertion.
Please add your +1 👍 to let us know you have encountered this
---
### Status: Resolved
This has been fixed as of CDK 2.61.1
### Overview:
Root cause: breaking change in #23062 caused the wrong type to be passed to CloudFormation (
string
where anumber
was expected). The integration test that was supposed to catch this somehow did not run, that is still being investigated.When trying to invoke a function using the
triggers
module, an error occurs when the stack is deployed.InvocationType.EVENT
invocation also does not work as the status code returned is not 200.#### Complete Error Message:
or
### Solution: Revert #23062 until a more permanent fix is found.
Reproduction Steps
Deploy stack:
The text was updated successfully, but these errors were encountered: