sparse-intern-71089
03/02/2021, 2:22 PMbored-oyster-3147
03/02/2021, 3:51 PMicy-jordan-58549
03/02/2021, 4:23 PMicy-jordan-58549
03/02/2021, 4:25 PMicy-jordan-58549
03/02/2021, 4:26 PMconst stack = await LocalWorkspace.createOrSelectStack({
stackName: `team/sandbox`,
projectName,
program: () =>
create({
theme: appConfig.theme,
appName: deploymentConfig.appName,
relativeRecordSetName: deploymentConfig.appName,
baseName: deploymentConfig.baseName,
emailSupport: '<mailto:support@ssss.com|support@ssss.com>'
})
});
icy-jordan-58549
03/02/2021, 4:27 PMicy-jordan-58549
03/02/2021, 4:44 PMprogram: () => {
const config = new pulumi.Config();
const location =
config.get('location') || azurePulumi.Locations.CentralUS;
const resourceGroup = new resources.ResourceGroup('resourceGroup', {
resourceGroupName: `${deploymentConfig.appName}-rg`,
location: location
});
return Promise.resolve({
resourceGroupName: resourceGroup.name
});
}
icy-jordan-58549
03/02/2021, 4:44 PM[ExceptionsHandler] The Pulumi runtime detected that 6 promises were still active
at the time that the process exited. There are a few ways that this can occur:
* Not using `await` or `.then` on a Promise returned from a Pulumi API
* Introducing a cyclic dependency between two Pulumi Resources
* A bug in the Pulumi Runtime
Leaving promises active is probably not what you want. If you are unsure about
why you are seeing this message, re-run your program with the `PULUMI_DEBUG_PROMISE_LEAKS`
environment variable. The Pulumi runtime will then print out additional
debug information about the leaked promises. +42751ms
icy-jordan-58549
03/02/2021, 5:27 PMazure-nextgen
, keep getting on this
program: () => {
const resourceGroup = new azurePulumi.core.ResourceGroup(
'resource-group',
{
name: `${deploymentConfig.appName}-rg`,
location: 'centralus'
}
);
return Promise.resolve({
resourceGroupName: resourceGroup.name,
fqdn: '<http://hello-world.com>'
});
}
icy-jordan-58549
03/02/2021, 5:28 PMSTACK_TRACE:
Error
at Object.debuggablePromise (node_modules/@pulumi/pulumi/runtime/debuggable.js:69:75)
at Object.registerResource (node_modules/@pulumi/pulumi/runtime/resource.js:219:18)
at new Resource (node_modules/@pulumi/pulumi/resource.js:215:24)
at new CustomResource (node_modules/@pulumi/pulumi/resource.js:307:9)
at new ResourceGroup (node_modules/@pulumi/core/resourceGroup.ts:98:9)
at Object.program [as init] (packages/server/infra-service/src/infra/infra.service.ts:109:43)
at Stack.<anonymous> (packages/server/infra-service/node_modules/@pulumi/pulumi/runtime/stack.js:86:43)
at Generator.next (<anonymous>)
at fulfilled (packages/server/infra-service/node_modules/@pulumi/pulumi/runtime/stack.js:18:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
red-match-15116
03/02/2021, 5:35 PMprogram: () => {
const resourceGroup = new azurePulumi.core.ResourceGroup(
'resource-group',
{
name: `${deploymentConfig.appName}-rg`,
location: 'centralus'
}
);
return {
resourceGroupName: resourceGroup.name,
fqdn: '<http://hello-world.com>'
};
}
Note that we are just returning an object from the program rather than a promise.red-match-15116
03/02/2021, 5:36 PMicy-jordan-58549
03/02/2021, 5:41 PMNo overload matches this call.
Overload 1 of 2, '(args: LocalProgramArgs, opts?: LocalWorkspaceOptions | undefined): Promise<Stack>', gave the following error.
Argument of type '{ stackName: string; projectName: string; program: () => { resourceGroupName: Output<string>; fqdn: string; }; }' is not assignable to parameter of type 'LocalProgramArgs'.
Object literal may only specify known properties, and 'projectName' does not exist in type 'LocalProgramArgs'.
Overload 2 of 2, '(args: InlineProgramArgs, opts?: LocalWorkspaceOptions | undefined): Promise<Stack>', gave the following error.
Type '() => { resourceGroupName: Output<string>; fqdn: string; }' is not assignable to type 'PulumiFn'.
Type '{ resourceGroupName: Output<string>; fqdn: string; }' is missing the following properties from type 'Promise<void | Record<string, any>>': then, catch, [Symbol.toStringTag], finallyts(2769)
localWorkspace.d.ts(296, 5): The expected type comes from property 'program' which is declared here on type 'InlineProgramArgs'
icy-jordan-58549
03/02/2021, 5:42 PMicy-jordan-58549
03/02/2021, 5:44 PMexport declare type PulumiFn = () => Promise<Record<string, any> | void>;
icy-jordan-58549
03/02/2021, 5:45 PMred-match-15116
03/02/2021, 5:46 PMasync
up top. Did you happen to take a look at the example I linked?icy-jordan-58549
03/02/2021, 5:47 PMicy-jordan-58549
03/02/2021, 5:48 PMred-match-15116
03/02/2021, 5:48 PMLocalWorkspace.createOrSelectStack
returns a Promise the entire script needs to be wrapped in an async function. Are you doing this?
https://github.com/pulumi/automation-api-examples/blob/main/nodejs/inlineProgram-ts/index.ts#L99
If you still believe something isn’t working as it should feel free to open an issue.icy-jordan-58549
03/02/2021, 5:51 PMicy-jordan-58549
03/02/2021, 6:10 PMicy-jordan-58549
03/02/2021, 6:11 PMred-match-15116
03/02/2021, 6:18 PMPULUMI_DEBUG_PROMISE_LEAKS=true
to get more verbose logging of error messages.
If you feel that there is a bug in pulumi, please open an issue with code to reproduce the issue.icy-jordan-58549
03/02/2021, 6:23 PMPULUMI_DEBUG_PROMISE_LEAKS=true
doesn’t make any changes, due to the way you spawn the process (pulumi)icy-jordan-58549
03/02/2021, 6:24 PMicy-jordan-58549
03/03/2021, 6:59 AMicy-jordan-58549
03/03/2021, 6:59 AMicy-jordan-58549
03/03/2021, 6:59 AMicy-jordan-58549
03/03/2021, 10:39 AMaws
provider, but not for azure
, any ideas why? https://github.com/pulumi/pulumi/issues/6457