{"record":{"id":"bc74684e6e639c24","repo":"passbolt/passbolt_api","slug":"warning-warn-s-warning","errorCode":null,"errorMessage":" <warning>[WARN] %s</warning>","messagePattern":" <warning>\\[WARN\\] (.+?)</warning>","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/Command/HealthcheckCommand.php","lineNumber":389,"sourceCode":"     * @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);\n        }\n    }\n\n    /**","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Command/HealthcheckCommand.php#L371-L407","documentation":"This is the printf-style format template for a WARN result line in HealthcheckCommand::display(): ' <warning>[WARN] %s</warning>'. WARN is used for checks that failed but are not blocking (e.g. recommended-but-optional settings like self-registration or CSP headers). Like the FAIL branch, output goes to stderr when POSIX mode is enabled, otherwise stdout.","triggerScenarios":"Running bin/cake passbolt healthcheck when a check reports status 'warn' via warning()/assert() — typically optional or informational checks such as self-registration plugin state, Canary URL, or non-critical security headers.","commonSituations":"Hardening reviews where optional settings are not configured; admins often see WARN lines alongside PASS/FAIL lines and need to decide which are worth acting on; CI may treat warnings as non-blocking.","solutions":["Read the substituted message on the WARN line to identify the non-critical check.","Address it if relevant to your security posture (e.g. enable/disable self registration as intended).","If the warning is intentional, document it and exclude it from CI gating.","Use targeted healthcheck flags (e.g. --self-test-only) to narrow which checks run."],"exampleFix":"// before\n [WARN] Self-registration plugin is enabled\n\n// after (if intentional, keep; otherwise)\n$ bin/cake passbolt disable_self_registration 2>/dev/null || vendor/bin/cake passbolt healthcheck\n [PASS] Self-registration plugin is disabled","handlingStrategy":"validation","validationCode":"OUT=$(vendor/bin/cake passbolt healthcheck 2>&1) || true\necho \"$OUT\" | grep -q '\\[WARN\\]' && echo \"Review warnings: $(echo \"$OUT\" | grep '\\[WARN\\]')\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Review WARN lines during hardening reviews and consciously accept or fix each one.","Document intentionally accepted warnings so teammates do not chase them.","Track healthcheck output over time so new WARN badges are noticed in diffs.","Do not gate deploys on WARN, but do gate on new warnings versus baseline."],"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"}