CFConfig 1.10.6 complaining about DBDRIVER key

After upgrading CFConfig to yesterday’s 1.10.6 release, one of our servers is no longer importing .cfconfig.json properly but complains about a missing DBDRIVER key:

× | Starting Server
   |------------------------------
   | start server in - /opt/staging/
   | server name - staging
   | server config file - /opt/staging/server.json
   | Contacting ForgeBox to determine the latest & greatest version of [lucee 5.3.8]...  Use an exact 'cfengine' version to skip this check.
   | OK, [lucee 5.3.8+206] it is!
   | WAR/zip archive already installed.
   |------------------------------
   | √ | Setting Server Profile to [development]
   |   |------------------------------------------------------
   |   | Profile set from server bound to localhost
   |   | Block CF Admin disabled
   |   | Block Sensitive Paths enabled
   |   | Block Flash Remoting enabled
   |   | Directory Browsing enabled
   |   | File Caching disabled
   |   |------------------------------------------------------
   | × | Loading CFConfig into server
   |   | > key [DBDRIVER] doesn't exist
   |   |-------------------------------------------
   |   | Found CFConfig JSON in "CFConfig.file" server.json key.
   |   | Importing luceeserver config from [/opt/staging/.cfconfig.json]
   |   | Config transferred from /opt/staging/.cfconfig.json!
   |   |-------------------------------------------



ERROR (5.9.0+00721)

key [DBDRIVER] doesn't exist


/root/.CommandBox/cfml/modules/commandbox-cfconfig/modules/cfconfig-services/models/BaseLucee.cfc: line 265
263: 			if( !isNull( params[ 'bundle-version' ] ) ) { params[ 'bundleVersion' ] = params[ 'bundle-version' ]; }
264: 			// If we look to be using an Oracle service name, extract that.
265: 			if( params.dbdriver == 'oracle' && params.dsn.listLen( '/' ) > 1 ) {
266: 				params[ 'serviceName' ] = params.dsn.listLast( '/' )
267: 			}

The .cfconfig.json file defines only one datasource (shortened for clarity):

"datasources":{
"preside":{
            "class":"org.gjt.mm.mysql.Driver",
            "dbdriver":"mysql",
            "custom":"useUnicode=true&characterEncoding=UTF-8",
            "database":"staging",
}
}

Any idea what’s going wrong here?

Quick update: Asking Commandbox to forget the server and recreating it afterwards solved this issue.

Sorry for the error-- this line of code was related to a recent fix I added to CFConfig to support SID and service name in CFConfig. I thought for certain Lucee ALWAYS had the dbdriver key defined in its datasources (and it worked in my testing), but I guess not. I’m pushing a small fix that checks for that key before attempting to use it.

1 Like

Brad, just FYI, I’m trying to get going on Commandbox, Lucee and Docker. I picked up the latest ortussolutions/commandbox:latest image (5 days ago) and I’m getting this error trying to define a MySQL (MariaDB) setup via cfconfig. I can create a pared down .zip file to illustrate if needed, but I suspect something just might be out of date with the image? If so, is there an easy recommendation to solve this issue?

It’s possible one of our Docker builds happened to grab a version of CFConfig with the bug. I’m not sure. I would make sure you’ve pulled the Docker image, and if you still get it, add a

box update --system

to your image build to update to the latest CFConfig.

Well, derp. It was a simple as adding that to the cfconfig.datasources[myDSN] values. Derp-y do. Heh. Of course I figure it out RIGHT after I break down and post on it.

1 Like

Well, I was wrong earlier, I have NOT gotten it to work, just not to fail that same way. Currently, I’m not getting any errors, but I’m also getting no datasources. I’ll keep plugging at it. I’m still mastering docker.

Once I finally got a terminal inside the container, and did the box update --system I see there’s a lot of updates (9 of them). But the docker image I’m using now is whatever ortussolutions/commandbox:lucee5 and I suspect it was one of the many that was updated just 2 days ago. So, question: When new docker images are being built, do the update --system command not get run inside before pushing to Docker Hub? (I’m sure that’s a Jon question.)

I started watching your 2017 video (Brad) on docker and cfconfig. How would I go about running the update command in an automatic way, before the cfconfig.json gets applied?

I’d like to add that I VERY much liked the “pet vs. cattle” concept. That is a great way to think of containers. (Hence my question about “how do I do this automated?”.)

Also, two weird things. Doing cfconfig export both my test datasources come out in the .json, but don’t show up in the server admin. And, unsure why, but my password doesn’t work on the web admin, only the server admin. Pretty sure it worked on both earlier, because I kept checking both for the datasources to be present.

Alright, it’s fixed.

  • Updated cfconfig (had to do install commandbox-cfconfig --force because v~1+ to v~2+, --update didn’t do it)
  • Went into Lucee admin, manually created the datasource
  • Used cfconfig export to=/app/updated-config.json to get whatever Lucee / cfconfig sees
  • Copied the datasource definition over to my cfconfig.json file.
    Unfortunately, still have the web admin password issue. Time for a new thread!