{"record":{"id":"032533316bd191b4","repo":"juicedata/juicefs","slug":"failed-to-create-out-directory-v","errorCode":null,"errorMessage":"failed to create out directory: %v","messagePattern":"failed to create out directory: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/debug.go","lineNumber":384,"sourceCode":"\ttrace := ctx.Uint64(\"trace-sec\")\n\tprofile := ctx.Uint64(\"profile-sec\")\n\tmetrics := map[string]metricItem{\n\t\t\"allocs\":       {name: \"allocs.pb.gz\", url: baseUrl + \"allocs\"},\n\t\t\"blocks\":       {name: \"block.pb.gz\", url: baseUrl + \"block\"},\n\t\t\"cmdline\":      {name: \"cmdline.txt\", url: baseUrl + \"cmdline\"},\n\t\t\"goroutine\":    {name: \"goroutine.pb.gz\", url: baseUrl + \"goroutine\"},\n\t\t\"stack\":        {name: \"goroutine.stack.txt\", url: baseUrl + \"goroutine?debug=1\"},\n\t\t\"stack-detail\": {name: \"goroutine.stack.detail.txt\", url: baseUrl + \"goroutine?debug=2\"},\n\t\t\"heap\":         {name: \"heap.pb.gz\", url: baseUrl + \"heap\"},\n\t\t\"mutex\":        {name: \"mutex.pb.gz\", url: baseUrl + \"mutex\"},\n\t\t\"threadcreate\": {name: \"threadcreate.pb.gz\", url: baseUrl + \"threadcreate\"},\n\t\t\"trace\":        {name: fmt.Sprintf(\"trace.%ds.pb.gz\", trace), url: fmt.Sprintf(\"%strace?seconds=%d\", baseUrl, trace)},\n\t\t\"profile\":      {name: fmt.Sprintf(\"profile.%ds.pb.gz\", profile), url: fmt.Sprintf(\"%sprofile?seconds=%d\", baseUrl, profile)},\n\t}\n\n\tpprofOutDir := filepath.Join(currDir, \"pprof\")\n\tif err := os.Mkdir(pprofOutDir, os.ModePerm); err != nil {\n\t\treturn fmt.Errorf(\"failed to create out directory: %v\", err)\n\t}\n\n\tfor name, metric := range metrics {\n\t\twg.Add(1)\n\t\tgo func(name string, metric metricItem) {\n\t\t\ttimeout := 3 * time.Second\n\t\t\tdefer wg.Done()\n\t\t\tif name == \"profile\" {\n\t\t\t\tlogger.Infof(\"Profile metrics are being sampled, sampling duration: %ds\", profile)\n\t\t\t\ttimeout = time.Duration(profile+5) * time.Second\n\t\t\t}\n\t\t\tif name == \"trace\" {\n\t\t\t\tlogger.Infof(\"Trace metrics are being sampled, sampling duration: %ds\", trace)\n\t\t\t\ttimeout = time.Duration(trace+5) * time.Second\n\t\t\t}\n\t\t\tif err := reqAndSaveMetric(name, metric, pprofOutDir, timeout); err != nil {\n\t\t\t\tlogger.Errorf(\"Failed to get and save metric %s: %v\", name, err)\n\t\t\t}","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/debug.go#L366-L402","documentation":"Returned by collectPprof when the output directory for pprof data (under the juicefs debug collection dir) cannot be created. It wraps the mkdir error, usually permissions or a path conflict on the local filesystem.","triggerScenarios":"Thrown at cmd/debug.go:384 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a writable --out-dir for `juicefs debug` and check permissions"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}