{"record":{"id":"6ffa2f029d5e52c5","repo":"nextcloud/server","slug":"could-not-rename-oldname-it-does-not-exist-an","errorCode":null,"errorMessage":"Could not rename \"{oldName}\", it does not exist any more","messagePattern":"Could not rename \"(.+?)\", it does not exist any more","errorType":"exception","errorClass":"Error","httpStatus":404,"severity":"error","filePath":"apps/files/src/store/renaming.ts","lineNumber":127,"sourceCode":"\t\t\temit('files:node:moved', {\n\t\t\t\tnode,\n\t\t\t\toldSource: `${dirname(node.source)}/${oldName}`,\n\t\t\t})\n\n\t\t\t// Reset the state not changed\n\t\t\tif (renamingNode.value === node) {\n\t\t\t\t$reset()\n\t\t\t}\n\n\t\t\treturn true\n\t\t} catch (error) {\n\t\t\tlogger.error('Error while renaming file', { error })\n\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}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/files/src/store/renaming.ts#L109-L145","documentation":"Error \"Could not rename \"{oldName}\", it does not exist any more\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/files/src/store/renaming.ts:127 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"}