https://pulumi.com logo
#general
Title
# general
v

victorious-ability-58329

08/24/2023, 7:48 PM
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

stocky-restaurant-98004

08/24/2023, 8:38 PM
I think you may have reused a project name.
v

victorious-ability-58329

08/24/2023, 8:38 PM
there is no stack with that name
s

stocky-restaurant-98004

08/24/2023, 8:40 PM
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

victorious-ability-58329

08/24/2023, 8:41 PM
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

stocky-restaurant-98004

08/24/2023, 8:41 PM
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

victorious-ability-58329

08/24/2023, 8:42 PM
yes i did check Pulumi Cloud
yes i also did pulumi stack rm
s

stocky-restaurant-98004

08/24/2023, 8:44 PM
Can you paste the entire command line output for
pulumi up
? (Please use codefences for readabilitu.)
v

victorious-ability-58329

08/24/2023, 8:49 PM
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

stocky-restaurant-98004

08/25/2023, 2:09 PM
Just the regular output from the command line, like
pulumi up -y | pbcopy
v

victorious-ability-58329

08/25/2023, 2:18 PM
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

witty-candle-66007

09/06/2023, 2:19 PM
@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.
18 Views