pulumi/pulumi · error · Exception

stack name "{stack_name}" must be fully qualified.

Error message

stack name "{stack_name}" must be fully qualified.

What it means

create_or_select_remote_stack_source_with_branch (remote Git stack creation) requires a fully qualified stack name of the form <org>/<project>/<stack>. A bare stack name is rejected with a generic Exception before any workspace is created, because remote operations need the full name to identify the stack.

Source

Thrown at sdk/python/lib/pulumi/automation/_remote_workspace.py:118

        self.username = username


def create_remote_stack_git_source(
    stack_name: str,
    url: Optional[str] = None,
    *,
    branch: Optional[str] = None,
    commit_hash: Optional[str] = None,
    project_path: Optional[str] = None,
    auth: Optional[RemoteGitAuth] = None,
    opts: Optional[RemoteWorkspaceOptions] = None,
) -> RemoteStack:
    """
    PREVIEW: Creates a Stack backed by a RemoteWorkspace with source code from the specified Git repository.
    Pulumi operations on the stack (Preview, Update, Refresh, and Destroy) are performed remotely.
    """
    if not _is_fully_qualified_stack_name(stack_name):
        raise Exception(f'stack name "{stack_name}" must be fully qualified.')

    ws = _create_local_workspace(
        url=url,
        project_path=project_path,
        branch=branch,
        commit_hash=commit_hash,
        auth=auth,
        opts=opts,
    )
    stack = Stack.create(stack_name, ws)
    return RemoteStack(stack)


def create_or_select_remote_stack_git_source(
    stack_name: str,
    url: Optional[str] = None,
    *,
    branch: Optional[str] = None,

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Pass a fully qualified name: "<org>/<project>/<stack>" (e.g. "myorg/myproj/dev")
  2. Include the project name matching the Pulumi.yaml in the remote repo
  3. If the org is unknown, use the actual Pulumi Cloud organization that owns the project

Example fix

// before
create_or_select_remote_stack_source_with_branch(url=repo, stack_name="dev")
// after
create_or_select_remote_stack_source_with_branch(url=repo, stack_name="myorg/myproj/dev")
Defensive patterns

Strategy: validation

Validate before calling

def assert_fully_qualified(stack_name: str) -> None:
    parts = stack_name.split("/")
    if len(parts) != 3 or not all(parts):
        raise ValueError(f'stack name "{stack_name}" must be org/project/stack')

Type guard

def is_fully_qualified_stack_name(stack_name: str) -> bool:
    parts = stack_name.split("/")
    return len(parts) == 3 and all(parts)

Try / catch

try:
    stack = create_or_select_remote_stack_source_with_branch(url=repo, stack_name=name, branch="main")
except Exception as e:
    if "fully qualified" in str(e):
        name = f"{org}/{project}/{name}"
        stack = create_or_select_remote_stack_source_with_branch(url=repo, stack_name=name, branch="main")
    else:
        raise

Prevention

When it happens

Trigger: Calling create_or_select_remote_stack_source_with_branch(url=..., stack_name="dev") where stack_name lacks the org/project/ prefixes.

Common situations: Copy-pasting a local stack name like 'dev' or 'org/dev' into the remote API; forgetting that remote stacks demand three-part names while local create_stack accepts a simple name.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/aeb12b7a5be5bbe5. Report an issue: GitHub.