Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-1951

When the http.nonProxyHosts property value contains quotes they are not escaped properly and /opt/amq/bin/env reports syntax errors

XMLWordPrintable

    • 1
    • Compatibility/Configuration, User Experience
    • Hide
      Cause: NO_PROXY causes invalid syntax for /opt/amq/bin/env
      Consequence: AMQ6.3 fails to start with syntax error processing /opt/amq/bin/env when NO_PROXY set
      Fix: Properly escape quotes in nonHtppProxy value
      Result: AMQ6.3 starts correctly when NO_PROXY set
      Show
      Cause: NO_PROXY causes invalid syntax for /opt/amq/bin/env Consequence: AMQ6.3 fails to start with syntax error processing /opt/amq/bin/env when NO_PROXY set Fix: Properly escape quotes in nonHtppProxy value Result: AMQ6.3 starts correctly when NO_PROXY set
    • Workaround Exists
    • Hide

      Do another docker build on top of the provided image and overwriting the script proxy-options.

      Show
      Do another docker build on top of the provided image and overwriting the script proxy-options.
    • CLOUD Maintenance Sprint 11

      In upgrading OpenShift A-MQ Deployment to image amq63-openshift:10 from version 6.2 to 6.3, with 6.3, pods will not start and print the error

      ERROR: There are syntax errors in '/opt/amq/bin/env'

      Looking at this file, it contains jvm options that are generated by the launch.sh script:

      sh-4.2$ cat env
      ACTIVEMQ_OPTS=" -Xms1024m -Xmx1024m -XX:+UseParallelGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:ParallelGCThreads=1 -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -XX:CICompilerCount=2 -XX:+ExitOnOutOfMemoryError -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -Djava.security.egd=file:/dev/./urandom -Dhttps.proxyHost=172.21.9.152 -Dhttps.proxyPort=80 -Dhttp.proxyHost=172.21.9.152 -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=".cluster.local|172.22.0.1|172.22.240.36|host-dr-01.local.mydomain.com|host-dr-02.local.mydomain.com|host-drext-01.local.mydomain.com|host-drext-02.local.mydomain.com|host-es-01.local.mydomain.com|host-es-02.local.mydomain.com|host-es-03.local.mydomain.com|host-etcd-01.local.mydomain.com|host-etcd-02.local.mydomain.com|host-etcd-03.local.mydomain.com|host-master-01.local.mydomain.com|host-master-02.local.mydomain.com|host-node-01.local.mydomain.com|host-node-02.local.mydomain.com|host-node-03.local.mydomain.com|host-node-04.local.mydomain.com|host-node-05.local.mydomain.com|host-node-06.local.mydomain.com|host-pnode-01.local.mydomain.com|host-pnode-02.local.mydomain.com|host-pnode-03.local.mydomain.com|host-pnode-04.local.mydomain.com|host-pnode-05.local.mydomain.com|host-pnode-06.local.mydomain.com|local.mydomain.com|localhost|myd.com|myservices.org" "

      As you can see, the http.nonProxyHosts property value contains quotes, which should be escaped when used in a shell variable assignment, if the assignment itself is also inside quotes.

      I tracked the problem to the script /opt/run-java/proxy-options, where the nonProxyHosts are created with quotes. By adding another pair backslashes to escape the quotes when the variable is used, I was able to work around the problem.

      before (proxy-options line 45):
      ret="$ret -Dhttp.nonProxyHosts=\"$(echo $noProxy | sed -e 's+,+|+g')\""
      after:
      ret="$ret -Dhttp.nonProxyHosts=\\\"$(echo $noProxy | sed -e 's+,+|+g')\\\""

              wdecoste1@redhat.com William Decoste (Inactive)
              rhn-support-rkieley Roderick Kieley
              Pavel Drobek Pavel Drobek (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: