{"record":{"id":"aeb12b7a5be5bbe5","repo":"pulumi/pulumi","slug":"stack-name-stack-name-must-be-fully-qualified","errorCode":null,"errorMessage":"stack name \"{stack_name}\" must be fully qualified.","messagePattern":"stack name \"(.+?)\" must be fully qualified\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sdk/python/lib/pulumi/automation/_remote_workspace.py","lineNumber":118,"sourceCode":"        self.username = username\n\n\ndef create_remote_stack_git_source(\n    stack_name: str,\n    url: Optional[str] = None,\n    *,\n    branch: Optional[str] = None,\n    commit_hash: Optional[str] = None,\n    project_path: Optional[str] = None,\n    auth: Optional[RemoteGitAuth] = None,\n    opts: Optional[RemoteWorkspaceOptions] = None,\n) -> RemoteStack:\n    \"\"\"\n    PREVIEW: Creates a Stack backed by a RemoteWorkspace with source code from the specified Git repository.\n    Pulumi operations on the stack (Preview, Update, Refresh, and Destroy) are performed remotely.\n    \"\"\"\n    if not _is_fully_qualified_stack_name(stack_name):\n        raise Exception(f'stack name \"{stack_name}\" must be fully qualified.')\n\n    ws = _create_local_workspace(\n        url=url,\n        project_path=project_path,\n        branch=branch,\n        commit_hash=commit_hash,\n        auth=auth,\n        opts=opts,\n    )\n    stack = Stack.create(stack_name, ws)\n    return RemoteStack(stack)\n\n\ndef create_or_select_remote_stack_git_source(\n    stack_name: str,\n    url: Optional[str] = None,\n    *,\n    branch: Optional[str] = None,","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/python/lib/pulumi/automation/_remote_workspace.py#L100-L136","documentation":"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.","triggerScenarios":"Calling create_or_select_remote_stack_source_with_branch(url=..., stack_name=\"dev\") where stack_name lacks the org/project/ prefixes.","commonSituations":"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.","solutions":["Pass a fully qualified name: \"<org>/<project>/<stack>\" (e.g. \"myorg/myproj/dev\")","Include the project name matching the Pulumi.yaml in the remote repo","If the org is unknown, use the actual Pulumi Cloud organization that owns the project"],"exampleFix":"// before\ncreate_or_select_remote_stack_source_with_branch(url=repo, stack_name=\"dev\")\n// after\ncreate_or_select_remote_stack_source_with_branch(url=repo, stack_name=\"myorg/myproj/dev\")","handlingStrategy":"validation","validationCode":"def assert_fully_qualified(stack_name: str) -> None:\n    parts = stack_name.split(\"/\")\n    if len(parts) != 3 or not all(parts):\n        raise ValueError(f'stack name \"{stack_name}\" must be org/project/stack')","typeGuard":"def is_fully_qualified_stack_name(stack_name: str) -> bool:\n    parts = stack_name.split(\"/\")\n    return len(parts) == 3 and all(parts)","tryCatchPattern":"try:\n    stack = create_or_select_remote_stack_source_with_branch(url=repo, stack_name=name, branch=\"main\")\nexcept Exception as e:\n    if \"fully qualified\" in str(e):\n        name = f\"{org}/{project}/{name}\"\n        stack = create_or_select_remote_stack_source_with_branch(url=repo, stack_name=name, branch=\"main\")\n    else:\n        raise","preventionTips":["Format stack names as f\"{org}/{project}/{stack}\" for all remote calls","Validate the name has two '/' separators before calling remote APIs","Reuse the SDK's _is_fully_qualified_stack_name-style checks in your own helpers","Keep local and remote stack naming in one shared builder function"],"tags":["python","automation-api","remote","stack-name"],"backgroundTag":"stack-name-not-fully-qualified","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}