Issue during server starting - can't delete fusionreactor file

I am trying to start a new server but I have a big problem :sleepy:
The installation finished but when I try to start the new server I get the error below.
In the folder D:\CommandBox there is no block for removing file/folders so I don’t know what I have to do

CommandBox> start tp_71_demo
 × | Starting Server
   |------------------------------
   | WAR/zip archive already installed.
   |------------------------------
   | √ | Setting Server Profile to [production]
   | × | Loading FusionReactor
   |   |------------------------------------
   |   | × | Installing package [forgebox:fusionreactor@^8.0.0]
   |   |   | > Can't delete file [D:\CommandBox\home\temp\54AD305A-E431-4A76-B7EBDCAEF6F2EF00\fusionreactor.jar]
   |   |   |-----------------------------------------------------------------
   |   |   | Verifying package 'fusionreactor' in forgebox, please wait...
   |   |   | Installing version [8.8.0].
   |   |   | Verified entry in forgebox: 'fusionreactor'
   |   |   | Package found in local artifacts!
   |   |   | Decompressing...
   |   |   |-----------------------------------------------------------------

ERROR (5.3.1+00392)

Can't delete file [D:\CommandBox\home\temp\54AD305A-E431-4A76-B7EBDCAEF6F2EF00\fusionreactor.jar]
  caused by: java.io.IOException
  Can't delete file [D:\CommandBox\home\temp\54AD305A-E431-4A76-B7EBDCAEF6F2EF00\fusionreactor.jar]


D:\CommandBox\home\cfml\system\services\PackageService.cfc: line 468
466:                                            var pathInsideTmp = tmpPath.replaceNoCase( tempDir, '' );
467:                                            // Delete the top most directory inside the temp folder
468:                                            directoryDelete( tempDir & '/' & pathInsideTmp.listFirst( '/\' ), true );
469:                                    }
470:                                    if( skipInstall ) {
called from D:\CommandBox\home\cfml\modules\commandbox-fusionreactor\ModuleConfig.cfc: line 137
called from D:\CommandBox\home\cfml\system\wirebox\system\core\events\EventPool.cfc: line 118
called from D:\CommandBox\home\cfml\system\wirebox\system\core\events\EventPool.cfc: line 95
called from D:\CommandBox\home\cfml\system\wirebox\system\core\events\EventPoolManager.cfc: line 59
called from D:\CommandBox\home\cfml\system\services\InterceptorService.cfc: line 57
called from D:\CommandBox\home\cfml\system\services\ServerService.cfc: line 1261
called from D:\CommandBox\home\cfml\system\services\ServerService.cfc: line 887
called from D:\CommandBox\home\cfml\system\modules_app\server-commands\commands\server\start.cfc: line 173
called from D:\CommandBox\home\cfml\system\services\CommandService.cfc: line 345
called from D:\CommandBox\home\cfml\system\services\CommandService.cfc: line 139
called from D:\CommandBox\home\cfml\system\Shell.cfc: line 787
called from D:\CommandBox\home\cfml\system\Shell.cfc: line 607
called from D:\CommandBox\home\cfml\system\Bootstrap.cfm: line 154

lucee.runtime.exp.NativeException: Can't delete file [D:\CommandBox\home\temp\54AD305A-E431-4A76-B7EBDCAEF6F2EF00\fusionreactor.jar]
        at lucee.commons.io.res.type.file.FileResource.remove(FileResource.java:293)
        at lucee.commons.io.res.type.file.FileResource.remove(FileResource.java:284)
        at lucee.runtime.tag.Directory.actionDelete(Directory.java:736)
        at lucee.runtime.functions.file.DirectoryDelete.call(DirectoryDelete.java:34)
        at system.services.packageservice_cfc$cf.udfCall1(/commandbox/system/services/PackageService.cfc:468)
        at system.services.packageservice_cfc$cf.udfCall(/commandbox/system/services/PackageService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at modules.commandbox_fusionreactor495.moduleconfig_cfc$cf.udfCall(/commandbox/modules/commandbox-fusionreactor/ModuleConfig.cfc:137)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:898)
        at lucee.runtime.functions.dynamicEvaluation.Invoke.call(Invoke.java:49)
        at system.core.events.eventpool_cfc$cf.udfCall(/wirebox/system/core/events/EventPool.cfc:118)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
        at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:779)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
        at system.core.events.eventpool_cfc$cf.udfCall(/wirebox/system/core/events/EventPool.cfc:95)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
        at system.core.events.eventpoolmanager_cfc$cf.udfCall1(/wirebox/system/core/events/EventPoolManager.cfc:59)
        at system.core.events.eventpoolmanager_cfc$cf.udfCall(/wirebox/system/core/events/EventPoolManager.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
        at system.services.interceptorservice_cfc$cf.udfCall1(/commandbox/system/services/InterceptorService.cfc:57)
        at system.services.interceptorservice_cfc$cf.udfCall(/commandbox/system/services/InterceptorService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
        at system.services.serverservice_cfc$cf.udfCall1_000004(/commandbox/system/services/ServerService.cfc:1261)
        at system.services.serverservice_cfc$cf.udfCall1(/commandbox/system/services/ServerService.cfc:887)
        at system.services.serverservice_cfc$cf.udfCall(/commandbox/system/services/ServerService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at system.modules_app.server_commands315.commands.server.start_cfc$cf.udfCall(/commandbox/system/modules_app/server-commands/commands/server/start.cfc:173)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:345)
        at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:792)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:139)
        at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
        at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1710)
        at system.shell_cfc$cf.udfCall4(/commandbox/system/Shell.cfc:787)
        at system.shell_cfc$cf.udfCall(/commandbox/system/Shell.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:792)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at system.shell_cfc$cf.udfCall3(/commandbox/system/Shell.cfc:607)
        at system.shell_cfc$cf.udfCall(/commandbox/system/Shell.cfc)
        at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
        at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
        at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
        at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
        at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
        at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
        at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1729)
        at commandbox.home.cfml.system.bootstrap_cfm$cf.call(/__commandbox_root/CommandBox/home/cfml/system/Bootstrap.cfm:154)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:945)
        at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:837)
        at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:818)
        at 1068i35pqh4dc.call(Unknown Source)
        at lucee.runtime.compiler.Renderer.tag(Renderer.java:108)
        at lucee.runtime.compiler.Renderer.script(Renderer.java:98)
        at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:63)
        at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:194)
        at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:330)
        at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:155)
        at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:583)
Caused by: java.io.IOException: Can't delete file [D:\CommandBox\home\temp\54AD305A-E431-4A76-B7EBDCAEF6F2EF00\fusionreactor.jar]
        ... 127 more

It appears that you have a permissions issue on that directory. Since that’s a temp directory, I doubt that JAR is being used by another process.

My user has all the permissions for the directory

I add also the authorization for all the users on the server

I would suggest manually deleting the directory D:\CommandBox\home\temp and trying again, then.

Same problem also deleting the temp folder, the new directory
D:\CommandBox\home\temp\32C3D757-8193-426C-B3770B523CB0A347
is automatically created by the server start test command but it is not deleted

I’m not sure then. It’s definitely permissions-related, if that JAR file exists. Did you try starting the server under an Administrator account? Is it possible that your virus scanner has a lock on that file while it’s attempting to delete?

@Oromis1995 I actually think there is almost zero chance this is permissions related. I would bet money that you have an antivirus program which scans all jar files written to disk. I just ran into a user with an issue like this a few weeks back. The jar file is written to a tmp dir as it’s unzipped, then it’s copied over to the server home, and the tmp folder is deleted. The jar is never actually executed from the tmp directory so Java or the server itself can’t be locking it. Check the logs on your anti-virus program and I bet it’s still scanning the jar (which is sort of large and has many smaller jars packed inside of it, so it takes a while to scan). The “permission denied” error is how a locked file usually presents itself in java.

Wouldn’t “permission denied” on a locked file be permissions related? :wink:

No, it’s not. A permissions issue is when a process doesn’t have permissions to a file via the configured ACLs. If the file is simply locked in Windows by another process which is using it so it can’t be removed, that’s not really “permissions”, it’s just “in use”. Sadly, Java has always run afoul of rolling those two scenarios into the same error message which leads many people astray.

As @bdw429s said it was an antivirus locking problem, thanks a lot!

1 Like