{"record":{"id":"7289b7c142765d19","repo":"dagger/dagger","slug":"s-only-supports-remote-workspaces-or-local-git-wo","errorCode":null,"errorMessage":"%s only supports remote workspaces or local git workspaces; selected workspace is %s: %w","messagePattern":"(.+?) only supports remote workspaces or local git workspaces; selected workspace is (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/dagger/workspace.go","lineNumber":859,"sourceCode":"\nfunc selectedRemoteWorkspaceAddress(ctx context.Context, command string) (workspaceRemoteAddress, string, error) {\n\taddress := strings.TrimSpace(workspaceRef)\n\tif address != \"\" {\n\t\tremote, ok, err := parseWorkspaceRemoteAddress(ctx, address)\n\t\tif err != nil {\n\t\t\treturn workspaceRemoteAddress{}, \"\", err\n\t\t}\n\t\tif ok {\n\t\t\treturn remote, address, nil\n\t\t}\n\t}\n\n\tremote, inferred, err := inferLocalWorkspaceRemoteAddress(ctx, address)\n\tif err != nil {\n\t\tif address == \"\" {\n\t\t\treturn workspaceRemoteAddress{}, \"\", fmt.Errorf(\"%s requires a remote workspace selected with -W or a local workspace with git origin: %w\", command, err)\n\t\t}\n\t\treturn workspaceRemoteAddress{}, \"\", fmt.Errorf(\"%s only supports remote workspaces or local git workspaces; selected workspace is %s: %w\", command, address, err)\n\t}\n\treturn remote, inferred, nil\n}\n\ntype localWorkspaceRemoteInfo struct {\n\trepoRoot      string\n\tcloneRef      string\n\tworkspacePath string\n}\n\nfunc localWorkspaceRemoteInfoForAddress(ctx context.Context, address string) (localWorkspaceRemoteInfo, error) {\n\tlocalPath := address\n\tif localPath == \"\" {\n\t\tlocalPath = \".\"\n\t}\n\tif parsed, err := url.Parse(localPath); err == nil && parsed.Scheme == \"file\" {\n\t\tlocalPath = parsed.Path\n\t}","sourceCodeStart":841,"sourceCodeEnd":877,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/internal/cmd/dagger/workspace.go#L841-L877","documentation":"Same resolution failure as the \"requires -W\" case, but raised when the user DID select a workspace address that is not a parseable remote workspace address and also cannot be projected onto a local git workspace. The error names the selected workspace and states that only remote workspaces or local git workspaces are supported.","triggerScenarios":"selectedRemoteWorkspaceAddress called with a non-empty workspaceRef that fails parseWorkspaceRemoteAddress, and inferLocalWorkspaceRemoteAddress on that address also errors — e.g. a typo'd path, a bare local directory without git, or a malformed workspace string.","commonSituations":"Typo in the -W value so it neither parses as a remote address nor exists as a git path; passing a plain folder name that isn't a git repo; pointing at a repo clone without an origin remote.","solutions":["Correct the selected workspace address to a valid remote workspace address (e.g. a GitHub repo URL).","If a local checkout was intended, ensure the path is a git repository with a remote origin.","Run `git rev-parse --show-toplevel` and `git config --get remote.origin.url` in the target path to verify it qualifies."],"exampleFix":"// before\ndagger cloud check list -W ./not-a-repo\n\n// after\ndagger cloud check list -W github.com/org/repo","handlingStrategy":"validation","validationCode":"if _, _, err := parseWorkspaceAddressFlag(wsAddr); err != nil {\n    // selected value is neither a remote address nor a git path: fix before invoking\n}","typeGuard":null,"tryCatchPattern":"if err := runCmd(); err != nil {\n    if strings.Contains(err.Error(), \"only supports remote workspaces or local git workspaces\") {\n        // fall back to the canonical remote address\n        return runCmdWithAddress(canonicalRemoteAddress)\n    }\n    return err\n}","preventionTips":["Copy the workspace address from the Dagger Cloud UI rather than typing it.","Validate the -W value parses as a remote workspace address before scripting.","Keep local checkouts as git clones with origin set."],"tags":["git","workspace","cli"],"backgroundTag":"workspace-git-origin-missing","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}