ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Unable to start oneclick tomcat after upgrading to Spectrum 21.2.4 due to corruption in catalina.sh

book

Article ID: 226661

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

After the upgrade of Spectrum OneClick server from 10.4.3  to NetOps 21.2.4 spectrum tomcat is failing to start with the following error:

/apps/CA/Spectrum/tomcat/bin/catalina.sh: eval: line 371: syntax error near unexpected token `1'
/apps/CA/Spectrum/tomcat/bin/catalina.sh: eval: line 371: `exec "/apps/CA/Spectrum/Java/bin/java" "-Djava.util.logging.config.file=/apps/CA/Spectrum/tomcat/conf/logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -DOneClick -server -Xmx<script>alert(1)</script>M -Xms4096M -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:MaxGCPauseMillis=800 -XX:SurvivorRatio=8 -Dsun.net.inetaddr.ttl=60 -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djavax.net.ssl.trustStore=/apps/CA/Spectrum/custom/keystore/cacerts -Dfile.encoding=UTF-8 -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Djava.endorsed.dirs="/apps/CA/Spectrum/tomcat/lib/endorsed" -classpath ":/apps/CA/Spectrum/tomcat/lib/mail.jar:/apps/CA/Spectrum/tomcat/bin/bootstrap.jar:/apps/CA/Spectrum/tomcat/bin/tomcat-juli.jar:/apps/CA/Spectrum/tomcat/classes" -Dcatalina.base="/apps/CA/Spectrum/tomcat" -Dcatalina.home="/apps/CA/Spectrum/tomcat" -Djava.io.tmpdir="/apps/CA/Spectrum/tomcat/temp" -Djava.library.path=/opt/SPECTRUM/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib:/apps/CA/Spectrum/tomcat/bin org.apache.catalina.startup.Bootstrap start'

Cause

The upgrade corrupted the catalina.sh JAVA_OPTS variable

JAVA_OPTS="-DOneClick -server -Xmx<script>alert(1)</script>M -Xms4096M -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:MaxGCPauseMillis=800 -XX:SurvivorRatio=8 -Dsun.net.inetaddr.ttl=60 -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djavax.net.ssl.trustStore=$SPECROOT/custom/keystore/cacerts -Dfile.encoding=UTF-8 -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true"

Environment

Release : 21.2.4

Component :

Resolution

Remove the garbage from the JAVA_OPTS setting in the catalina.sh and specify the correct -Xmx value.

eg.

 JAVA_OPTS="-DOneClick -server -Xmx8096M -Xms4096M -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:MaxGCPauseMillis=800 -XX:SurvivorRatio=8 -Dsun.net.inetaddr.ttl=60 -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djavax.net.ssl.trustStore=$SPECROOT/custom/keystore/cacerts -Dfile.encoding=UTF-8 -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true"