{"record":{"id":"733e20a5d3b7e25e","repo":"theonedev/onedev","slug":"email-address-already-used","errorCode":null,"errorMessage":"Email address already used: ","messagePattern":"Email address already used: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/security/CreateUserFromInvitationPage.java","lineNumber":55,"sourceCode":"public class CreateUserFromInvitationPage extends SimplePage {\n\n\tprivate final String PARAM_INVITATION_CODE = \"invitationCode\";\n\t\n\tprivate final IModel<UserInvitation> invitationModel;\n\t\n\tpublic CreateUserFromInvitationPage(PageParameters params) {\n\t\tsuper(params);\n\t\t\n\t\tString invitationCode = params.get(PARAM_INVITATION_CODE).toString();\n\t\tinvitationModel = new LoadableDetachableModel<UserInvitation>() {\n\n\t\t\t@Override\n\t\t\tprotected UserInvitation load() {\n\t\t\t\tUserInvitation invitation = getInvitationService().findByInvitationCode(invitationCode);\n\t\t\t\tif (invitation == null)\n\t\t\t\t\tthrow new ExplicitException(_T(\"Invalid invitation code\"));\n\t\t\t\telse if (getEmailAddressService().findByValue(invitation.getEmailAddress()) != null)\n\t\t\t\t\tthrow new ExplicitException(_T(\"Email address already used: \") + invitation.getEmailAddress());\n\t\t\t\telse\n\t\t\t\t\treturn invitation;\n\t\t\t}\n\t\t\t\n\t\t};\n\t}\n\t\n\t@Override\n\tprotected void onInitialize() {\n\t\tsuper.onInitialize();\n\n\t\tUser newUser = new User();\n\t\tBeanEditor editor = BeanContext.edit(\"editor\", newUser, Sets.newHashSet(PROP_TYPE, PROP_NOTIFY_OWN_EVENTS), true);\n\t\t\n\t\tForm<?> form = new Form<Void>(\"form\") {\n\n\t\t\t@Override\n\t\t\tprotected void onSubmit() {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/security/CreateUserFromInvitationPage.java#L37-L73","documentation":"In the same UserInvitation load model, if the invitation exists but its email address is already registered in the system (getEmailAddressService().findByValue(...) != null), OneDev throws ExplicitException('Email address already used: <address>') to prevent creating a duplicate user from an invitation.","triggerScenarios":"Accepting an invitation whose email address already belongs to an existing user/email record — typically because the invitation link was opened after the account was already created, or another user already occupies that email.","commonSituations":"Clicking the invitation link twice (account created on first click); inviting an email that later got registered via normal sign-up; user re-signing-up with the same address after deleting only their invitation.","solutions":["Log in with the existing account for that email, or use 'forgot password' if you never set one.","Have an admin delete or rename the existing account using that email, then reuse the invitation.","Request a new invitation with a different email address.","Check Server Admin for which user currently owns the email shown in the message."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (emailAddressService.findByValue(invitation.getEmailAddress()) != null) {\n  // sign in or reset password for the existing account instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  acceptInvitation(code);\n} catch (ExplicitException e) {\n  if (e.getMessage().startsWith(\"Email address already used\")) {\n    // route to login / password reset\n  }\n}","preventionTips":["Click invitation links only once; log in afterwards.","Check for an existing account before inviting an email.","Use unique emails per user.","Admins: resolve email conflicts in user management before re-inviting."],"tags":["invitation","duplicate-email","user-management"],"backgroundTag":"email-already-in-use","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}