Hello any reason why i would be recieving this er...
# general
v
Hello any reason why i would be recieving this error on "pulumi up" with this new project? No resources exist in azure. I have also deleted and re-created the stack with no success pulumipulumiStack (Azure.ResourceGroups-dev): error: Duplicate resource URN 'urnpulumidev:Azure.ResourceGroupspulumipulumiStack:Azure.ResourceGroups-dev'; try giving it a unique name my pulumi is up-to-date
s
I think you may have reused a project name.
v
there is no stack with that name
s
How about in a different project with the same name? If you're using the Pulumi Cloud backend, you can check there for all your projects and stacks.
The project name looks like
Azure.ResourceGroups
v
I tried a new project with a new name
that is the new one i created
i even deleted and tried again no such luck
s
Did you check Pulumi Cloud? Note that
pulumi destroy
does not remove the stack. You have to also do
pulumi stack rm
to remove the stack itself.
v
yes i did check Pulumi Cloud
yes i also did pulumi stack rm
s
Can you paste the entire command line output for
pulumi up
? (Please use codefences for readabilitu.)
v
error: Duplicate resource URN 'urn:pulumi:dev::Azure.ResourceGroups::pulumi:pulumi:Stack::Azure.ResourceGroups-dev'; try giving it a unique name
output.txt
@stocky-restaurant-98004 is this the output you are looking for?
s
Just the regular output from the command line, like
pulumi up -y | pbcopy
v
Type                 Name                 Plan     Info
pulumi:pulumi:Stack  rg2-Resource.Groups           1 error
Diagnostics:
pulumi:pulumi:Stack (rg2-Resource.Groups):
error: Duplicate resource URN 'urn:pulumi:Resource.Groups::rg2::pulumi:pulumi:Stack::rg2-Resource.Groups'; try giving it a unique name
So when i run this line in the main it works
static Task<int> Main() => Pulumi.Deployment.RunAsync<ResourceGroupStack>();
but when i change it to this is when it gives the duplicate URN
static Task<int> Main() => Pulumi.Deployment.RunAsync(async () => new ResourceGroupStack("rg-classlibtest-2", "eastus"));
The Output shows that is is trying to create a duplicate resource. I don't see any duplicate stacks.
I0828 17:26:44.020595  130016 log.go:81] ResourceMonitor.RegisterResource received: t=pulumi:pulumi:Stack, name=shopify.azure.resource.groups-dev, custom=false, #props=0, parent=, protect=false, provider=, deps=[], deleteBeforeReplace=<nil>, ignoreChanges=[], aliases=[], customTimeouts=, providers=map[], replaceOnChanges=[], retainOnDelete=false, deletedWith=
I0828 17:26:44.020595  130016 log.go:81] ResourceMonitor.RegisterResource received: t=pulumi:pulumi:Stack, name=shopify.azure.resource.groups-dev, custom=false, #props=0, parent=, protect=false, provider=, deps=[], deleteBeforeReplace=<nil>, ignoreChanges=[], aliases=[], customTimeouts=, providers=map[], replaceOnChanges=[], retainOnDelete=false, deletedWith=
hey @stocky-restaurant-98004 any ideas on this?
w
@victorious-ability-58329 I believe it’s because you’re
ResourceGroupStack
class is still declared as type
: Stack
. And when used in the second form (
async() => …
) Pulumi is trying to create the stack a second time. Remove the
: Stack
should solve the problem.