{"record":{"id":"baf40ce2d20f304b","repo":"nextcloud/server","slug":"could-not-rename-oldname","errorCode":null,"errorMessage":"Could not rename \"{oldName}\"","messagePattern":"Could not rename \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/files/src/store/renaming.ts","lineNumber":140,"sourceCode":"\t\t\t// Rename back as it failed\n\t\t\tnode.rename(oldName)\n\t\t\tif (isAxiosError(error)) {\n\t\t\t\t// TODO: 409 means current folder does not exist, redirect ?\n\t\t\t\tif (error?.response?.status === 404) {\n\t\t\t\t\tthrow new Error(t('files', 'Could not rename \"{oldName}\", it does not exist any more', { oldName }), { cause: error })\n\t\t\t\t} else if (error?.response?.status === 412) {\n\t\t\t\t\tthrow new Error(t(\n\t\t\t\t\t\t'files',\n\t\t\t\t\t\t'The name \"{newName}\" is already used in the folder \"{dir}\". Please choose a different name.',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewName,\n\t\t\t\t\t\t\tdir: basename(renamingNode.value!.dirname),\n\t\t\t\t\t\t},\n\t\t\t\t\t), { cause: error })\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Unknown error\n\t\t\tthrow new Error(t('files', 'Could not rename \"{oldName}\"', { oldName }), { cause: error })\n\t\t} finally {\n\t\t\tVue.set(node, 'status', undefined)\n\t\t\tisRenaming.value = false\n\t\t}\n\t}\n\n\t/**\n\t * Reset the store state\n\t */\n\tfunction $reset(): void {\n\t\tnewNodeName.value = ''\n\t\trenamingNode.value = undefined\n\t}\n\n\t// Make sure we only register the listeners once\n\tsubscribe('files:node:rename', (node: INode) => {\n\t\trenamingNode.value = node\n\t\tnewNodeName.value = node.basename","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/files/src/store/renaming.ts#L122-L158","documentation":"Error \"Could not rename \"{oldName}\"\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/files/src/store/renaming.ts:140 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"}