CommandBox Docker Lucee Extensions

I installed what I think is a pretty default setup using docker and the CommandBox container, got the ENV password for the admin to finally work, and went to update some extensions but was greeted with a “Connection Failure” error.

Does anyone know the cause or where this might have been logged to see what the problem might be?

You should share the Dockerfile to take a look.

Does your container have outside internet access? Also, what did you see in the Lucee logs when you checked there?

The container does have internet access., I can ping & curl to the Lucee provider url of http://extension.lucee.org
I would check the lucee logs, but I’m not totally sure where those specific logs would get written to.
If it’s /usr/local/lib/serverHome/WEB-INF/lucee-server/context/logs/ or lucee-web/ then those were pretty much empty.

I would share a Dockerfile if I knew exactly what that was, I’m using the container from https://hub.docker.com/r/ortussolutions/commandbox/ with /app mounted
Speaking of, does the container not look for the server.json in /app? I tried to change the “app”:{“cfengine”:“lucee@=5.3.6.61”} key, thinking maybe the default lucee version is too old, and it has no effect

I don’t think Docker really has anything to do at all with your connection failure message. That just sounds like you have a networking issue or a server is down.

The docker image does look at the server.json, but it gives precedence to any cfengine env var AND if your image is already warmed up with other cf engine, it will not overwrite. Use a debug start to see exactly what is going on when you start the server in the console logs…

Some good news? I couldn’t get debug to work, wasn’t sure where that output was going. I nuked the container to start over.
I was able to change the cfengine by using “box server set app.cfengine=lucee@5.3.3+62” from the /app directory and that seems to have worked. Editing /app/server.json in a text editor has no effect. Not sure how this makes sense.

I still get a connection error trying to update extensions or update lucee through the Lucee admin, but with a stack trace this time.

I couldn’t get debug to work,

You gotta give us more than that. Exactly what did you do to try and enable the debug start? What happened when you tried? Where did you look for output? I can assure you debug starts do work, but we can’t help you unless we know what it is you’re doing.

wasn’t sure where that output was going

It’s just the console log of the container. Where this output is visible depends on how you’re starting your container.

I was able to change the cfengine by using “box server set app.cfengine=lucee@5.3.3+62” from the /app directory and that seems to have worked.

Yes, that would support my suggestion that you had already started another cf engine version in your container.

Editing /app/server.json in a text editor has no effect.

I don’t understand what you mean. What exactly did you edit and what exact effect were you expecting to see? What steps did you take to enact this expected effect?

I still get a connection error trying to update extensions or update lucee through the Lucee admin, but with a stack trace this time.

What exact page in the admin were you on and what exact button did you click?

I couldn’t get debug to work,

You gotta give us more than that. Exactly what did you do to try and enable the debug start? What happened when you tried? Where did you look for output? I can assure you debug starts do work, but we can’t help you unless we know what it is you’re doing.

First I tried adding “debug”:“true” to /app/server.json

wasn’t sure where that output was going

It’s just the console log of the container. Where this output is visible depends on how you’re starting your container.

Then I tried running “box server set debug=true” from the console, it says it was set to true, and I see normal Lucee outout in the container console, but I’m unsure if this actually worked.

I was able to change the cfengine by using “box server set app.cfengine=lucee@5.3.3+62” from the /app directory and that seems to have worked.

Yes, that would support my suggestion that you had already started another cf engine version in your container.

Editing /app/server.json in a text editor has no effect.

I don’t understand what you mean. What exactly did you edit and what exact effect were you expecting to see? What steps did you take to enact this expected effect?

I edited the server.json, changing the cfengine value, in the mounted /app volume. Then from inside the container console I did “box restart” (which restarts the container?), and any changes I made to /app/server.json has no effect on the restarted server.
I figured if there was a mounted /app volume, server.json, box.json would be priority #1. If I search the container for server.json the only other result is: /usr/local/lib/CommandBox/cfml/modules/commandbox-cfconfig/modules/cfconfig-services/server.json

From the path, I would think that’s an internal CommandBox or cfconfig file, nothing to do with ‘my’ app or server. Am I wrong?

I still get a connection error trying to update extensions or update lucee through the Lucee admin, but with a stack trace this time.

What exact page in the admin were you on and what exact button did you click?

The location & actions are navigate the url to /lucee/admin/server.cfm?action=ext.applications or from the Lucee server admin click Extensions > Applications.
Pick an outdated extension, the mssql driver in my example, select the latest release from the dropdown, then click the “upgrade / downgrade” button.
Then the error appears.

First I tried adding “debug”:“true” to /app/server.json

That used to work, and IMO it still should work. However, I think Jon made changes in a recent release of the docker image that broke that. Use the DEBUG env var to start the server in debug mode.

Then I tried running “box server set debug=true” from the console,

This is no different than your first test. All the “server set” command does is edit the server.json file for you

Then from inside the container console I did “box restart” (which restarts the container?)

In my experience, running box restart from inside a container does not work. You need to restart the actual container using the docker CLI commands.I think it’s related to the fact that the container itself is tied to the actual server process that is started when the container starts.

I figured if there was a mounted /app volume, server.json, box.json would be priority #1.

I assume you meant server.json instead of box.json, but no that is not necessarily the case. When you start a container …

  1. If there is a cfengine that has already been started at any prior time and is stored on disk in the custom server home, it will be reused regardless of what changes you may have made. You need to destroy the container and start fresh to get a new engine.
  2. If there is no server that has ever been started, the CFENGINE environment variable will get precedence and be used if it exists
  3. If there is no server started and no cfengine env var and there is an app.cfengine in a server.json file, then that will be used
  4. If none of the above are true, you just get the default Lucee version that is bundled in CommandBox.

click the “upgrade / downgrade” button. Then the error appears.

I just tested this by upgrading the PDF extension on a Lucee 5.3.6 server that I have running and it worked with no errors. I’d check your network settings.

For your 1 through 4 to see where CFENGINE will be picked up from, if I were following the docs and typed:
“docker run -p 8080:8080 -p 8443:8443 -e “PORT=80” -e “SSL_PORT=443” -v “/path/to/your/app:/app” ortussolutions/commandbox”
where /app is mounted to a real location… what happens if there is no server.json there? or what if a server.json exists there?

what happens if there is no server.json there?

#4 would happen

what if a server.json exists there

#3 would happen

Of course, that’s assuming this is a fresh image, and not re-using a previously started container that’s cached in your local docker.

Thanks Brad