{"record":{"id":"5c28ab1303c28798","repo":"nextcloud/server","slug":"could-not-register-device-network-error","errorCode":null,"errorMessage":"Could not register device: Network error","messagePattern":"Could not register device: Network error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/settings/src/service/WebAuthnRegistrationSerice.ts","lineNumber":31,"sourceCode":"\n/**\n * Start registering a new device\n *\n * @return The device attributes\n */\nexport async function startRegistration() {\n\tconst url = generateUrl('/settings/api/personal/webauthn/registration')\n\n\ttry {\n\t\tlogger.debug('Fetching webauthn registration data')\n\t\tconst { data } = await axios.get<PublicKeyCredentialCreationOptionsJSON>(url)\n\t\tlogger.debug('Start webauthn registration')\n\t\tconst attrs = await registerWebAuthn({ optionsJSON: data })\n\t\treturn attrs\n\t} catch (e) {\n\t\tlogger.error(e as Error)\n\t\tif (isAxiosError(e)) {\n\t\t\tthrow new Error(t('settings', 'Could not register device: Network error'), { cause: e })\n\t\t} else if ((e as Error).name === 'InvalidStateError') {\n\t\t\tthrow new Error(t('settings', 'Could not register device: Probably already registered'), { cause: e })\n\t\t}\n\t\tthrow new Error(t('settings', 'Could not register device'), { cause: e })\n\t}\n}\n\n/**\n * @param name Name of the device\n * @param data Device attributes\n */\nexport async function finishRegistration(name: string, data: RegistrationResponseJSON) {\n\tconst url = generateUrl('/settings/api/personal/webauthn/registration')\n\n\tconst resp = await axios.post(url, { name, data: JSON.stringify(data) })\n\treturn resp.data\n}\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/settings/src/service/WebAuthnRegistrationSerice.ts#L13-L49","documentation":"Error \"Could not register device: Network error\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/settings/src/service/WebAuthnRegistrationSerice.ts:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}