Electron WindowsOS File`delete` failed

I am using Theia v1.19.0

Windows OS v10

I tried deleting a file using explorer panel’s context menu item. I got this error. Any one aware about it?

root ERROR Error: Request 'delete' failed

    at Proxy.<anonymous> (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/bundle.js:59095:35)

    at RemoteFileSystemProvider.delete (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/vendors-node_modules_theia_filesystem_lib_browser_files

ystem-frontend-module_js.bundle.js:675:34)

    at FileService.doDelete (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/vendors-node_modules_theia_filesystem_lib_browser_file-service_js.

bundle.js:953:30)

    at async FileService.delete (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/vendors-node_modules_theia_filesystem_lib_browser_file-service

_js.bundle.js:924:13)

    at async Promise.all (index 1)

    at async WorkspaceDeleteHandler.delete (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/vendors-node_modules_theia_workspace_lib_browser_wo

rkspace-frontend-module_js-node_modules_th-be7b79.bundle.js:1125:13)

    at async Promise.all (index 0)

    at async WorkspaceDeleteHandler.execute (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/vendors-node_modules_theia_workspace_lib_browser_w

orkspace-frontend-module_js-node_modules_th-be7b79.bundle.js:1052:13)

    at async CommandRegistry.executeCommand (file:///C:/theia/tool-suite/theia-ide/electron-app/lib/bundle.js:56052:28)

Caused by: Unknown (FileSystemError): Error: Command failed: C:\theia\application\theia-ide\node_modules\trash\lib\windows-trash.exe c:\Temp\theia-

ws\.application.log

    at Object.createFileSystemProviderError (C:\theia\application\theia-ide\node_modules\@theia\filesystem\lib\common\files.js:207:27)

    at DiskFileSystemProvider.toFileSystemProviderError (C:\theia\application\theia-ide\node_modules\@theia\filesystem\lib\node\disk-file-system-provid

er.js:759:24)

    at DiskFileSystemProvider.delete (C:\theia\application\theia-ide\node_modules\@theia\filesystem\lib\node\disk-file-system-provider.js:411:24)

    at runMicrotasks (<anonymous>)

    at processTicksAndRejections (internal/process/task_queues.js:94:5)

    at async RemoteFileSystemProxyFactory.onRequest (C:\theia\application\theia-ide\node_modules\@theia\core\lib\common\messaging\proxy-factory.js:127:

24)

Caused by: Unknown (FileSystemError): Error: Command failed: C:\theia\application\theia-ide\node_modules\trash\lib\windows-trash.exe c:\Temp\theia-ws.application.log

Are you trying to delete a file that is in use maybe?

@tsmaeder that might be true, I am deleting a log file, but in linuxOS, this issue is not reproducible.

That the error does not occur in Linux actually supports my hypothesis: you can delete open files in linux (you’re just removing the directory entry) whereas in Windows, it’s not possible.

1 Like