{"record":{"id":"892a5fb6012b2048","repo":"nextcloud/server","slug":"cannot-be-deleted","errorCode":null,"errorMessage":" cannot be deleted","messagePattern":" cannot be deleted","errorType":"exception","errorClass":"Sabre\\DAV\\Exception\\Forbidden","httpStatus":403,"severity":"error","filePath":"apps/dav/lib/Connector/Sabre/FilesPlugin.php","lineNumber":219,"sourceCode":"\t\tif (!$sourceNode instanceof Node) {\n\t\t\treturn;\n\t\t}\n\n\t\t// First check copyable (move only needs additional delete permission)\n\t\t$this->checkCopy($source, $target);\n\n\t\t[$sourceDir] = \\Sabre\\Uri\\split($source);\n\t\t[$destinationDir, ] = \\Sabre\\Uri\\split($target);\n\n\t\tif ($sourceDir === $destinationDir) {\n\t\t\tif (!$sourceNode->canRename()) {\n\t\t\t\tthrow new Forbidden($source . ' cannot be renamed');\n\t\t\t}\n\t\t} else {\n\t\t\t// The source needs to be deletable for moving\n\t\t\t$sourceNodeFileInfo = $sourceNode->getFileInfo();\n\t\t\tif (!$sourceNodeFileInfo->isDeletable()) {\n\t\t\t\tthrow new Forbidden($source . ' cannot be deleted');\n\t\t\t}\n\t\t}\n\n\t\t// The source is not allowed to be the parent of the target\n\t\tif (str_starts_with($source, $target . '/')) {\n\t\t\tthrow new Forbidden($source . ' cannot be moved to it\\'s parent');\n\t\t}\n\t}\n\n\t/**\n\t * This sets a cookie to be able to recognize the start of the download\n\t * the content must not be longer than 32 characters and must only contain\n\t * alphanumeric characters\n\t *\n\t * @param RequestInterface $request\n\t * @param ResponseInterface $response\n\t */\n\tpublic function handleDownloadToken(RequestInterface $request, ResponseInterface $response) {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Connector/Sabre/FilesPlugin.php#L201-L237","documentation":"Error \" cannot be deleted\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/Connector/Sabre/FilesPlugin.php:219 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"}