Standard Output includes VF Agent Configuration Details when saving Standard Output



Overview of the Issue

This issue occurs in the following circumstances:

  1. An organization saves the Standard Output from a Java Process to use for a function. For example:
INPUT_PAT_ORIGINAL=$(${JAVACMD} ${JAVAOPTS} com.organization.batch.job.1 ${DBUSER} ${DBPASS} ${DBNAME} task.dat_cust_name download true)
#remove warning
INPUT_PAT=${INPUT_PAT_ORIGINAL#WARNING:}
LIST=($INPUT_PAT)

for i in "${LIST[@]}"
  do
    i=`basename $i`
    echo processing $i
    ${JAVACMD} ${JAVAOPTS}  com.organization.batch.job.2 ${DBUSER} ${DBPASS} ${DBNAME} download/$i logs/${LOGFILE}
  done
  1. After adding the vFunction Agent to the Application’s Java Options, the Standard Output includes a list of vFunction Agent Configuration Parameters which yield unexpected results to the original function. In the example below, the, “input file…download/native” and the, “processing agent” are unexpected results of the vFunction Agent printing Configuration Information to the Standard Output:
org_uat 08/20/2024 08:53:34 INFO : batch.1 successfully started.
org_uat 08/20/2024 08:53:36 INFO : Start time Tue Aug 20 08:53:36 CDT 2024
org_uat 08/20/2024 08:53:36 INFO : Procbatch.1 Constructor initalized.
org_uat 08/20/2024 08:53:36 INFO : Reading input file...download/native
org_uat 08/20/2024 08:53:36 INFO : download/native does not exists! Trying to get next file...
org_uat 08/20/2024 08:53:36 INFO : End time Tue Aug 20 08:53:36 CDT 2024
org_uat 08/20/2024 08:53:36 INFO : batch.1 successfully ended.
processing agent

Steps to Resolve the Issue

This issue can be resolved by taking the following steps:

  1. Download vFunction Controller version 3.7 and later
  2. Move the Controller TGZ to the machine running the JVM
  3. SSH to the location where the “vfunction” directory was created below the Base Directory
  4. Unpack the Controller TGZ
  • Find-and-replace $VERSION with the correct value, such as 3.7.1497
tar -xvzf vfunction-controller-sudo-less-installation.v$VERSION.tgz
  1. Upgrade the Controller version
  • Find-and-replace $INSTANCE_NAME with the correct value, such as default-java
bash vfunction/opt/vfunction/controller-installation/upgrade.sh -i $INSTANCE_NAME
  1. Modify the native-conf.json for the instance to disable console logging
  • Find-and-replace $BASE_DIR with the correct value, such as /tmp
  • Find-and-replace $INSTANCE_NAME with the correct value, such as default-java
vi $BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/$INSTANCE_NAME/native-conf.json

### Default value before file change with value commented out
"#disable_console_logging": true,

### Change that needs to be made with value uncommented
"disable_console_logging": true,
  1. Add a Java Option to the existing JVM parameters that turns the Console Logging Level to Off
### Flag that needs to be added
com.vfunction.logging.console.level=OFF

### Sample JVM parameters with flag added
-agentpath:/tmp/vfunction/opt/vfunction/agent/libJVMTIAgent.so=conf=/tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/native-conf.json -javaagent:/tmp/vfunction/opt/vfunction/agent/runtime-agent.jar=ConfigLocation=/tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vfunction-runtime-override.properties -Dcom.vfunction.runtime.shared.folder=/tmp/vfunction/opt/vfunction/controller/instances/default-java/temp/ -Dcom.vfunction.runtime.offload.tmpFolder=/tmp/vfunction/opt/vfunction/agent/instances/default-java/temp/ -Dcom.vfunction.logging.logFile=/tmp/vfunction/var/log/vfunction/instances/default-java/vfagent.log -Dcom.vfunction.logging.console.level=OFF
  1. Restart the JVM to allow the JVM to pick up the new vFunction Agent version and parameter changes

Alternative Workaround

This issue can be worked around by taking the following steps:

  1. Modify the script to create Java Options that do not include the vFunction Agent when saving the Standard Output for later processing. For example:
INPUT_PAT_ORIGINAL=$(${JAVACMD} ${JAVAOPTS_without_vFunction} com.organization.batch.job.1 ${DBUSER} ${DBPASS} ${DBNAME} task.dat_cust_name download true)
#remove warning
INPUT_PAT=${INPUT_PAT_ORIGINAL#WARNING:}
LIST=($INPUT_PAT)
  1. Modify the script to create Java Options that include the vFunction Agent when the Standard Output is not being saved. For example:
for i in "${LIST[@]}"
  do
    i=`basename $i`
    echo processing $i
    ${JAVACMD} ${JAVAOPTS_with_vfunction}  com.organization.batch.job.2 ${DBUSER} ${DBPASS} ${DBNAME} download/$i logs/${LOGFILE}
  done
  1. Restart the Application