{"record":{"id":"2abc3fc8f1dbf843","repo":"passbolt/passbolt_api","slug":"the-data-entered-are-not-correct","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/AccountCreationController.php","lineNumber":125,"sourceCode":"        $this->webInstaller->setSettingsAndSave('first_user', $data);\n        $this->goToNextStep();\n    }\n\n    /**\n     * Get and validate the posted data.\n     *\n     * @throws \\Cake\\Core\\Exception\\CakeException If the user is not valid\n     * @return array\n     */\n    protected function getAndValidateData()\n    {\n        $data = $this->request->getData();\n        $accountCreationForm = new AccountCreationForm();\n        $isValid = $accountCreationForm->execute($data);\n        $this->set('formExecuteResult', $accountCreationForm);\n\n        if (!$isValid) {\n            throw new CakeException(__('The data entered are not correct'));\n        }\n\n        return [\n            'username' => $data['username'],\n            'profile' => [\n                'first_name' => $data['first_name'],\n                'last_name' => $data['last_name'],\n            ],\n        ];\n    }\n}\n","sourceCodeStart":107,"sourceCodeEnd":137,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltCe/WebInstaller/src/Controller/AccountCreationController.php#L107-L137","documentation":"AccountCreationController::getAndValidateData runs the WebInstaller account creation form (AccountCreationForm::execute) against the POSTed data and throws a generic CakeException 'The data entered are not correct' when execute() returns false. The per-field errors are stored on the form and exposed to the template via formExecuteResult, but the exception itself carries no details.","triggerScenarios":"POSTing the WebInstaller account creation step (indexPost) with a username that is not a valid email, missing username/first_name/last_name, or any field failing AccountCreationForm validation rules.","commonSituations":"Empty profile fields in the installer UI; invalid or already-used email; scripting the installer with a malformed payload; CSRF issues causing empty POST data.","solutions":["Inspect the re-rendered form page / formExecuteResult for the specific field validation errors.","POST a complete payload: username (valid email), first_name, last_name, and required account fields.","Correct the username to a valid, non-conflicting email address.","Re-run the WebInstaller step in the browser UI instead of crafting manual requests."],"exampleFix":"// before\ncurl -d 'username=not-an-email' .../install/account_creation\n// after\ncurl -d 'username=admin@example.com&first_name=Ada&last_name=Lovelace' .../install/account_creation","handlingStrategy":"validation","validationCode":"const data = { username, first_name, last_name };\nconst emailRe = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nif (!emailRe.test(data.username)) throw new Error('username must be a valid email');\nfor (const k of ['username', 'first_name', 'last_name']) {\n  if (!data[k] || !String(data[k]).trim()) throw new Error(k + ' is required');\n}","typeGuard":"function isValidAccountPayload(d) {\n  return d && typeof d.username === 'string' && /@/.test(d.username) &&\n    typeof d.first_name === 'string' && d.first_name.trim().length > 0 &&\n    typeof d.last_name === 'string' && d.last_name.trim().length > 0;\n}","tryCatchPattern":"try {\n  await post('/install/account_creation', payload);\n} catch (e) {\n  if (String(e.message).includes('The data entered are not correct')) {\n    // re-fetch the step HTML / formExecuteResult to read per-field errors\n  }\n  throw e;\n}","preventionTips":["Fill every required field; use a valid, unique email as username.","Submit the installer through its own UI/form encoding, not hand-built bodies.","Check the returned form page for field-level errors before retrying."],"tags":["webinstaller","form-validation","account-creation"],"backgroundTag":"schema-validation-failed","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"}