Is it normal to get a bunch of "unhandled rejectio...
# automation-api
Is it normal to get a bunch of "unhandled rejection" errors when the inline program doesn't return all of the resources created? In other words, it is a requirement to output all resources?
No. That sounds similar to this bug that was reported in the last few days:
If you're facing the same error, would you mind dropping some notes and/or a repro in the issue?
The errors I'm getting are a little different. They look like this:
Copy code
build	11-May-2021 20:19:54	unhandled rejection: CONTEXT(137): resource:sordino[kubernetes:<|>]
build	11-May-2021 20:19:54	STACK_TRACE:
build	11-May-2021 20:19:54	Error
build	11-May-2021 20:19:54	    at Object.debuggablePromise (/pulumi-repo/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/runtime/debuggable.js:69:75)
build	11-May-2021 20:19:54	    at Object.registerResource (/pulumi-repo/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/runtime/resource.js:220:18)
build	11-May-2021 20:19:54	    at new Resource (/pulumi-repo/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/resource.js:215:24)
build	11-May-2021 20:19:54	    at new CustomResource (/pulumi-repo/node_modules/@pulumi/kubernetes/node_modules/@pulumi/pulumi/resource.js:307:9)
build	11-May-2021 20:19:54	    at new CustomResource (/pulumi-repo/node_modules/@pulumi/apiextensions/customResource.ts:91:9)
build	11-May-2021 20:19:54	    at new VirtualService (/pulumi-repo/node_modules/@bluenile/pulumi-kubernetes-istio/sdk/nodejs/src/v1_7/networking/v1alpha3/virtual-service.ts:20:5)
build	11-May-2021 20:19:54	    at new AppDeployment (/pulumi-repo/node_modules/@bluenile/pulumi-shared/src/k8s/app-deployment.ts:193:31)
build	11-May-2021 20:19:54	    at new DevOpsDeployment (/pulumi-repo/src/devops/index.ts:19:30)
build	11-May-2021 20:19:54	    at DeploymentManager.<anonymous> (/pulumi-repo/src/deployment-manager.ts:206:20)
build	11-May-2021 20:19:54	    at (<anonymous>)
The weird thing is, it spams these repeatedly after Pulumi has "successfully" done a preview with no errors.
That kinda sounds like a dropped dependency somewhere. The pulumi engine things the preview is done but there is outstanding work in the node runtime.
Would you mind opening an issue with a repro and the full error message? (sorry about the verbose errors, hopefully this was improved by which should be released next week).
Also include info about the version of the CLI and nodejs SDK you're using if you don't mind.
Yeah, in the inline program if I return an object which contains all of the resources created, all of these errors go away. Without that it's like it's not waiting for resources to finish.
I'll open an issue
I don't think it's an importing issue. I'm instantiating the objects fine, it's just that unless they're returned in the async function, Pulumi doesn't wait for resources before finishing.
I've found a workaround which just involves returning an empty dummy resource that depends on the main one.