{"record":{"id":"568fd014f5683345","repo":"pulumi/pulumi","slug":"saving-project-w","errorCode":null,"errorMessage":"saving project: %w","messagePattern":"saving project: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/operations/up.go","lineNumber":427,"sourceCode":"\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t// Copy the template files from the repo to the temporary \"virtual workspace\" directory.\n\t\tif err = cmdTemplates.CopyTemplateFiles(template.Dir, temp, true, name, description); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Load the project, update the name & description, remove the template section, and save it.\n\t\tproj, root, err := ws.ReadProject(\"\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tproj.Name = tokens.PackageName(name)\n\t\tproj.Description = &description\n\t\tproj.Template = nil\n\t\tif err = pkgWorkspace.SaveProject(proj); err != nil {\n\t\t\treturn fmt.Errorf(\"saving project: %w\", err)\n\t\t}\n\n\t\t// Create the stack, if needed.\n\t\tif s == nil {\n\t\t\tif s, err = newcmd.PromptAndCreateStack(ctx, cmdutil.Diag(), ws, b, ui.PromptForValue, stackName, root,\n\t\t\t\tfalse /*setCurrent*/, yes, opts.Display, secretsProvider, false /*useRemoteConfig*/, configFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// cmdStack.CreateStack prints \"Created stack '<stack>'\" on success.\n\t\t}\n\n\t\t// Prompt for config values (if needed) and save.\n\t\tif err = newcmd.HandleConfig(\n\t\t\tctx,\n\t\t\tcmdutil.Diag(),\n\t\t\tssml,\n\t\t\tws,\n\t\t\tui.PromptForValue,","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/operations/up.go#L409-L445","documentation":"After populating a project (name, description, clearing the template field) from a template instantiation, the CLI persists Pulumi.yaml via pkgWorkspace.SaveProject. If serialization or the file write fails, the error is wrapped as 'saving project'. The update cannot proceed without a valid project file in the workspace.","triggerScenarios":"pkgWorkspace.SaveProject(proj) returns an error: unwritable Pulumi.yaml (permissions, read-only checkout), YAML marshal failure from invalid characters in name/description, or disk full.","commonSituations":"Running pulumi up inside a read-only mounted repo; template description containing characters that break serialization; file locked by an editor/sync client (Dropbox/OneDrive); disk quota exceeded.","solutions":["Check write permissions on Pulumi.yaml and its directory; make the checkout writable.","Ensure the disk is not full and the user has quota remaining.","Remove invalid characters from the project name/description derived from the template.","Close editors/sync tools holding a lock on Pulumi.yaml and retry.","Delete a corrupt Pulumi.yaml and regenerate it from the template."],"exampleFix":"// before\nproj.Name = tokens.PackageName(name)\nproj.Description = &description\n// after (sanitize values before saving)\nproj.Name = tokens.PackageName(name)\ncleanDesc := strings.Map(func(r rune) rune {\n\tif r == 0 || r == '\\n' || r == '\\r' { return -1 }\n\treturn r\n}, description)\nproj.Description = &cleanDesc\nif err = pkgWorkspace.SaveProject(proj); err != nil {\n\treturn fmt.Errorf(\"saving project: %w\", err)\n}","handlingStrategy":"validation","validationCode":"info, err := os.Stat(\"Pulumi.yaml\"); if err == nil && info.Mode().Perm()&0200 == 0 { return errors.New(\"Pulumi.yaml not writable\") }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"saving project\") { // check writability then retry\n\treturn fmt.Errorf(\"check Pulumi.yaml permissions/disk space: %w\", err) }","preventionTips":["Never run pulumi up from a read-only checkout; copy the project first.","Exclude project dirs from file-sync clients (Dropbox/OneDrive) that lock files.","Sanitize template-derived name/description before rendering.","Monitor disk space/quota on CI runners."],"tags":["cli","filesystem","project-file"],"backgroundTag":"file-write-permission-denied","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}