pulumi: Pulumi CLI hangs for a minute at "Previewing update"
@mikhailshilkov is frequently hitting issues with a pulumi up hanging for more than a minute. This does not reproduce consistently, and is not unique to one stack or program. It does appear to happen several times in a row and then go away.
This is on Windows.
The following two events from a pulumi up --logtostderr -v=9 --debug 2> out.txt where more than a minute apart. The rest of the update before and after this looks pretty “normal”.
I0624 17:44:34.617570 12660 eventsink.go:63] eventSink::Debug(<{%reset%}>All required Resource Providers are registered<{%reset%}>)
I0624 17:45:45.863536 12660 eventsink.go:60] Running program 'C:\work\pulumi\azure-play' in pwd 'C:\work\pulumi\azure-play' w/ args:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 38 (28 by maintainers)
@dsschneidermann thanks for thorough investigation we run into similar problem, when running pulumi in pipelines it would hang for several minutes before the update starts
it was in fact due to type checking in ts-node
nowadays it is possible to turn off type-checking using env variable https://github.com/pulumi/pulumi/pull/8981 setting
PULUMI_NODEJS_TRANSPILE_ONLY=trueresolved the long hang timesClosing my investigation here, the CLI pause is caused by
ts-noderunning typechecks for the index.ts file and having to pull in all of the Pulumiazure-nativetypes as well. Various attempts to speed this up, eg. importing only exactly what is needed, updatingts-nodefrom version 7 (the 3 year old version that supports this caching) to version 10, etc, all resulted in way too slow first-time builds.So until we port our deployments to Python, where we’ll have better control over the typecheck process, we’re using the workaround of editing the Pulumi CLI source to skip typechecking.
Having tested this approach with the AzureRM provider and
azure-native, skipping typechecks and introducing various typing errors has the expected effects of causing errors during deployment, but doesn’t cause any breakage of the Pulumi stack. YMMV.Below is my snippet for editing the Pulumi CLI to disable typechecks:
@damianh Note that the symptoms you describe are almost certainly due to https://github.com/pulumi/pulumi/issues/3309. That is nominally fixed now - though there is some remaining work to make it harder to trip over this - https://github.com/pulumi/pulumi/issues/3528.
If anyone can repro this - on any platform - could you please capture a trace per https://www.pulumi.com/docs/troubleshooting/#performance and share it either here or in DM in the pulumi-community slack at https://slack.pulumi.com/.