In my previous blog named “Changing Fusion Middleware repository database“, I explained how to move a Fusion Middleware repository database from one host to a new host. During the run of this exercise, I came over an issue with the chghost.sh script failing to start the WebLogic Administration Server with the following error:

Aug 10, 2023 3:53:47 AM oracle.glcm.fmw.chghost.framework.plugin.impl.t2p.T2PPluginExecutorImpl startAdminServer
INFO: /u02/weblogic/config/12c/domains/fr-domain  ias_admin  password : *** srv-linux-wls1.it.dbi-services.com  7001  /u00/app/weblogic/12cR4/Middleware
java.io.IOException: Cannot run program "/tmp/CLONINGCLIENT2006552337794141616/coredb_start_script1691632427319.sh": error=13, Permission denied
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:423)
        at java.lang.Runtime.exec(Runtime.java:320)
        at oracle.as.t2p.sdk.util.CommandInvokationUtil$ThreadDaemon.run(CommandInvokationUtil.java:259)
        at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.IOException: error=13, Permission denied
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 5 more
java.io.IOException: Cannot run program "/tmp/CLONINGCLIENT2006552337794141616/coredb_admin_pid_script1691632427336.sh": error=13, Permission denied
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:593)
        at java.lang.Runtime.exec(Runtime.java:423)
        at java.lang.Runtime.exec(Runtime.java:320)
        at oracle.as.t2p.sdk.util.CommandInvokationUtil$ThreadDaemon.run(CommandInvokationUtil.java:259)
        at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.IOException: error=13, Permission denied
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 5 more

Investigating on the error, I find out that the chghost.sh script writes some scripts in the /tmp folder and execute them to start the WebLogic Administration Server. This fails because the tmp file system was mounted with the noexec flag for security reasons. When it comes to security reasons, it is very difficult to change the systems configuration. I took me some time to found the solution and thought it would be helpful for others if I publish it in a blog.

The workaround is to set the “java.io.tmpdir” in the chghost.sh environment as follow:

export CHGHOST_JAVA_OPTIONS="-Djava.io.tmpdir=/u01/app/oracle/tmp/”  

After setting this variable, the chghost tool will use the new tmp directory to run the scripts generated to start the WebLogic Admin Server.

The other problem encountered was that the chghost tool was not able to connect to an SSL enabled port. I had to enable the http port 7001 during the run of the tool.