{"record":{"id":"65e73099c0164fec","repo":"pulumi/pulumi","slug":"editing-an-organization-member-requires-the-pulumi","errorCode":null,"errorMessage":"editing an organization member requires the Pulumi Cloud backend; run `pulumi login`","messagePattern":"editing an organization member requires the Pulumi Cloud backend; run `pulumi login`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/org/org_member_edit.go","lineNumber":156,"sourceCode":"\treturn out\n}\n\n// defaultOrgMemberEditClientFactory is the production wiring: resolve the\n// cloud backend, pick the effective organization, and hand back the\n// underlying *client.Client.\nfunc defaultOrgMemberEditClientFactory(\n\tctx context.Context, orgFlag string,\n) (orgMemberEditClient, string, error) {\n\tws := pkgWorkspace.Instance\n\topts := display.Options{Color: cmdutil.GetGlobalColorization()}\n\n\tbe, err := cmdBackend.CurrentBackend(ctx, ws, cmdBackend.DefaultLoginManager, nil, opts)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tcloudBackend, ok := be.(httpstate.Backend)\n\tif !ok {\n\t\treturn nil, \"\", errors.New(\n\t\t\t\"editing an organization member requires the Pulumi Cloud backend; run `pulumi login`\")\n\t}\n\n\tuserName, orgs, _, err := cloudBackend.CurrentUser()\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\n\torg := orgFlag\n\tif org == \"\" {\n\t\tdefaultOrg, err := cloudBackend.GetDefaultOrg(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\torg = defaultOrg\n\t}\n\tif org == \"\" {\n\t\torg = userName","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/org/org_member_edit.go#L138-L174","documentation":"The `pulumi org member edit` command only works against the Pulumi Cloud (hosted service) backend, because organization membership management is a cloud-API-only feature. During command setup, the resolved backend is asserted via a Go type assertion `be.(httpstate.Backend)`; when the currently logged-in backend is anything else (e.g. a self-hosted Pulumi Cloud or a local/diy backend), the assertion fails and this error is returned instead of proceeding.","triggerScenarios":"Running `pulumi org member edit` while logged in with `pulumi login --local` (file backend), or against a non-cloud backend (e.g. PULUMI_BACKEND_URL pointing to a self-hosted state backend or `file://`), so CurrentBackend returns a backend that does not implement httpstate.Backend.","commonSituations":"Developer testing locally with the file backend for state management; CI container that ran `pulumi login file://~/.pulumi`; switching from a local dev workflow to org administration without re-logging into app.pulumi.com.","solutions":["Run `pulumi login` (no arguments) to log in to the Pulumi Cloud backend at app.pulumi.com","Verify the active backend with `pulumi whoami -v` and check the backend URL","Unset PULUMI_BACKEND_URL / PULUMI_CONFIG_PASSPHRASE-based local backends in your environment before running org commands","Re-run the command: pulumi org member edit <user-login> --role <role>"],"exampleFix":"// before (shell)\npulumi login --local\npulumi org member edit alice --role admin\n// error: requires the Pulumi Cloud backend\n// after (shell)\npulumi login  # defaults to https://app.pulumi.com\npulumi org member edit alice --role admin","handlingStrategy":"type-guard","validationCode":"// shell, before running org commands\npulumi whoami -v | grep -i 'backend' # expect https://app.pulumi.com\n# if not: pulumi login","typeGuard":"// Go, mirror the library's own check\nfunc asCloudBackend(be backend.Backend) (httpstate.Backend, bool) {\n\tcb, ok := be.(httpstate.Backend)\n\treturn cb, ok\n}\n// in caller:\n// cb, ok := asCloudBackend(be); if !ok { /* prompt re-login */ }","tryCatchPattern":"// Go (CLI returns error)\nif err := runOrgEdit(...); err != nil && strings.Contains(err.Error(), \"requires the Pulumi Cloud backend\") {\n\t// instruct user / exec: pulumi login\n\treturn fmt.Errorf(\"please re-authenticate with the cloud backend: %w\", err)\n}","preventionTips":["Always `pulumi login` (cloud) before org administration commands","Check `pulumi whoami -v` in scripts and fail fast on non-cloud backends","Avoid PULUMI_BACKEND_URL=file:// in environments where you run org commands","Pin CI to cloud auth via PULUMI_ACCESS_TOKEN with `pulumi login`"],"tags":["cli","backend","pulumi-cloud","authentication"],"backgroundTag":"wrong-backend-type","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}