Stack:
Ubuntu 22.04 LTS
Java (JDK) 20.0.2
Tomcat 9.0.83
Lucee 6.1.0.243
Apache 2.4.52
MySQL 8.0.41
Thank you to the Lucee team BTW for their continued work on Lucee and CF. I’m an older dev with some legacy code that I’ve been able to maintain quite easily with Lucee.
However, I noticed a problem today and it’s embarrassing because it involves a back up process that I didn’t check on and it hasn’t been running.
I use this line to kick off a shell script to back up some databases.
<cfexecute name="bash" arguments="/opt/mysqlbackups.sh #databaseName#" timeout="2400" variable="standardOut" errorVariable="returnedError"></cfexecute>
alternately, I could also use:
<cfscript>
cfexecute( name="bash" arguments="/opt/mysqlbackups.sh #databaseName#", variable="standardOut" , errorVariable="returnedError" , timeout="2400");
</cfscript>
Either way will (or did) work. Been simple and error free for years.
On October 27, 2024, I updated Lucee from 6.x to 6.1.x and that is also the last date that the MySQL backups which this particular script calls worked. No backup files were created after that date. And the relevant updated Lucee directory files are also dated October 27.
After that, the code no longer works, and I get this erorr:
java.io.IOException: Cannot run program "bash": error=13, Permission denied
Even when I simply try to call bash and not a script, I get the same problem (specifying path to bash in this example):
<cfexecute name="/usr/bin/bash" arguments="which bash" timeout="2400" variable="standardOut" errorVariable="returnedError"></cfexecute>
Results in:
java.io.IOException: Cannot run program "/usr/bin/bash": error=13, Permission denied
Today I have checked everything I can think of to solve this.
- file permissions and ownership on shell script - correct (tomcat:tomcat) and 0750 plus the .sh file is executable
- directory permissions and ownership for target files - correct
- test the shell script from the command line - yes and works perfectly
This feels like deja vu from a time long ago, but I cannot figure out what is causing Lucee to think it no longer has permission to hand this off to bash.
After checking another shell script that CFEXECUTE uses (related to Imagemagick), same problem. CFEXECUTE will not run these shell scripts anymore. Permissions for bash and for the scripts are correct.