Error cloning commandbox-cfconfig in new restful API

Following the docs:

https://coldbox.ortusbooks.com/digging-deeper/recipes/building-rest-apis

coldbox create app name=MyRestAPP skeleton=rest

getting this error:

   | × | Installing package [forgebox:commandbox-cfconfig@*]
   |   | > Error cloning github repository
   |   |------------------------------------------------------------------
   |   | Verifying package 'commandbox-cfconfig' in forgebox, please wait...
   |   | Installing version [1.2.0].
   |   | Verified entry in forgebox: 'commandbox-cfconfig'
   |   | Deferring to [github] endpoint for forgebox entry [commandbox-cfconfig]...
   |   | Using branch [v1.2.0]
   |   | Cloning Git URL [https://github.com/Ortus-Solutions/commandbox-cfconfig.git]
   |   |------------------------------------------------------------------

ERROR (5.2.1+00295)

Error cloning github repository

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.SystemReader
\system\endpoints\Git.cfc: line 123
121:                            } while( !isNull( theRealJavaException ) )
122:
123:                            throw( message="Error cloning #getNamePrefixes()# repository", detail="#deepMessage#",  type="endpointException");
124:                    }

Server starts correctly. Anything to worry about?

It would appear your CommandBox installation is corrupt. The JGit classes come from the

~/.CommandBox/lib/org.eclipse.jgit-5.5.1.201910021850-r.jar

jar. Is it present on your machine?

Server starts correctly

CFConfig isn’t necessary to start the server, but it is necessary if you want it to mange your configuration :slight_smile:

Anything to worry about?

Yes, if you were expecting CFConfig to mange your CF config.

I have org.eclipse.jgit-5.3.0.201903130848-r.jar. I just used cfconfig on another repo to export CF 10 settings. CommandBox says it’s upgraded to the latest. All files in that folder show 9/26/2019 as the latest write time.

CommandBox 5.2.1+00295

It’s possible you already had CFConfig installed prior to the install command that threw the error would could explain why you are able to use CFConfig. As far as why Lucee threw the error about not being able to find the JGit class, I haven’t the slightest. I’ve never seen that error before.

Ok, I’ll blitz the .CommandBox folder and start from scratch later. Just need to start an API for now. Thanks.

It may have been a fluke. Perhaps just wait and see if you see it again or not.

I just encountered this exact same error running Commandbox 5.9.0+00721.

 |   |-----------------------------------------------------------------
   |   | × | Installing package [forgebox:lucee-password-util@^1.0.0]
   |   |   |-----------------------------------------------------------------------
   |   |   | Verifying package 'lucee-password-util' in forgebox, please wait...
   |   |   | Installing version [1.0.3].
   |   |   | Verified entry in forgebox: 'lucee-password-util'
   |   |   | Deferring to [github] endpoint for forgebox entry [lucee-password-util]...
   |   |   | Using branch [v1.0.3]
   |   |   | Cloning Git URL [https://github.com/bdw429s/lucee-password-util.git]
   |   |   |-----------------------------------------------------------------------

ERROR (5.9.0+00721)
Error cloning github repository
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.SystemReader

Any thoughts or suggestions for how to troubleshoot further? Unlike the OP, cfconfig is not functional, nor has it ever been as far as I know.

I think I recognize that error, but I forget what caused it. I think that’s a secondary exception. Try closing and restarting CommandBox and try again and see if a different exception is being thrown the first time as on subsequent requests.

Thank you for the suggestion, Brad. Closing CommandBox and re-running the install command seems to have done the trick!

I have a brand new copy of windows and commandbox and I get the following error when trying to install cfformat (and cfconfig) cfformat is just a cleaner error.

NOTE: I am on 5.7.0, I would like to update to 5.9.* but when updating to 6 there were issues introduced with relative paths.

CommandBox> install commandbox-cfformat
 × | Installing package [forgebox:commandbox-cfformat]
   |----------------------------------------------------------------
   | Verifying package 'commandbox-cfformat' in forgebox, please wait...
   | Installing version [0.19.0].
   | Verified entry in forgebox: 'commandbox-cfformat'
   | Deferring to [github] endpoint for forgebox entry [commandbox-cfformat]...
   | Using branch [v0.19.0]
   | Cloning Git URL [https://github.com/jcberquist/commandbox-cfformat.git]
   |----------------------------------------------------------------


ERROR (5.7.0+00653)

Error cloning github repository

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.util.SystemReader

It seems that 5.7 just does not work properly. I was able to find my exe for 5.9.1 and the error went away. You guys should really have the prior versions hosted still instead of forcing updates to 6.0 because I need the same version on all the devs machines.

Looks like you have a corrupted jar. Maybe your antivirus is removing it automatically?

Can you elaborate? I’m not aware of this. There was one very specific change related to relative aliases in server.json, but that’s not a regression, it was on purpose and there is a very simple fix to get your JSON squared away.

Again, something must be corrupting that jar or your download is invalid. Thousands of people all used 5.7 when it was released (2 years ago) without issue.

Um, we do. Every version of CommandBox that has ever existed all the way back to version 1.0.0 is still on our S3 download server:
https://downloads.ortussolutions.com/#/ortussolutions/commandbox/
This URL is in the docs on this page: Download | 6.0.0 | CommandBox : CLI, Package Manager, REPL & More

Nobody is “forcing” you to do anything. I’m not sure what you’re talking about. That said, you should start a new thread for whatever issues you’re having with 6.0 so we can get those resolved for you.

Brad, I went to this page MULTIPLE times, I finally today realized that the older builds are available under the header Bleeding Edge. I literally spent two days looking for it. I think we can both agree that historical builds are not Bleeding Edge and that might need a bit of rewording to make it more clear. Nothing in that paragraph makes it seem like that is where you can find historical builds.

Can you elaborate? I’m not aware of this. There was one very specific change related to relative aliases in server.json , but that’s not a regression, it was on purpose and there is a very simple fix to get your JSON squared away.

I need to recreate the issue with version 6 but it was keeping me from being able to develop the branch I was working on so I had to stop using it for now. I intend to make a post about it when I have the chance but from what I remember it was an ajax call that either was appending a / at the beginning or not appending a / at the beginning. I was able to narrow it down to 6.0 upgrade though. Hopefully I have some time this week.