passbolt/passbolt_api · error

[FAIL] </error>

Error message

 <error>[FAIL] %s</error>

What it means

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).

Solutions

  1. Read the message substituted for %s on the FAIL line — it names the specific failed check.
  2. Fix the underlying configuration or environment issue that check describes (DB credentials, GPG keys, SSL, file permissions).
  3. Re-run the healthcheck with relevant flags (e.g. --db-only, --gpg-only) to isolate and confirm the fix.
  4. 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.

Example fix

// before
$ bin/cake passbolt healthcheck
 [FAIL] No GPG key found for the server

// after (generate + configure key)
$ bin/cake passbolt create_gpg_server_key
$ bin/cake passbolt healthcheck
 [PASS] GPG key is set for the server
Defensive patterns

Strategy: validation

Validate before calling

#!/bin/sh
OUT=$(vendor/bin/cake passbolt healthcheck 2>&1) || true
echo "$OUT" | grep -q '\[FAIL\]' && { echo "Healthcheck FAIL: $OUT" >&2; exit 1; }

Prevention

When it happens

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

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

Related errors


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

Appendix: source

Thrown at src/Command/HealthcheckCommand.php:385

     * Display a message for given case
     *
     * @param array<string>|string $msg message
     * @param string $case pass or fail
     * @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)