{"record":{"id":"ca29809f51a3515a","repo":"odysseus-dev/odysseus","slug":"account-creation-failed","errorCode":null,"errorMessage":"Account creation failed","messagePattern":"Account creation failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"static/login.html","lineNumber":461,"sourceCode":"        errEl.textContent = 'This username is reserved';\n        errEl.style.display = 'block';\n        submitBtn.disabled = false;\n        return;\n      }\n    }\n\n    // Setup or signup first\n    if (mode === 'setup' || mode === 'signup') {\n      const endpoint = mode === 'setup' ? '/api/auth/setup' : '/api/auth/signup';\n      try {\n        const res = await fetch(endpoint, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          credentials: 'same-origin',\n          body: JSON.stringify({ username, password })\n        });\n        const data = await res.json();\n        if (!res.ok) throw new Error(data.detail || 'Account creation failed');\n      } catch (err) {\n        errEl.textContent = err.message;\n        errEl.style.display = 'block';\n        submitBtn.disabled = false;\n        return;\n      }\n    }\n\n    // Login (auto-login after setup/signup too)\n    const remember = document.getElementById('remember').checked;\n    function finishLogin() {\n      const _rem = document.getElementById('remember').checked;\n      if (_rem) localStorage.setItem('odysseus-last-user', username);\n      else localStorage.removeItem('odysseus-last-user');\n      sessionStorage.removeItem('ody-session-active');\n      submitBtn.innerHTML = '<span class=\"login-spinner\" aria-hidden=\"true\"></span>';\n      submitBtn.disabled = true;\n      Promise.all([","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/static/login.html#L443-L479","documentation":"Fallback error during initial setup or signup in login.html. POST /api/auth/setup or /api/auth/signup returning non-2xx throws with data.detail when available, otherwise this generic message which is shown inline and stops the auto-login flow.","triggerScenarios":"Setup when an account already exists (409), signup when registration is disabled or the username is taken (403/409), weak/rejected password (400/422 with detail), or non-JSON error body.","commonSituations":"Revisiting the setup page after the first account was created; duplicate username; password policy violation; proxy intercepting the POST.","solutions":["Read the inline error text — the server's data.detail (e.g. 'username already taken') replaces this generic message","If setup already completed, log in instead of re-running setup","Choose a different username and a policy-compliant password, then retry","Check the response body in devtools when only the generic message shows"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (username.length < 3 || password.length < 8) { errEl.textContent = 'Username ≥3 chars, password ≥8 chars'; return; }","typeGuard":null,"tryCatchPattern":"try { await createAccount(mode, username, password); } catch (err) { errEl.textContent = err.message; submitBtn.disabled = false; }","preventionTips":["Prefer the server's data.detail message over the generic fallback for diagnosis","If setup already ran, use login mode instead of setup","Validate password policy client-side to reduce round trips"],"tags":["authentication","setup","signup","frontend"],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}