CommandBox gives Error (5.5.1+00562) when i try to give a command

I’m using Command Box to start and stop Lucee servers. It’s been working just fine for several weeks now. But today with no apparent reason (obviously there IS a reason but i didnt see anything that i thought might be the reason) it’s started spitting out any command I give it except simple cd commands.
I’m a newbie for using CommandBox and Lucee. How do i go about finding out what’s wrong here?

Mike Kear
Windsor, NSW, Australia

For example, when I use the command server restart foggyhollow, I get the following error:

ERROR (5.5.1+00562) Invalid String Literal Syntax closing ["] not found.
then it seems to point to a location at
\system\services\ServerService.cfc : line 2460
2458: struct function getServers() {
2459: if( fileExists( variables.serverConfig ) ){
2460: var results = deserializeJSON( fileSystemUtil.lockingfileRead( variables.serverConfig ) );
2461: var updateRequired = false;
2462: var serverKeys = results.keyArray();
called from \system\modules_app\server-commands\commands\server\list.cfc: line 81
called from \system\services\CommandService.cfc: line 442
called from \system\services\CommandService.cfc: line 224
called from \system\Shell.cfc: line 819
called from \system\Shell.cfc: line 634
called from \system\Bootstrap.cfm: line 160

OS: Windows 10 V 21H1 Build 19043.1706
Java Version: Version 8 update 331 build 1.8.0_331-b09
Tomcat Version: Tomcat 9.0 Servlet/JSP Container

@mikek I’d recommand posting pure CommandBox questions over in the Ortus community forum where I’m likely to see it sooner :slight_smile:

That error indicate that the main servers.json file that lives inside your ~/.CommandBox home has gotten corrupted and is no longer valid JSON. Can you send me a copy of that file? Also, just delete the file and restart CommandBox. It will forget any servers you’ve started in the past, but it will stop complaining. It’s not common for that file to get corrupted, especially since CommandBox uses locking at the actual file system level to ensure two process can never touch the file at the same time. Usually the only way to corrupt it is if you pull your computer’s plug or kill java while it’s int he middle of writing the file.

Thanks for this. It makes sense now. I had to take “the nuclear option” yesterday when i waited 15 minutes for a restart that was apparently not going to happen. There’s always a danger of corrupting something when you do that. Only … .WHERE do i find the main servers .json file? I have multiple servers set up. Do I need to go to all of them and delete - server.json until i no longer get the error?

Mike Kear

1 Like

Don’t worry. Dumbass question - i found the main servers.json file and renamed it so i havent lost anything that might be there. Then as you suggested I quit and restarted commandbox and it’s behaving again. Thank you. I also have managed to get rid of some of my early learning about how to set up servers that i didnt know how to get rid of since “forget Servername” wasn’t working with those. Win all around even if i had a very stressful hour or so last night - this all happened to the application i use to manage my radio show’s activity, web site, and music database and it was 20 minutes to air time.

Mike Kear
Windsor, NSW, Australia

1 Like