{"record":{"id":"a03665aa88210eac","repo":"hashicorp/terraform","slug":"error-checking-configuration-s","errorCode":null,"errorMessage":"Error checking configuration: %s","messagePattern":"Error checking configuration: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/init_run.go","lineNumber":108,"sourceCode":"\n\t\tinitDirFromModuleAbort, initDirFromModuleDiags := c.initDirFromModule(ctx, path, src, hooks)\n\t\tdiags = diags.Append(initDirFromModuleDiags)\n\t\tif initDirFromModuleAbort || initDirFromModuleDiags.HasErrors() {\n\t\t\tview.Diagnostics(diags)\n\t\t\tspan.SetStatus(codes.Error, \"module installation failed\")\n\t\t\tspan.End()\n\t\t\treturn 1\n\t\t}\n\t\tspan.End()\n\n\t\tview.Spacer()\n\t}\n\n\t// If our directory is empty, then we're done. We can't get or set up\n\t// the backend with an empty directory.\n\tempty, err := configs.IsEmptyDir(path, initArgs.TestsDirectory)\n\tif err != nil {\n\t\tdiags = diags.Append(fmt.Errorf(\"Error checking configuration: %s\", err))\n\t\tview.Diagnostics(diags)\n\t\treturn 1\n\t}\n\tif empty {\n\t\tview.Output(views.OutputInitEmptyMessage)\n\t\treturn 0\n\t}\n\n\t// Load just the root module to begin backend and module initialization\n\trootModEarly, earlyConfDiags := c.loadSingleModuleWithTests(path, initArgs.TestsDirectory)\n\n\t// There may be parsing errors in config loading but these will be shown later _after_\n\t// checking for core version requirement errors. Not meeting the version requirement should\n\t// be the first error displayed if that is an issue, but other operations are required\n\t// before being able to check core version requirements.\n\tif rootModEarly == nil {\n\t\tdiags = diags.Append(errors.New(errInitConfigError), earlyConfDiags)\n\t\tview.Diagnostics(diags)","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/init_run.go#L90-L126","documentation":"Thrown after module copy when configs.IsEmptyDir(path, TestsDirectory) errors while checking whether the working directory contains configuration. This check decides whether to proceed with backend/module init or treat the dir as empty.","triggerScenarios":"Init's IsEmptyDir traversal fails due to permission denied on a subdirectory, I/O errors, or a broken symlink inside the working directory (including the tests directory).","commonSituations":"A submodule or test directory with restrictive permissions; stale symlink; NFS hiccup; .terraform dir corrupted.","solutions":["Inspect the working directory for unreadable subdirs: `find . -type d ! -readable`.","Fix permissions on the offending directories (`chmod a+rx`).","Remove broken symlinks and retry init."],"exampleFix":"$ find . -type d ! -readable -exec chmod a+rx {} \\; && terraform init","handlingStrategy":"validation","validationCode":"// Find unreadable directories before init.\nfunc, _ := filepath.WalkDir(\".\", func(p string, d fs.DirEntry, err error) error {\n    if err == nil && d.IsDir() {\n        f, e := os.Open(p)\n        if e != nil { log.Printf(\"unreadable: %s\", p) } else { f.Close() }\n    }\n    return nil\n})","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit directory permissions in the working tree before init.","Remove stale symlinks in the module path.","Ensure the tests directory is readable."],"tags":["terraform-init","filesystem","validation","permissions"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}