Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organization part of stack name not parsed correctly in some cases #11373

Closed
samox73 opened this issue Nov 16, 2022 · 3 comments
Closed

Organization part of stack name not parsed correctly in some cases #11373

samox73 opened this issue Nov 16, 2022 · 3 comments
Labels
resolution/duplicate This issue is a duplicate of another issue

Comments

@samox73
Copy link

samox73 commented Nov 16, 2022

What happened?

When referencing existing stacks, sometimes the organization part of the stack is not handled correctly:

  • When a project with name test exists for the current user, and a project with stack organizationId/test is created, pulumi fails with
    error: A project with this name already exists
    
    Deleting the user project and trying again successfully creates the project within the organization
  • When executing pulumi up/pulumi destroy in an organization project without a stack being selected explicitly, pulumi will ask which stack to select. Upon selection, pulumi fails with
    error: parsing selected stack: stack names may only contain alphanumeric, hyphens, underscores, and periods
    
    Selecting the stack explicitly resolves this issue.

Steps to reproduce

  • ❯ mkdir test-user && cd test-user
    ❯ pulumi new aws-typescript -n "test" -d "test" -s "test"
    Created project 'test'
    
    Created stack 'test'
    
    aws:region: The AWS region to deploy into: (us-east-1)
    Saved config
    
    Installing dependencies...
    
    
    added 164 packages, and audited 165 packages in 16s
    
    50 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    Finished installing dependencies
    
    Your new project is ready to go! 
    
    To perform an initial deployment, run `pulumi up`
    
    ❯ mkdir test-org && cd test-org
    ❯ pulumi new aws-typescript -n "test" -d "test" -s "powerbot/test"
    error: A project with this name already exists
  • delete the user stack:
    cd ../test-user
    ❯ pulumi stack rm
    This will permanently remove the 'test' stack!
    Please confirm that this is what you'd like to do by typing `test`: test
    Stack 'test' has been removed!
  • try creating the organization stack again:
    ❯ pulumi new aws-typescript -n "test" -d "test" -s "powerbot/test"
    Created project 'test'
    
    Created stack 'powerbot/test'
    
    aws:region: The AWS region to deploy into: (us-east-1)           
    Saved config
    
    Installing dependencies...
    
    
    added 164 packages, and audited 165 packages in 5s
    
    50 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
    Finished installing dependencies
    
    Your new project is ready to go! 
    
    To perform an initial deployment, run `pulumi up`
    
  • create another stack in the organization and try uping any stack after unselecting it explicitly:
    ❯ pulumi stack init powerbot/test2
    Created stack 'powerbot/test2'
    ❯ pulumi stack unselect
    Stack was unselected
    ❯ pulumi up
    Please choose a stack, or create a new one: 
    error: parsing selected stack: stack names may only contain alphanumeric, hyphens, underscores, and periods
    
    

Expected Behavior

Pulumi should parse the organization part of the stack correctly.

Actual Behavior

Pulumi mistakes the orgnization part of the stack as being part of the actual stack name.

Output of pulumi about

❯ pulumi about
CLI          
Version      3.46.1
Go Version   go1.19.2
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.20.0
docker  3.6.0
nodejs  unknown

Host     
OS       arch
Version  "rolling"
Arch     x86_64

This project is written in nodejs: executable='/sbin/node' version='v19.1.0'

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/samox73
User           samox73
Organizations  samox73, powerbot

Dependencies:
NAME            VERSION
@pulumi/aws     5.20.0
@pulumi/awsx    0.40.1
@pulumi/pulumi  3.46.1
@types/node     14.18.33

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the current stack: No current stack

Additional context

I upgraded to version 3.46.0 -> 3.46.1 yesterday, then this started to happen.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@samox73 samox73 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 16, 2022
@pierskarsenbarg
Copy link
Member

Hi this has been fixed and should be released shortly: #11354

@aq17
Copy link
Contributor

aq17 commented Nov 16, 2022

Thanks @pierskarsenbarg!

@aq17 aq17 added resolution/fixed This issue was fixed and removed kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 16, 2022
@aq17 aq17 added resolution/duplicate This issue is a duplicate of another issue and removed resolution/fixed This issue was fixed labels Nov 16, 2022
@aq17
Copy link
Contributor

aq17 commented Nov 16, 2022

Closed as duplicate of #11334

@aq17 aq17 closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants