{"record":{"id":"a8886b62d9083b26","repo":"serverless/serverless","slug":"creating-directory-s-w","errorCode":null,"errorMessage":"creating directory %s: %w","messagePattern":"creating directory (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"binary-installer/src/version.go","lineNumber":440,"sourceCode":"\t\t\theader, err := tarReader.Next()\n\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"reading archive entry: %w\", err)\n\t\t\t}\n\n\t\t\tswitch header.Typeflag {\n\t\t\tcase tar.TypeDir:\n\t\t\t\tcleanPath := filepath.Clean(header.Name)\n\t\t\t\tpath := filepath.Join(releasePath, cleanPath)\n\t\t\t\tif !strings.HasPrefix(path, filepath.Clean(releasePath)+string(os.PathSeparator)) {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"invalid file path\")\n\t\t\t\t}\n\t\t\t\tif err := os.MkdirAll(path, 0755); err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"creating directory %s: %w\", path, err)\n\t\t\t\t}\n\t\t\t\tdirPaths[path] = true\n\t\t\tcase tar.TypeReg:\n\t\t\t\tcleanPath := filepath.Clean(header.Name)\n\t\t\t\tpath := filepath.Join(releasePath, cleanPath)\n\t\t\t\tif !strings.HasPrefix(path, filepath.Clean(releasePath)+string(os.PathSeparator)) {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"invalid file path\")\n\t\t\t\t}\n\t\t\t\tdirPath := filepath.Dir(path)\n\t\t\t\tif !dirPaths[dirPath] {\n\t\t\t\t\tif err := os.MkdirAll(dirPath, os.ModePerm); err != nil {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"creating directory %s: %w\", dirPath, err)\n\t\t\t\t\t}\n\t\t\t\t\tdirPaths[dirPath] = true\n\t\t\t\t}\n\t\t\t\toutFile, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.FileMode(header.Mode))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"opening file %s: %w\", path, err)","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/serverless/serverless/blob/b9d7ea51c8cce57cff1207964b9b71123673081f/binary-installer/src/version.go#L422-L458","documentation":"Error \"creating directory %s: %w\" thrown in serverless/serverless.","triggerScenarios":"Thrown at binary-installer/src/version.go:440 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the parent directory exists and your user has write permission to create the directory under ~/.serverless.","Free disk space if the filesystem is full."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b9d7ea51c8cce57cff1207964b9b71123673081f","analyzedAt":"2026-08-13T04:14:40.386Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}