{"record":{"id":"c8430f88592a7029","repo":"pulumi/pulumi","slug":"no-open-request-was-created-for-this-environment","errorCode":null,"errorMessage":"no open request was created for this environment; check that an open approval rule applies to it","messagePattern":"no open request was created for this environment; check that an open approval rule applies to it","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/esc/cli/env_open_request.go","lineNumber":68,"sourceCode":"\n\t\t\tref, _, err := envcmd.getExistingEnvRef(ctx, args)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tresp, err := envcmd.esc.client.CreateEnvironmentOpenRequest(\n\t\t\t\tctx,\n\t\t\t\tref.orgName,\n\t\t\t\tref.projectName,\n\t\t\t\tref.envName,\n\t\t\t\tint(grantExpiration.Seconds()),\n\t\t\t\tint(accessDuration.Seconds()),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(resp.ChangeRequests) == 0 {\n\t\t\t\treturn errors.New(\"no open request was created for this environment; \" +\n\t\t\t\t\t\"check that an open approval rule applies to it\")\n\t\t\t}\n\n\t\t\tvar changeRequestDescription *string\n\t\t\tif reason != \"\" {\n\t\t\t\tchangeRequestDescription = &reason\n\t\t\t}\n\n\t\t\t// An open request can span multiple change requests: one for the target environment\n\t\t\t// and one for each gated import. Submit them all up front so the output paths below\n\t\t\t// only differ in how they present the result.\n\t\t\tfor i := range resp.ChangeRequests {\n\t\t\t\tif err := envcmd.esc.client.SubmitChangeRequest(\n\t\t\t\t\tctx, ref.orgName, resp.ChangeRequests[i].ChangeRequestID, changeRequestDescription,\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"submitting change request: %w\", err)\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/esc/cli/env_open_request.go#L50-L86","documentation":"`pulumi env open-request` calls CreateEnvironmentOpenRequest, which returns the change request(s) needed to open a protected environment: one for the target environment and one per gated import. If the API returns an empty list, the CLI raises this error because nothing was actually created — typically meaning no open-approval rule covers the environment, so no request workflow exists for it.","triggerScenarios":"Running `pulumi env open-request <org>/<project>/<env>` against an environment that is not protected by an approval/open rule, so the service has nothing to create and returns zero change requests.","commonSituations":"Targeting the wrong environment name or project, running against an environment whose approval policy was removed or never configured, or expecting a change-request flow in an org whose Pulumi Cloud plan/settings do not have environment approval rules enabled.","solutions":["Verify an open/approval rule is configured for that environment (or its imports) in the Pulumi Cloud environment settings","Confirm the environment reference `<org>/<project>/<env>` points at the intended protected environment","If the environment is not gated, skip open-request and run `pulumi env open` directly"],"exampleFix":"// before\npulumi env open-request myorg/proj/dev   # dev has no approval rule\n// after\npulumi env open myorg/proj/dev           # open directly, or configure an approval rule on dev first","handlingStrategy":"validation","validationCode":"# Only call open-request for environments covered by an approval rule\npulumi env open-request \"$ENV_REF\" || \\\n  case \"$?\" in 0) ;; *) echo \"check approval rules for $ENV_REF\" >&2; exit $? ;; esac","typeGuard":null,"tryCatchPattern":"out=$(pulumi env open-request \"$ENV_REF\" 2>&1) || {\n  case \"$out\" in\n    *\"no open request was created\"*) echo \"$ENV_REF has no approval rule; using env open\" >&2; pulumi env open \"$ENV_REF\" ;;\n    *) printf '%s\\n' \"$out\" >&2; exit 1 ;;\n  esac\n}","preventionTips":["Verify the environment has an open/approval rule before automating open-request","Double-check org/project/environment names in scripts; a typo can hit an ungated environment","Document which environments are gated and which are opened directly"],"tags":["esc","change-request","approval-workflow","cli"],"backgroundTag":"no-approval-rule-configured","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}