{"record":{"id":"c10cf7f1b362c93d","repo":"pentaho/pentaho-kettle","slug":"vfs-provider-delete-error","errorCode":"vfs.provider/delete.error","errorMessage":"vfs.provider/delete.error","messagePattern":"vfs\\.provider/delete\\.error","errorType":"error_code","errorClass":"FileSystemException","httpStatus":null,"severity":"error","filePath":"plugins/repo-vfs/repo-vfs-ws/src/main/java/org/pentaho/di/plugins/repovfs/ws/vfs/JCRSolutionFileObject.java","lineNumber":396,"sourceCode":"  }\n\n  @Override\n  public int delete( final FileSelector selector ) throws FileSystemException {\n    if ( selector == null || selector == Selectors.SELECT_SELF || selector == Selectors.SELECT_ALL ) {\n      delete();\n      return 1;\n    } else {\n      return super.delete( selector );\n    }\n  }\n\n  @Override\n  public boolean delete() throws FileSystemException {\n    doDelete();\n    try {\n      handleDelete();\n    } catch ( Exception e ) {\n      throw new FileSystemException(\"vfs.provider/delete.error\", e, getName() );\n    }\n    return true;\n  }\n\n  @Override\n  protected void doDelete() throws FileSystemException {\n    log.debug( \"deleting {}\", getName() );\n    try {\n      repoClient.delete( getFileDto() );\n    } catch ( RepositoryClientException e ) {\n      throw new FileSystemException( e );\n    }\n  }\n\n  @Override\n  protected void onChildrenChanged( FileName child, FileType newType ) throws Exception {\n    super.onChildrenChanged( child, newType );\n    refresh();","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/repo-vfs/repo-vfs-ws/src/main/java/org/pentaho/di/plugins/repovfs/ws/vfs/JCRSolutionFileObject.java#L378-L414","documentation":"JCRSolutionFileObject.delete() calls doDelete() to remove the file in the repository, then handleDelete() to update the VFS cache. If handleDelete() (or doDelete()) throws any exception, it is wrapped in a FileSystemException with code 'vfs.provider/delete.error' and the file's name. It means the deletion succeeded/failed in the repository but the local VFS state could not be reconciled, or the underlying delete itself failed.","triggerScenarios":"Deleting a file whose repository session is stale; permission denied on delete; handleDelete() failing because the file object is no longer resolvable after doDelete(); concurrent modification by another client.","commonSituations":"Stale cache after another client deleted the file (delete already happened, handleDelete now fails); insufficient JCR permissions; network hiccup mid-delete sequence.","solutions":["Check the cause of the FileSystemException to see if the file was actually deleted in the repository (then just refresh the file system cache)","Call refresh() on the file object / parent and retry","Reconnect the repository if the session expired, then retry deletion","Verify delete permissions for the repository user"],"exampleFix":"// before\nfileObject.delete(); // may throw vfs.provider/delete.error\n// after\ntry {\n  fileObject.delete();\n} catch ( FileSystemException e ) {\n  fileObject.refresh();\n  if ( fileObject.exists() ) {\n    throw e; // real failure, propagate\n  } // else: file is gone; treat as deleted\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight before delete\nif ( !fileObject.exists() ) { return true; } // nothing to delete\nif ( !fileObject.isWriteable() ) { throw new SecurityException( \"No delete permission\" ); }","typeGuard":null,"tryCatchPattern":"try {\n  fileObject.delete();\n} catch ( FileSystemException e ) {\n  fileObject.refresh();\n  if ( fileObject.exists() ) {\n    throw e; // genuinely still present: real failure\n  }\n  // deleted on server, only cache update failed: treat as success\n}","preventionTips":["Refresh file objects before delete in long-lived sessions","Check write/delete permissions before attempting deletion","Handle the case where the file was already deleted by another client","Reconnect the repository when deletes start failing after a long session"],"tags":["vfs","file-delete","cache"],"backgroundTag":"file-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}