{"record":{"id":"a4debd5eaf439163","repo":"goreleaser/goreleaser","slug":"failed-to-write-s-w-a4debd","errorCode":null,"errorMessage":"failed to write %s: %w","messagePattern":"failed to write (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pipe/aursources/aursources.go","lineNumber":160,"sourceCode":"\t\t\ttpl:  aurTemplateData,\n\t\t\text:  \".pkgbuild\",\n\t\t\tkind: artifact.SourcePkgBuild,\n\t\t},\n\t\t{\n\t\t\tname: \".SRCINFO\",\n\t\t\ttpl:  srcInfoTemplate,\n\t\t\text:  \".srcinfo\",\n\t\t\tkind: artifact.SourceSrcInfo,\n\t\t},\n\t} {\n\t\tpkgContent, err := buildPkgFile(ctx, aur, cl, archives, info.tpl)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpath := filepath.Join(ctx.Config.Dist, \"aur\", aur.Name+info.ext)\n\t\tif err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to write %s: %w\", info.kind, err)\n\t\t}\n\t\tlog.WithField(\"file\", path).Info(\"writing\")\n\t\tif err := os.WriteFile(path, []byte(pkgContent), 0o644); err != nil { //nolint:gosec\n\t\t\treturn fmt.Errorf(\"failed to write %s: %w\", info.kind, err)\n\t\t}\n\n\t\tctx.Artifacts.Add(&artifact.Artifact{\n\t\t\tName: info.name,\n\t\t\tPath: path,\n\t\t\tType: info.kind,\n\t\t\tExtra: map[string]any{\n\t\t\t\taurExtra:         aur,\n\t\t\t\tartifact.ExtraID: aur.Name,\n\t\t\t},\n\t\t})\n\t}\n\n\treturn nil","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/goreleaser/goreleaser/blob/f5edd7395693c0c6b501dc722d445d2e86af854d/internal/pipe/aursources/aursources.go#L142-L178","documentation":"This error is returned by the aur_sources pipe's doRun when it cannot create the dist/aur output directory for an AUR source package file. It wraps the underlying os.MkdirAll error with the kind of file being written (e.g. PKGSRC/other info.kind), so you always see which artifact stage failed.","triggerScenarios":"os.MkdirAll(filepath.Join(ctx.Config.Dist, \"aur\")) fails: dist path points to a read-only location, a non-directory file named 'aur' exists in dist, the disk is full, or a permission error occurs on the dist directory.","commonSituations":"Running goreleaser with a --dist flag or dist: config pointing somewhere the CI user cannot write; a corrupted dist directory where a file named 'aur' exists; Docker containers with read-only mounts.","solutions":["Fix permissions on the dist directory (chown/chmod) so the goreleaser user can create directories","Remove or rename any file named 'aur' inside dist, or run goreleaser with a clean dist (rm -rf dist)","Set a writable dist path in .goreleaser.yaml (dist: /tmp/dist) or via --dist flag","Check disk space (df -h) and free up space"],"exampleFix":"// before\ndist: ./output/aur   # read-only in CI\n// after\ndist: ./dist         # writable by the running user","handlingStrategy":"validation","validationCode":"dist := \"dist\" // ctx.Config.Dist\naurDir := filepath.Join(dist, \"aur\")\nif fi, err := os.Stat(aurDir); err == nil && !fi.IsDir() {\n\treturn fmt.Errorf(\"%s exists and is not a directory\", aurDir)\n}\nif err := os.MkdirAll(aurDir, 0o755); err != nil {\n\treturn err\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run with a clean dist directory each release (rm -rf dist or --clean)","Ensure the CI user owns the dist path","Never point dist at a read-only mount","Monitor disk space on CI runners"],"tags":["go","goreleaser","filesystem","aur"],"backgroundTag":"filesystem-write-permission-denied","analyzedSha":"f5edd7395693c0c6b501dc722d445d2e86af854d","analyzedAt":"2026-09-05T09:57:18.807Z","contentChangedAt":"2026-09-05T09:57:18.807Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}