{"record":{"id":"c190003b9f3b25c9","repo":"flarum/framework","slug":"configuration-file-does-not-exist","errorCode":null,"errorMessage":"Configuration file does not exist.","messagePattern":"Configuration file does not exist\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/core/src/Install/Console/FileDataProvider.php","lineNumber":56,"sourceCode":"            // Try parsing JSON\n            if (($json = json_decode($configurationFileContents, true)) !== null) {\n                //Use JSON if Valid\n                $configuration = $json;\n            } else {\n                //Else use YAML\n                $configuration = Yaml::parse($configurationFileContents);\n            }\n\n            // Define configuration variables\n            $this->debug = (bool) ($configuration['debug'] ?? false);\n            $this->baseUrl = (string) ($configuration['baseUrl'] ?? 'http://flarum.localhost');\n            $this->databaseConfiguration = (array) ($configuration['databaseConfiguration'] ?? []);\n            $this->adminUser = (array) ($configuration['adminUser'] ?? []);\n            $this->settings = (array) ($configuration['settings'] ?? []);\n            $this->extensions = isset($configuration['extensions']) ? explode(',', (string) $configuration['extensions']) : null;\n            $this->queue = (array) ($configuration['queue'] ?? ['driver' => 'sync']);\n        } else {\n            throw new Exception('Configuration file does not exist.');\n        }\n    }\n\n    public function configure(Installation $installation): Installation\n    {\n        return $installation\n            ->debugMode($this->debug)\n            ->baseUrl(BaseUrl::fromString($this->baseUrl))\n            ->databaseConfig($this->getDatabaseConfiguration())\n            ->adminUser($this->getAdminUser())\n            ->settings($this->settings)\n            ->extensions($this->extensions)\n            ->queueConfig($this->queue);\n    }\n\n    private function getDatabaseConfiguration(): DatabaseConfig\n    {\n        return new DatabaseConfig(","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Install/Console/FileDataProvider.php#L38-L74","documentation":"FileDataProvider loads installation answers from a configuration file. When the file is missing (or its data is falsy so the else branch is taken), its constructor throws Exception('Configuration file does not exist.'), aborting the unattended/headless install.","triggerScenarios":"Running the install command with a path to a non-existent or unreadable configuration file; relative path resolved from the wrong working directory; file deleted between check and load.","commonSituations":"CI pipelines referencing an answers file that was never generated; wrong path passed to --file-style install; permissions preventing read so the file appears absent.","solutions":["Verify the config file exists at the exact path passed to the installer (use an absolute path)","Check file read permissions for the user running the installer","Generate the configuration file first (e.g. by completing an interactive install) before running the headless install","Wrap construction in try-catch and surface a clear message with the resolved path"],"exampleFix":"// before\n$provider = new FileDataProvider('answers.json');\n// after\n$path = __DIR__.'/answers.json';\nif (! is_file($path)) { throw new Exception(\"Config file missing: $path\"); }\n$provider = new FileDataProvider($path);","handlingStrategy":"try-catch","validationCode":"$path = '/absolute/path/to/answers.json';\nif (! is_file($path) || ! is_readable($path)) {\n    throw new Exception(\"Installation config not found or unreadable: $path\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    $provider = new FileDataProvider($path);\n} catch (Exception $e) {\n    $output->writeln(\"<error>{$e->getMessage()} Check: $path</error>\");\n    return Command::FAILURE;\n}","preventionTips":["Pass absolute paths to the installer config file","Generate the answers file (interactive install) before headless runs","Check file permissions for the user running CI/install","Add a pre-flight is_file() assertion in deploy scripts"],"tags":["installation","file","configuration","headless-install"],"backgroundTag":"config-file-not-found","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}