{"record":{"id":"4eb1cc4c38974ac1","repo":"hasura/graphql-engine","slug":"error-creating-setup-directories-w","errorCode":null,"errorMessage":"error creating setup directories: %w","messagePattern":"error creating setup directories: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/init.go","lineNumber":243,"sourceCode":"\n// create the execution directory.\nfunc (o *InitOptions) createExecutionDirectory() error {\n\tvar op errors.Op = \"commands.InitOptions.createExecutionDirectory\"\n\n\tif o.EC.ExecutionDirectory == \"\" {\n\t\to.EC.ExecutionDirectory = o.InitDir\n\t} else {\n\t\to.EC.ExecutionDirectory = filepath.Join(o.EC.ExecutionDirectory, o.InitDir)\n\t}\n\n\t// create the execution directory\n\tif _, err := os.Stat(o.EC.ExecutionDirectory); err == nil {\n\t\treturn errors.E(op, fmt.Errorf(\"directory '%s' already exists\", o.EC.ExecutionDirectory))\n\t}\n\n\terr := os.MkdirAll(o.EC.ExecutionDirectory, os.ModePerm)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error creating setup directories: %w\", err))\n\t}\n\n\treturn nil\n}\n\n// createFiles creates files required by the CLI in the ExecutionDirectory.\nfunc (o *InitOptions) createFiles() error {\n\tvar op errors.Op = \"commands.InitOptions.createFiles\"\n\t// create the directory\n\terr := os.MkdirAll(filepath.Dir(o.EC.ExecutionDirectory), os.ModePerm)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error creating setup directories: %w\", err))\n\t}\n\t// set config object\n\tconfig := &cli.Config{\n\t\tVersion: o.Version,\n\t\tServerConfig: cli.ServerConfig{\n\t\t\tEndpoint: defaultEndpoint,","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/init.go#L225-L261","documentation":"os.MkdirAll failed while createExecutionDirectory was creating the execution directory for a new `hasura init` project. Wrapped OS error indicates why creation failed.","triggerScenarios":"Init target parent is read-only, a path component is a file, or permissions deny directory creation at o.EC.ExecutionDirectory.","commonSituations":"Init into a root-owned or read-only path; nested name like a/b where 'a' is a regular file; disk full or quota exceeded.","solutions":["Verify write permission on the parent directory and target path","Remove any regular file occupying a needed path component","Init into a writable location (project dir under $HOME or a mounted volume)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if err := checkWritableParent(executionDir); err != nil { log.Fatal(err) }\n\nfunc checkWritableParent(p string) error {\n    parent := filepath.Dir(p)\n    if err := os.MkdirAll(parent, 0o755); err != nil { return err }\n    return syscall.Access(parent, unix.W_OK)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-create and verify writability of the init path","Avoid regular files where directories are expected"],"tags":["hasura","cli","init","mkdir","filesystem"],"backgroundTag":"directory-create-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}