passbolt/passbolt_api · error · CakeException

The data entered are not correct

Error message

The data entered are not correct

What it means

DatabaseController::validateData executes DatabaseConfigurationForm against the posted settings and throws CakeException 'The data entered are not correct' when the form fails validation. Unlike the connection test (reachability), this fires before any DB attempt because the submitted values do not satisfy the form's field rules. Detailed errors are attached to the form exposed as formExecuteResult.

Solutions

  1. Inspect formExecuteResult / the re-rendered form for the exact failing field and rule.
  2. Ensure all required fields are present: driver (mysql/mariadb/postgres...), host, port, username, database, and password if required.
  3. Check the chosen driver's PDO extension is installed (php -m | grep pdo) and supported by the form.
  4. Resubmit via the installer UI so the form revalidates with corrected values.

Example fix

// before
{'driver': 'oracle', 'host': '', 'port': 'abc'}
// after
{'driver': 'mysql', 'host': 'db', 'port': '3306', 'username': 'passbolt', 'password': '****', 'database': 'passbolt'}
Defensive patterns

Strategy: validation

Validate before calling

const required = ['driver', 'host', 'port', 'username', 'database'];
for (const k of required) {
  if (!dbConfig[k] || !String(dbConfig[k]).trim()) throw new Error(k + ' is required');
}
if (!['mysql', 'mariadb', 'postgres'].includes(dbConfig.driver)) throw new Error('unsupported driver');
if (!/^[0-9]+$/.test(String(dbConfig.port))) throw new Error('port must be numeric');

Type guard

function isValidDatabaseForm(d) {
  return d && typeof d === 'object' &&
    ['mysql','mariadb','postgres'].includes(d.driver) &&
    typeof d.host === 'string' && d.host &&
    /^\d+$/.test(String(d.port));
}

Try / catch

try {
  await post('/install/database', dbConfig);
} catch (e) {
  if (String(e.message).includes('The data entered are not correct')) {
    // read formExecuteResult field errors from the re-rendered step, fix, resubmit
  }
  throw e;
}

Prevention

When it happens

Trigger: POSTing the WebInstaller database step with missing or invalid fields: absent driver/host/username/database, an unsupported driver name, non-numeric port, or empty required values — DatabaseConfigurationForm::execute() returns false.

Common situations: Empty installer form submission; driver whose PDO extension is missing (e.g. pdo_pgsql not installed); typo'd field names when scripting; port with stray characters.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at plugins/PassboltCe/WebInstaller/src/Controller/DatabaseController.php:201

            $msg = __('A connection could not be established with the credentials provided.') . ' ';
            $msg .= __('Please verify the settings.');
            throw new CakeException($msg);
        }
    }

    /**
     * Validate data.
     *
     * @param array $data request data
     * @throws \Cake\Core\Exception\CakeException The data does not validate
     * @return array
     */
    protected function validateData(array $data): array
    {
        $form = new DatabaseConfigurationForm();
        $this->set('formExecuteResult', $form);
        if (!$form->execute($data)) {
            throw new CakeException(__('The data entered are not correct'));
        }
        /** @var array $data */
        $data = $form->getData();

        return $data;
    }
}

View on GitHub (pinned to 31c1bbc10f)