{"record":{"id":"c01556cf10d15e85","repo":"phacility/phabricator","slug":"configuration-file-s-exists-but-could-not-be-r","errorCode":null,"errorMessage":"Configuration file \"%s\" exists, but could not be read.","messagePattern":"Configuration file \"(.+?)\" exists, but could not be read\\.","errorType":"exception","errorClass":"PhutilProxyException","httpStatus":null,"severity":"critical","filePath":"src/infrastructure/env/PhabricatorConfigLocalSource.php","lineNumber":32,"sourceCode":"  }\n\n  public function deleteKeys(array $keys) {\n    $result = parent::deleteKeys($keys);\n    $this->saveConfig();\n    return parent::deleteKeys($keys);\n  }\n\n  private function loadConfig() {\n    $path = $this->getConfigPath();\n\n    if (!Filesystem::pathExists($path)) {\n      return array();\n    }\n\n    try {\n      $data = Filesystem::readFile($path);\n    } catch (FilesystemException $ex) {\n      throw new PhutilProxyException(\n        pht(\n          'Configuration file \"%s\" exists, but could not be read.',\n          $path),\n        $ex);\n    }\n\n    try {\n      $result = phutil_json_decode($data);\n    } catch (PhutilJSONParserException $ex) {\n      throw new PhutilProxyException(\n        pht(\n          'Configuration file \"%s\" exists and is readable, but the content '.\n          'is not valid JSON. You may have edited this file manually and '.\n          'introduced a syntax error by mistake. Correct the file syntax '.\n          'to continue.',\n          $path),\n        $ex);\n    }","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/env/PhabricatorConfigLocalSource.php#L14-L50","documentation":"PhabricatorConfigLocalSource loads conf/local/local.json, the instance-local configuration override file. If the path exists but Filesystem::readFile() throws (unreadable permissions, removed mid-read, path is a directory, safe-mode restriction), the FilesystemException is wrapped in PhutilProxyException with this message and every config read that needs the local source fails. This is a boot-level failure: the local source participates in config stack construction, so the web UI and CLI both break until it is fixed.","triggerScenarios":"chmod/chown that removes read permission from conf/local/local.json (root-owned after running daemons as root, then serving as www-data); the file being replaced by a directory; a container image that copied the file with mode 600 for another UID; disk/FS errors surfaced as FilesystemException.","commonSituations":"After automation or restoring backups as root, file ownership becomes root:root and the PHP-FPM user cannot read it; hardening playbooks that recursively tighten permissions under conf/; Docker/Kubernetes volume mounts overriding file modes.","solutions":["Fix read permission and ownership for the web/daemon user: chmod 644 conf/local/local.json (or 640 with matching group) and chown it to the account running PHP.","Confirm the path is a regular file: ls -la conf/local/local.json; if it was replaced by a directory or symlink loop, restore a real file.","Verify by running `./bin/config get` as the web user; it should now parse the JSON (a follow-up PhabricatorConfigLocalSource error will appear if syntax is broken)."],"exampleFix":"# before: unreadable by the web user\n$ ls -l conf/local/local.json\n-rw------- 1 root root 532 local.json\n\n# after\n$ sudo chown www-data:www-data conf/local/local.json\n$ sudo chmod 640 conf/local/local.json","handlingStrategy":"validation","validationCode":"$path = 'conf/local/local.json';\nif (file_exists($path) && !is_readable($path)) {\n  throw new Exception(\"Fix permissions before continuing: $path\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision conf/local/local.json with explicit mode 640 and the web user's ownership in your config management.","Never run ./bin/config as root without fixing ownership afterwards.","Smoke-test after permission playbooks: sudo -u www-data ./bin/config get must succeed."],"tags":["phabricator","config","filesystem","permissions","local-json","boot"],"backgroundTag":"config-file-unreadable","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}