I have been banging my head against the wall for a few days nowβ¦
I am moving a few projects over to a new Mac (running Ventura 13.1). One of these sites uses cfconfig to set up a datasource, some mappings, and object cache. However, the config file does not get read and the server starts without these being created.
I have a file named serverConfig.json in the same folder as my server.json file and in server.json I have the following:
"cfconfig":{
"server":"./serverConfig.json"
}
This same configuration worked without issue on my Windows machine.
I have already made sure I do not have any duplicate server instances. I even uninstalled cfconfig and reinstalled, but the file is never read.
Playing with a few different configuration keys: cfconfig.file or CFConfigFile, just in case your CommandBox version is super old and doesnβt support cfconfig.server
Posting your CommandBox version.
Dropping the ./ from the file path.
Do server start --verbose and watch for any cfconfig output
Obligatory link to docs (Yes, you probably checked this already):
So right off, use the --verbose flag when starting your server. There is an entire CFConfig section in the output that tells you exactly what JSON files itβs loading (example below). And, like Michael said, make sure youβve got the latest version of everything.
I just tested this locally with these commands
β― echo {} > mySettings.json
β― server set cfconfig.server=mySettings.json
Set cfconfig.server = mySettings.json
β― server start --verbose
And I had the following output in the console
| |--------------------------------------------------------------
| β | Loading CFConfig into server
| |-------------------------------------------
| | Found CFConfig JSON in "CFConfig.server" server.json key.
| | Importing luceeserver config from [C:\Users\Brad\Desktop\sandbox\installtest\mySettings.json]
| | Config transferred from C:\Users\Brad\Desktop\sandbox\installtest\mySettings.json!
Hmm, based on that output, it would certainly appear CFConfig isnβt installed at all. Can you tell us about your setup? Is CommandBox running inside of a Docker container? A VM? Did you use the same user to run CommandBox when installing CFConfig as the user that is being used to start the server? For example
box foo
and
sudo box foo
Will create two CommandBox homes, one for root and one for your normal user. I would try running something like
cfconfig help
just to ensure the module is installed (you should get command help, not an error) and then also run
info
to confirm what user box is running as as well as the CommandBox home directory. Does it match the /private/var/root/.CommandBox/ path that the server is using (from your output above)?
Also, the CFConfig module should be installed under /private/var/root/.CommandBox/cfml/modules/commandbox-cfconfig. Make sure you installed commandbox-cfconfig and not the cfconfig services. You can also check what system modules are installed by running
list --system
and you should see something like (note, it starts with commandbox-cfconfig as the top-most item.