{"record":{"id":"dcc94f71fdafa5ba","repo":"passbolt/passbolt_api","slug":"the-data-entered-are-not-correct-optioncontroller","errorCode":null,"errorMessage":"The data entered are not correct","messagePattern":"The data entered are not correct","errorType":"exception","errorClass":"CakeException","httpStatus":500,"severity":"error","filePath":"plugins/PassboltCe/WebInstaller/src/Controller/OptionController.php","lineNumber":101,"sourceCode":"        $this->webInstaller->setSettingsAndSave('options', $data);\n        $this->goToNextStep();\n    }\n\n    /**\n     * Validate data.\n     *\n     * @return array\n     */\n    protected function getAndValidateData()\n    {\n        $data = $this->request->getData();\n        $data['full_base_url'] = trim($data['full_base_url'], '/');\n        $optionsConfigurationForm = new OptionsConfigurationForm();\n        $confIsValid = $optionsConfigurationForm->execute($data);\n        $this->set('formExecuteResult', $optionsConfigurationForm);\n\n        if (!$confIsValid) {\n            throw new CakeException(__('The data entered are not correct'));\n        }\n\n        return $data;\n    }\n\n    /**\n     * Define the next step\n     *\n     * @return string\n     */\n    protected function getNext(): string\n    {\n        if (!$this->webInstaller->getSettings('hasSmtpSettings')) {\n            return 'install/email';\n        }\n        if (!$this->webInstaller->getSettings('hasAdmin')) {\n            return '/install/account_creation';\n        }","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltCe/WebInstaller/src/Controller/OptionController.php#L83-L119","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect formExecuteResult / the re-rendered form for the failing field and rule.","Set full_base_url to a full absolute URL including scheme, e.g. https://passbolt.example.com.","Remove trailing slashes and stray whitespace from the URL before submitting.","Check other posted option fields against OptionsConfigurationForm rules and fix any invalid values."],"exampleFix":"// before\n{'full_base_url': 'passbolt.example.com/'}\n// after\n{'full_base_url': 'https://passbolt.example.com'}","handlingStrategy":"validation","validationCode":"let u = fullBaseUrl.trim();\ntry {\n  const url = new URL(u);\n  if (!['http:', 'https:'].includes(url.protocol)) throw new Error('bad scheme');\n} catch { throw new Error('full_base_url must be an absolute http(s) URL'); }\nu = u.replace(/\\/+$/, ''); // trim trailing slashes as the controller does","typeGuard":"function isAbsoluteHttpUrl(s) {\n  if (typeof s !== 'string') return false;\n  try { const u = new URL(s); return u.protocol === 'https:' || u.protocol === 'http:'; }\n  catch { return false; }\n}","tryCatchPattern":"try {\n  await post('/install/options', { full_base_url: fullBaseUrl, ...options });\n} catch (e) {\n  if (String(e.message).includes('The data entered are not correct')) {\n    // validate full_base_url is absolute http(s) and check other option fields, then resubmit\n  }\n  throw e;\n}","preventionTips":["Always include the scheme (https://) in full_base_url.","Trim trailing slashes and whitespace before submitting.","Do not leave full_base_url empty; let the reverse proxy or config supply a correct value.","Verify other option fields comply with OptionsConfigurationForm rules."],"tags":["webinstaller","form-validation","url","configuration"],"backgroundTag":"invalid-url-format","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"}