passbolt/passbolt_api · error · CakeException

The data entered are not correct

Error message

The data entered are not correct

What it means

OptionController::getAndValidateData executes OptionsConfigurationForm on the posted WebInstaller options (notably full_base_url and other option toggles) and throws CakeException 'The data entered are not correct' when execute() returns false. The full_base_url is trimmed of trailing slashes first; remaining invalid values cause the generic validation exception, with field details only available via formExecuteResult.

Solutions

  1. Inspect formExecuteResult / the re-rendered form for the failing field and rule.
  2. Set full_base_url to a full absolute URL including scheme, e.g. https://passbolt.example.com.
  3. Remove trailing slashes and stray whitespace from the URL before submitting.
  4. Check other posted option fields against OptionsConfigurationForm rules and fix any invalid values.

Example fix

// before
{'full_base_url': 'passbolt.example.com/'}
// after
{'full_base_url': 'https://passbolt.example.com'}
Defensive patterns

Strategy: validation

Validate before calling

let u = fullBaseUrl.trim();
try {
  const url = new URL(u);
  if (!['http:', 'https:'].includes(url.protocol)) throw new Error('bad scheme');
} catch { throw new Error('full_base_url must be an absolute http(s) URL'); }
u = u.replace(/\/+$/, ''); // trim trailing slashes as the controller does

Type guard

function isAbsoluteHttpUrl(s) {
  if (typeof s !== 'string') return false;
  try { const u = new URL(s); return u.protocol === 'https:' || u.protocol === 'http:'; }
  catch { return false; }
}

Try / catch

try {
  await post('/install/options', { full_base_url: fullBaseUrl, ...options });
} catch (e) {
  if (String(e.message).includes('The data entered are not correct')) {
    // validate full_base_url is absolute http(s) and check other option fields, then resubmit
  }
  throw e;
}

Prevention

When it happens

Trigger: POSTing the WebInstaller options step with an invalid full_base_url (not a valid absolute URL, empty after trimming), or failing other OptionsConfigurationForm rules (e.g. invalid option values).

Common situations: Entering the URL without scheme (passbolt.example.com instead of https://passbolt.example.com); trailing-slash/whitespace issues; leaving the URL empty; reverse proxy supplying a malformed Host header used to prefill the field.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at plugins/PassboltCe/WebInstaller/src/Controller/OptionController.php:101

        $this->webInstaller->setSettingsAndSave('options', $data);
        $this->goToNextStep();
    }

    /**
     * Validate data.
     *
     * @return array
     */
    protected function getAndValidateData()
    {
        $data = $this->request->getData();
        $data['full_base_url'] = trim($data['full_base_url'], '/');
        $optionsConfigurationForm = new OptionsConfigurationForm();
        $confIsValid = $optionsConfigurationForm->execute($data);
        $this->set('formExecuteResult', $optionsConfigurationForm);

        if (!$confIsValid) {
            throw new CakeException(__('The data entered are not correct'));
        }

        return $data;
    }

    /**
     * Define the next step
     *
     * @return string
     */
    protected function getNext(): string
    {
        if (!$this->webInstaller->getSettings('hasSmtpSettings')) {
            return 'install/email';
        }
        if (!$this->webInstaller->getSettings('hasAdmin')) {
            return '/install/account_creation';
        }

View on GitHub (pinned to 31c1bbc10f)