I am a bit frustrated. Usually we spin up our lucee servers in a commandbox environment, and since this is so easy most of the time we also use it in production. But upgrading these servers can be done in different ways.
Don’t use the admin
If you like to do this the oldfashioned way, you can open your lucee admin console, and use the update command. Please DON’T do this, it will get very messy soon. Let me show you. I start a lucee machine from the 5.3.5 range like this
Ok. Nothing wrong here, just the latest lucee 5.3.5 version. Now I go to the lucee admin, upgrade to a 22.214.171.124 version which is not to most recent version, but just a more recent one. When I restart lucee in commandbox, go the admin panel again and hit the update button it tells me I am here
So yes indeed. I am at 5.3.6.something, and let’s see what commandbox tells me:
So I am at 5.3.6 but commandbox tells me I am still at 5.3.5, and this is my server home:
This is kind of confusing, so probably updating from the lucee admin is not the best thing to do.
Use commandbox to start a lucee version
Let’s use a different method. I am telling commandbox I want a more recent version, for example 5.3.6. So I am starting my server from box with
Ok, so now I have a 5.3.6 version and it is really showing as 5.3.6+68. I can do a
server status --verbose and notice the Server home is at
So all looks good know, until you realise you loose all settings. But hey, thats why we have cfconfig. So before we update we save the old server config to a json file, do the update and restore the config. More or less like this.
cfconfig export oldconfig.json server stop server start cfengine=5.3.6 cfconfig import oldconfig.json server restart
There are more ways to achieve the same results, but at least we have our settings back and a server version in a descriptive server home dir. We still had some issues though since we installed a redis plugin with license file. This one was still in the old server config, so we had to move the license file to the same path in our new server home. No problem, we can manage that. But spoiler alert, this is still not the correct method.
Pin your Lucee server to an exact version
So our customer wanted a new version, 126.96.36.199. They didn’t want 188.8.131.52 yet so we started 184.108.40.206. Let’s have a look at the screenshot. And look carefully because this message will disappear soon
So lucee is telling me it is 220.127.116.11 and NOT 18.104.22.168. I was convinced this should give me the correct version, so I Checked The Fine Manual… and found almost nothing about the correct version, except this short snippet .
# Start a specific engine and version CommandBox> start firstname.lastname@example.org
Now I was convinced I found some stupid lucee bug so I asked on the always helpful slack channel. Things were even worse, since 22.214.171.124 was not even out when we issued our request for .47. So what really happened: In the middle of some innocent monthly midnight OS updates for 200 plus linux servers two of our lucee servers suddenly died with incorrect versions.
And yes. It is not a bug, according to this post we have to use the npm-flavoured semantic versioning which is documented at github . Not sure what this flavour means, but from the ortus post I realize i should use this
So please spot the difference. A plus instead of a dot. Of course I have seen this plus notation before. But it is not documented in the commandbox manual, not written down cleary in semver documentation and not even documented in the npm flavoured semver. For people not very initiated in semantic version it might not be obvious you can stick a build version behind a plus sign.
So how should I know? Maybe I should take a commandbox training in Munich….
What an amazing way to waste my afternoon 🙂 but glad I was educated by Brad Wood, Zac Spitzer and Pete Freitag. Thanks guys, at least now I understand this plus sign.