Maven deployment plugin error

agupta267
Participant III

I am doing the deployment using apigee maven plugin and I can see previous revision is NOT undeployed and a new revision is deployed on top of it making more than one revision deployed for same basepath at the same time. I am just doing deployment and not the build. (attached resources for reference)

Tried both commands mentioned below but encountering same issue :

mvn apigee-enterprise:deploy -Dapigee.options=override -Dorg=**** -Dusername=*** -Dpassword=*** -Denv=dev -Dhosturl=*** -Dhosturlversion=v1 -P deployonly

mvn install -Dapigee.options=override -Dorg=**** -Dusername=*** -Dpassword=*** -Denv=dev -Dhosturl=*** -Dhosturlversion=v1 -P deployonly

parent-apiproxy-pom.zip output-mavencommand.txt edgesnapshotwithmultiplerevisionsdeployed.png

0 7 341
7 REPLIES 7

agupta267
Participant III

@Sai Saran Vaidyanathan , please help.

sidd-harth
Participant V

Hi @Apoorva, apigee.options is the variable which decides the Deployment of Proxy.

In your mvn cmd you are using -Dapigee.options=override, which deploys proxy to new-revision.

Try using `-Dapigee.options=update`, it will deploys to existing revision.

Deployment options -
Override – deploys to new-revision
Update – deploys to existing revision
Inactive – uploads bundle but NOT deployed to env

Hi @Siddharth Barahalikar, I don't want to update the proxy on same revision. I need new revision. The issue I am facing is previous revision is not getting undeployed.

Hello @Apoorva

I think the issue is that you are not specifying a VirtualHost in your proxy configuration, hence the "n/a" in screen shot for the proxy URL.

I've been able to reproduce your issue by commenting out my VirtualHost setting, although I do get an error from mvn.

Try specifying

    <HTTPProxyConnection>
        <BasePath>/pingstatus/v1</BasePath>
        <Properties/>
        <VirtualHost>default</VirtualHost>
    </HTTPProxyConnection>

Also, if you omit `-Dapigee.options` all together, the default behavior is to create a new revision.

Hi @Kurt Googler Kanaskie, that is right. I am facing the issue with the proxies wherein VirtualHost is not specified. I have not specified the VH as I am calling this proxy only from another proxy as LocalTargetConnection.

Ah, I had not considered that, interesting.

After a few experiments I get an error when using:

-Dapigee.options=override -Dapigee.override.delay=3

And that's when I see multiple deployments.

The use of override is to support seamless deployment (zero downtime). It effectively deploys the new proxy, then gets the previous deployment and undeploys that after delay seconds. Apparently that doesn't work when there is no VirtualHost specified.

The workaround is to omit those options all together and/or remove the settings from pom profile.

Again, the default behavior is to create a new revision and deploy it.

Thanks @Kurt Googler Kanaskie, it worked.