{"record":{"id":"3b15308726558025","repo":"passbolt/passbolt_api","slug":"error-fail-s-error","errorCode":null,"errorMessage":" <error>[FAIL] %s</error>","messagePattern":" <error>\\[FAIL\\] (.+?)</error>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/Command/HealthcheckCommand.php","lineNumber":385,"sourceCode":"     * Display a message for given case\n     *\n     * @param array<string>|string $msg message\n     * @param string $case pass or fail\n     * @return void\n     */\n    protected function display(string|array $msg, string $case): void\n    {\n        switch ($case) {\n            case 'pass':\n                if ($this->_displayOptions['hide-pass']) {\n                    return;\n                }\n                $msg = ' <success>[' . __('PASS') . ']</success> ' . $msg;\n                $this->io->out($msg);\n                break;\n            case 'fail':\n                $msg = ' <error>[' . __('FAIL') . '] ' . $msg . '</error>';\n                $this->posixModeIsEnabled ? $this->io->err($msg) : $this->io->out($msg);\n                break;\n            case 'warn':\n                $msg = ' <warning>[' . __('WARN') . '] ' . $msg . '</warning>';\n                $this->posixModeIsEnabled ? $this->io->err($msg) : $this->io->out($msg);\n                break;\n            case 'info':\n                if ($this->_displayOptions['hide-help']) {\n                    return;\n                }\n                $msg = ' <info>[' . __('HELP') . ']</info> ' . $msg;\n                $this->io->out($msg);\n                break;\n            case 'notice':\n                $msg = ' <info>[' . __('INFO') . ']</info> ' . $msg;\n                $this->io->out($msg);\n                break;\n            default:\n                throw new Exception('Task output case not defined: ' . $case . ' ' . $msg);","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Command/HealthcheckCommand.php#L367-L403","documentation":"This is the printf-style format template for a FAIL result line in HealthcheckCommand::display(): ' <error>[FAIL] %s</error>'. The command formats each check's message with the [FAIL] badge wrapped in CakePHP <error> output tags; when POSIX mode is enabled the line goes to stderr via io->err(), otherwise to stdout via io->out(). It signals that one or more healthcheck assertions failed (e.g. database connectivity, GPG configuration, SSL settings).","triggerScenarios":"Running the healthcheck command (bin/cake passbolt healthcheck) when any check calls back into display() with status 'fail' — e.g. a failed database connection check, missing self-registration config, invalid GPG key, or SSL mismatch.","commonSituations":"Server hardening/upgrade verification: admins run the healthcheck after migration or config changes; a FAIL here often points to an invalid app.config.php value, unreachable DB, or file-permission problems; CI pipelines parsing the [FAIL] badge to gate deploys.","solutions":["Read the message substituted for %s on the FAIL line — it names the specific failed check.","Fix the underlying configuration or environment issue that check describes (DB credentials, GPG keys, SSL, file permissions).","Re-run the healthcheck with relevant flags (e.g. --db-only, --gpg-only) to isolate and confirm the fix.","If the failure is expected in your environment, use the command's ignore/jira options or treat WARN/FAIL output as non-fatal in CI."],"exampleFix":"// before\n$ bin/cake passbolt healthcheck\n [FAIL] No GPG key found for the server\n\n// after (generate + configure key)\n$ bin/cake passbolt create_gpg_server_key\n$ bin/cake passbolt healthcheck\n [PASS] GPG key is set for the server","handlingStrategy":"validation","validationCode":"#!/bin/sh\nOUT=$(vendor/bin/cake passbolt healthcheck 2>&1) || true\necho \"$OUT\" | grep -q '\\[FAIL\\]' && { echo \"Healthcheck FAIL: $OUT\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the healthcheck in CI and fail the pipeline on any [FAIL] badge.","After every config or DB change, re-run bin/cake passbolt healthcheck to catch regressions early.","Keep app config, GPG keys, and SSL certificates validated against the documented requirements.","Use targeted flags (--db-only, --gpg-only, etc.) to isolate failing subsystems quickly."],"tags":["cli","healthcheck","configuration","diagnostics"],"backgroundTag":"healthcheck-failed","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}