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

UnhandledPromiseRejectionWarning: TypeError: Incorrectly typed arguments to startBatch #4

Open
kaaloo opened this issue Dec 4, 2019 · 5 comments

Comments

@kaaloo
Copy link

kaaloo commented Dec 4, 2019

Hi,

I came across your Medium post on pulumi-run-fargate-task today and it's exactly what I was looking for ! I unfortunately got bit by a compilation error, namely with

import pulumi from '@pulumi/pulumi'
import awsx from '@pulumi/awsx'

in fargate-run-task.ts and

import awsSdk from 'aws-sdk'

in runFargateTask.ts. These were easy enough to fix, but then when I actually call FargateRunTask I'm getting an exception:

  pulumi:pulumi:Stack (aws-architecture-dev):
    error: update failed
 
    (node:24873) UnhandledPromiseRejectionWarning: TypeError: Incorrectly typed arguments to startBatch
        at handleError (/home/luis/Code/outmind/outmind-app/aws-architecture/node_modules/grpc/src/server.js:72:8)
        at sendUnaryData (/home/luis/Code/outmind/outmind-app/aws-architecture/node_modules/grpc/src/server.js:598:9)
        at Object.<anonymous> (/home/luis/Code/outmind/outmind-app/aws-architecture/node_modules/@pulumi/pulumi/cmd/dynamic-provider/index.js:184:20)
        at Generator.throw (<anonymous>)
        at rejected (/home/luis/Code/outmind/outmind-app/aws-architecture/node_modules/@pulumi/pulumi/cmd/dynamic-provider/index.js:19:65)
    (node:24873) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    (node:24873) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I tried wrapping bits of code in pulumi-run-fargate-task in try / catch blocks to no avail. Any idea what could be happening here? I really love this approach and would like to use it in my code.

Thanks,
Luis

@JakeGinnivan
Copy link
Contributor

Hey Luis, thanks for the report. Will look into it and get it sorted this morning!

@kaaloo
Copy link
Author

kaaloo commented Dec 6, 2019

Hey Jake, I saw two different grpc versions in my node_modules so I cleaned that up but the problem persists. Googling around I came across this issue grpc/grpc-node#369 which seems very similar to what I'm experiencing. When the FargateRunTask constructor is called the pulumi deployment just hangs, then when exiting with Ctrl-C twice you get the above behavior.

@kaaloo
Copy link
Author

kaaloo commented Dec 6, 2019

So Jake, the issue arises if you don't have a aws:region key setup in your config. It's weird because I do have the region set up but maybe there is an issue with the Pulumi yaml file name. In any case I traced the error down to that. So to fix this it could be a simple README.md update stating that the region is required, but even better it would be good to throw an Error if the region is not present in the config.

@JakeGinnivan
Copy link
Contributor

Thanks for looking into it, I had started creating an example project in here and tracking it down. Then my new mac died so needed to get it replaced.

Will try to improve over the next few days now I am up and running again

@kaaloo
Copy link
Author

kaaloo commented Dec 9, 2019

Hello Jake, I found and interesting discussion on the Pulumi Slack which provides a workaround to the aws:region issue:

https://pulumi-community.slack.com/archives/C84L4E3N1/p1566586569018900?thread_ts=1566586569.018900

Basically, you have to get the awsRegion value outside of the body of the dynamic resource provider. I'll test this and send you a PR for the issues I've found if it works.

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