passbolt/passbolt_api · warning

[WARN] </warning>

Error message

 <warning>[WARN] %s</warning>

What it means

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.

Solutions

  1. Read the substituted message on the WARN line to identify the non-critical check.
  2. Address it if relevant to your security posture (e.g. enable/disable self registration as intended).
  3. If the warning is intentional, document it and exclude it from CI gating.
  4. Use targeted healthcheck flags (e.g. --self-test-only) to narrow which checks run.

Example fix

// before
 [WARN] Self-registration plugin is enabled

// after (if intentional, keep; otherwise)
$ bin/cake passbolt disable_self_registration 2>/dev/null || vendor/bin/cake passbolt healthcheck
 [PASS] Self-registration plugin is disabled
Defensive patterns

Strategy: validation

Validate before calling

OUT=$(vendor/bin/cake passbolt healthcheck 2>&1) || true
echo "$OUT" | grep -q '\[WARN\]' && echo "Review warnings: $(echo "$OUT" | grep '\[WARN\]')"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/bc74684e6e639c24. Report an issue: GitHub.

Appendix: source

Thrown at src/Command/HealthcheckCommand.php:389

     * @return void
     */
    protected function display(string|array $msg, string $case): void
    {
        switch ($case) {
            case 'pass':
                if ($this->_displayOptions['hide-pass']) {
                    return;
                }
                $msg = ' <success>[' . __('PASS') . ']</success> ' . $msg;
                $this->io->out($msg);
                break;
            case 'fail':
                $msg = ' <error>[' . __('FAIL') . '] ' . $msg . '</error>';
                $this->posixModeIsEnabled ? $this->io->err($msg) : $this->io->out($msg);
                break;
            case 'warn':
                $msg = ' <warning>[' . __('WARN') . '] ' . $msg . '</warning>';
                $this->posixModeIsEnabled ? $this->io->err($msg) : $this->io->out($msg);
                break;
            case 'info':
                if ($this->_displayOptions['hide-help']) {
                    return;
                }
                $msg = ' <info>[' . __('HELP') . ']</info> ' . $msg;
                $this->io->out($msg);
                break;
            case 'notice':
                $msg = ' <info>[' . __('INFO') . ']</info> ' . $msg;
                $this->io->out($msg);
                break;
            default:
                throw new Exception('Task output case not defined: ' . $case . ' ' . $msg);
        }
    }

    /**

View on GitHub (pinned to 31c1bbc10f)