better-shampoo-48884
03/21/2021, 2:13 PMbetter-shampoo-48884
03/21/2021, 2:14 PMbetter-shampoo-48884
03/21/2021, 9:50 PMlet currentStack = "dev-devsecops"
const stack = await pulumi.LocalWorkspace.createOrSelectStack({
projectName: "k8s-baseline",
program: pulumiProgram,
stackName: currentStack
},{
projectSettings: {
name: "k8s-baseline",
author: "It's a me",
runtime: "nodejs",
backend: {
url: "<azblob://pulumi-state>"
},
description: "Baseline Kubernetes configuration for xxxxx"
},
secretsProvider: "<azurekeyvault://xxxxxvault.azure.net/keys/pulumi>"
})
I'm getting:
commandResult: CommandResult {
stdout: '',
stderr: 'error: getting secrets manager: passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables\n',
code: 4294967295,
err: undefined
There is no Pulumi.yaml or stack yml in the directory where I'm running this btw. Could there be something of the stack previously cached or something? I would have thought providing the secretsProvider explicitly removed the need for the passphrase?better-shampoo-48884
03/25/2021, 12:52 PMbetter-shampoo-48884
03/26/2021, 3:36 PMimport * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure-native";
export const createFunction = async () => { // edit: exported createFunction in addition to stackInfo based on discussion in thread :)
....pulumistuff...
/** edit: Adding more fluff to show how I actually return something from the created variable **/
const rg = new azure.resources.ResourceGroup("myResourceGroup", {
location: "location",
resourceGroupName: "myResourceGroup",
},{
protect: false // prevents this resource from being deleted. unprotect with `pulumi state unprotect <resource URN>`
})
let created : any = {
parameters: {
name: rg.name.apply(name => name),
location: rg.location.apply(location => location),
id: rg.id.apply(id => id),
resource: rg
}
}
....pulumistuff...
return created
}
export const stackInfo = createFunction();
would I be able to import createFunction as my pulumiProgram in automation?better-shampoo-48884
03/26/2021, 3:47 PMbetter-shampoo-48884
03/27/2021, 6:39 AMĪ» ts-node automation.ts
CommandError: code: 4294967295
stdout:
stderr: error: decrypting secrets: passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables
err?:
at Object.createCommandError (c:\<path>\node_modules\@pulumi\pulumi\x\automation\errors.js:71:17)
at ChildProcess.<anonymous> (c:\<path>\node_modules\@pulumi\pulumi\x\automation\cmd.js:63:40)
See code in post above for source, and in the thread for the automation.ts code as well.. Basically I'm running automation on top of a preexisting standard pulumi-cli set of stacks in a project. Previously, I got the message when I failed to set AZURE_KEYVAULT_AUTH_VIA_CLI to true - but now I've both got it in the environment I'm executing in AND the envVars of the LocalWorkspace settings. Also - the CommandError: code: is a bit weird because there are quite a lot of hits for that exact code.. which is really weird.. and that code returns results relating from electron stuff to .msp upgrades of adobe software to IIS stuff.. The most useful result was the IIS one which has this as the title: ERROR_FILE_IN_USE msdeploy.exe failed with return code: 4294967295
- could this be a filesystem issue somehow?!
Using pulumi 2.23.2
if it helps.better-shampoo-48884
03/27/2021, 9:48 AM--suppress-outputs
for the cli) to automation stack operations? Think that might actually be the cause of some of my issues..better-shampoo-48884
03/27/2021, 9:52 AMbetter-shampoo-48884
03/27/2021, 10:51 AMbetter-shampoo-48884
03/27/2021, 10:51 AMbetter-shampoo-48884
03/27/2021, 10:54 AMbetter-shampoo-48884
03/27/2021, 12:15 PMpulumi-cli
did not! WHY there's a difference between the two in this case, I have NO idea, the config is the same regardless. Deep in the code where I create storageAccounts, I had this:
} else if (!saConfiguration.common.hasOwnProperty("subnetReference")) {
Naturally, this is no good when .common
does not exist on saConfiguration
, as was the case with this stack. Pulumi-cli doesn't care apparently. However, changing it to this made everything work just fine:
} else if (!saConfiguration.common?.hasOwnProperty("subnetReference")) {
(adding a ?
to the .common). How the hell this relates to error code 4294967295 is still a mystery though. Anyway.. now I get to go thorugh a few thousand lines of code and try to see if I have any more of these potentially invalid references.. sigh..better-shampoo-48884
03/27/2021, 4:27 PMbetter-shampoo-48884
03/27/2021, 6:00 PMError: The Pulumi runtime detected that 904 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
This works fine a) with pulumi cli, b) automation locally with tsc
, c) automation locally with ts-node
. Yet not in azure pipelines with either tsc
or ts-node
. And yes - if there was an alternative I could use I would.plain-quill-22197
03/30/2021, 1:11 PMplain-quill-22197
03/30/2021, 1:11 PMplain-quill-22197
03/30/2021, 1:12 PMerror: could not create stack: provided project name "roomote-cal-sync" doesn't match Pulumi.yaml
plain-quill-22197
03/30/2021, 1:12 PMplain-quill-22197
03/30/2021, 1:13 PMvar program = PulumiFn.Create(() => {
var autoDevOps = new DefaultStack();
return new Dictionary<string, object> {{"Urn", autoDevOps.Urn}};
}
);
var stackArgs = new InlineProgramArgs(Defaults.ProjectName, stack, program);
using var appStack = await LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
plain-quill-22197
03/30/2021, 1:13 PMplain-quill-22197
03/30/2021, 1:21 PMplain-quill-22197
03/30/2021, 1:22 PMroomote-cal-sync
to dummy
- it started to progress furtherbrave-planet-10645
03/30/2021, 1:23 PMInlineProgramArgs
to the same as what's in the Pulumi.yaml file?plain-quill-22197
03/30/2021, 1:24 PMdummy
as a name. I didn't have the Pulumi.yaml file as none of the automation API samples have it. I also was running samples and it worked. I also tried to add the yaml file with the project name matching, but I don't think the local workspace uses it at allplain-quill-22197
03/30/2021, 1:25 PMplain-quill-22197
03/30/2021, 1:26 PMbrave-planet-10645
03/30/2021, 1:27 PMplain-quill-22197
03/30/2021, 1:27 PMDuplicate resource URN 'urn:pulumi:production::dummy::pulumi:pulumi:Stack::dummy-production'; try giving it a unique name
but at least I moved beyond the project name mismatch issue šplain-quill-22197
03/30/2021, 1:30 PMplain-quill-22197
03/30/2021, 1:30 PM