I have a CF 2021 with all the latest patches and am trying to create a new instance but the service does not get created even though I checked the box (I tried twice) and below is the result.
Enterprise Administrator - Creating New CF Instance
[step 1 of 2] Creating new CF Instance... Done
[step 2 of 2] Creating the CF runtime, this may take a few minutes...Done
Return to Enterprise Manager
No errors and I can see the new instance folder under D:\ColdFusion2021. I checked instances.xml and I do see that the new instance was added but no service was created.
Is there a way to manaully create the service? I did not have this issue with other servers running the exact same version of CF with same patches (up to date)
Hi @gabrieldavis321 ,
Please open the command prompt as administrator and run the below command:
sc create "ColdFusion Application Server Instance Name" binPath=C:\ColdFusionxxxx\instance-name\bin\coldfusionsvc.exe start=auto DisplayName="ColdFusion Application Server Instance Name"
I tried that and it registered in Services but when I try to start it it says "Windows could not start the Coldfusion Apps Server on Local Computer. For more information, review the System Events Log. If this is a non-Microsoft service, contact the service vender, and refer to service-specific error code 2"
I checked the Systems event log and it says "The Coldfusion 2021 Apps Server service terminated with the following service-specific error:
The system cannot find the file specified."
But I am sure that the path is correct because I can see coldfusionsvc.exe in the same folder as the path in the Service properties - Path to executable: D:\ColdFusion2021\apps\bin\coldfusionsvc.exe.
I modified the permissions to give the service account that CF runs under full control of D:\ColdFusion2021\apps.
Gabe, I suspect I can guess both problems.
First, as for why CF did not create the service (and you had to do it manually), you mention having changed the cfusion instance to run as a different user (than the default of "system"), and that's good for security. But the problem is that now that newly created user does not have the authority to modify the registry section where service definitions are stored.
Open regedit, and go to \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\, then right click on Services, and choose Permissions, then click Add, and then enter the user running CF and give it Full Control. (This is the same UI as adding permissions for a folder or file, and as you may know you may need to click the Locations button while adding the user, to choose your current computer versus some central AD server.)
Once you do this, create another instance and see if that creates it. If so, you're done. And while you can delete the instance, that will NOT delete the service. You can either use the delete argument of the SC command that Vikram created, you can also just delete the registry key of the given name (under Services), though note that they are shown there not by the "display name" but the service name (what you see when you right-click on a service in the Services control panel.)
Second and finally, as for why
Second, as for why the service won't start, I think that has nothing to do with this other problem. You mentioned you changed the user running that service (that you created by hand--and you'll want to do the same for this new one if created by the add of an instance). Don't forget also change the permissions for the new instance folder (under the CF folder) to be sure to give that folder permissions for that CF users (if it was not inherited when the instance was created, by a change you maybe did to the entire CF folder).
So then as for "why won't it start", go to the command line (as admin) and to the instance's bin folder (coldfusion2021/[instancename]/bin), and from there run cfstart. What does it complain about? If I had to guess, it may be that the creation of the new instance inherited jvm (jvm.config) changes made for that cfusion instance, which don't apply for the new instance. An example is that you may have implemented FusionReactor (or any other javaagent), and the folder pointed to in the new instance does not exist. (The creation of the new instance presumed to change any lines in the jvm.config that referred to "cfusion" to refer to the new instance name, which doesn't always "work".)
Let us know how it goes. As I said, these are just guesses, but from past experience helping folks with such problems. Hope it works out for you. 🙂
I checked the new instance using cfstart and sure enough you were right! I got an error: "Error opening zip file or JAR manifest missing : D:/FusionReactor/instance/apps.cf2021/fusionreactor.jar" ... I modified the new app's jvm file and removed all references to fusionreactor and now the service works! Thanks to both!
Great to hear on the resolution to CF not starting. How about the other issue of a new instance creating services? Did you try what I suggested, and did it work? It's unclear if the "both" you refer to is those two matters or perhaps just your thanking me and Vikram for trying to help.
It would help future readers to hear if the service problem was resolved for you with the approach I proposed.