jenkins pipeline issue - Apigee network call error Unable to tunnel through proxy

Hello,

I am creating a jenkins pipeline job to deploy only config changes on apigee. Another jenkins maven job is successfully deploying the config changes in apigee but jenkins pipeline job is giving the below error.

Any help would be appreciated.

maven command -

mvn -B -f "$WORKSPACE/${APINAME}/pom.xml" -B -X -Papixstaging-staging -e clean install apigee-config:apiproducts apigee-config:developers apigee-config:apps apigee-config:maskconfigs -Dapigee.config.options=update -Dusername=xxxxxxxx -Dpassword=****

Error :-

[ERROR] Failed to execute goal com.apigee.edge.config:apigee-config-maven-plugin:1.1.4:keyvaluemaps (create-config-kvm) on project APIXOAuth2Password: Apigee network call error Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden" -> [Help 1]
<br>
0 7 1,299
7 REPLIES 7

@kailash joshi - as the output explains - looks like there is a proxy through which you will need to make the maven calls. Please check if there is any configuration on the other Jenkins setup to bypass that. If there is, you will need to do the same here as well.

Hello Sai,

Thanks for the answer. Actually both the jobs are in same jenkins. Maven job is working fine but pipeline job is giving the error. I am trying to bypass the proxy in pipeline job but still no success.

@ Joshi,

1) Is your jobs running on the same slave? If not, check the slave settings and configure maven settings in it.

2) check whether the proxy configuration is duplicated.

3) check manually from the slave machine, whether you are able to reach apigee or not?

With this, I hope you will get the answer.

Cheers 🙂

Hello Balu,

Thanks for the reply.

Jobs are on the same slave.

Below is the error. From the slave command line I am able to curl the below URL

GET  https://mselb.staging.api.xxxxx.services:8443/v1/organizations/apixstaging/environments/staging/cach...

but when maven runs below is the error.

[ERROR] Failed to execute goal com.apigee.edge.config:apigee-config-maven-plugin:1.1.4:caches (create-config-cache) on project SubscriptionProfile2: Apigee network call error Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden" -> [Help 1]

@Joshi, I am suspecting that it is a plugin issue, Can you upgrade plugin to 1.2.1 and try?

Even i faced similar issue, after upgrade it works fine:)

Hello Balu,

Thanks for the reply.

I updated the plugin but same issue. Below are my pipeline contents.

withCredentials([string(credentialsId: 'bdfc857b-0fd1-4c07-beb3-5f0e06b900e0', variable: 'EDGE_PASS')]) { withMaven(maven: 'M3', mavenOpts: '-Dapigee.config.options=update -Dusername=xxxx -Dpassword=$EDGE_PASS') { sh """ set +e -xv cd "${APINAME}"/config/apixstaging-staging ls echo 'Changing the values' sed -i -e '/THROTTLING_SPIKE_ARREST_RATE/s/[[:digit:]]\\{1,6\\}/99999/g' edge.json sed -i -e '/THROTTLING_QUOTA_1MIN_COUNT/s/\\:[[:digit:]]\\{1,6\\}/\\:99999/g' edge.json sed -i -e '/THROTTLING_QUOTA_5MIN_COUNT/s/\\:[[:digit:]]\\{1,6\\}/\\:99999/g' edge.json sed -i -e '/THROTTLING_QUOTA_RESOURCE_COUNT/s/[[:digit:]][[:digit:]]\\{2,6\\}/99999/g' edge.json echo "done" > "${custompath}"/mainapi.txt cd $WORKSPACE/$APINAME cp config/apixstaging-staging/*.json . cp -f $HOME/parent-pom.xml ../CommonProxy/pom.xml export NO_PROXY=mselb.staging.api.xxxx.services export http_proxy='' export https_proxy='' java -Dapigee.config.options=update -Dusername=xxxx -Dpassword=$EDGE_PASS -cp /opt/SP/apigee/jenkins/maven35-agent.jar:/opt/SP/apigee/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3/boot/plexus-classworlds-2.5.2.jar:/opt/SP/apigee/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3/conf/logging jenkins.maven3.agent.Maven35Main /opt/SP/apigee/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3 /opt/SP/apigee/jenkins/slave.jar /opt/SP/apigee/jenkins/maven35-interceptor.jar /opt/SP/apigee/jenkins/maven3-interceptor-commons.jar mvn -B -f "$WORKSPACE/${APINAME}/pom.xml" -B -X -Papixstaging-staging -e clean install apigee-config:apiproducts apigee-config:developers apigee-config:apps apigee-config:maskconfigs -Dapigee.config.options=update -Dusername=xxxx -Dpassword=****

Thanks.

Hello Balu/Sai,

Issue is resolved I was a silly mistake.

maven command was not taking the env variables so I explicitly passed them before the command.

export JAVA_OPTS="-Dhttp.proxyHost=xxxxx -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts="xxxx127.0.0.1|localhost|100.66.24.75|100.66.24.85|100.66.24.13|ip-100-66-24-13.eu-central-1.compute.internal" -Dhttps.proxyHost=xxxx -Dhttps.proxyPort=3128" export MAVEN_OPTS="-Dapigee.config.options=none -Dusername=xxxx -Dpassword=$EDGE_PASS"

Thanks for the help.