Getting error while trying multiple proxy deployment using maven plugin

Not applicable

Hi Team,

We are trying to deploy multiple api proxy using maven plugin through jenkins (not working even with direct maven command).

We have created a folder structure as suggested in the Apigee Edge Maven Plugin and Apigee Grass project on github.

We have created all the POM file as per the grass project, but still not able to deploy the API proxy.

I am attaching the API proxy bundle and the error message as well. Please have a look and suggest if we are doing sth wrong.

@Prashanth Subrahmanyam, can you please take a look into this? @raghavendran.venkateswaran

apigeehome2.zip

build32-oneparentpom.txt

0 7 746
7 REPLIES 7

@Vipul Agarwal , On a separate note, take a look at this tool (apigeedm) built on top of apigeetool to deploy mutiple proxies at one go.

@Vipul Agarwal

The deployment request fails because the bundle is invalid or it has been incorrectly constructed.

08:45:49,889 ERROR RestUtil:361 - 400 Bad Request { "code" : "messaging.config.beans.InvalidBundle", "message" : "Bundle is invalid. Unable to read/find APIProxy contents", "contexts" : [ ] }

I tried deploying the same bundle in the cloud and get the same error. When I examined the bundle, I see that the proxy xml - for one thing - has been incorrectly constructed.

For eg. if you look at : MavenPlugin-Test.xml

It indicates that there are no policies :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <APIProxy revision="1" name="MavenPlugin-Test"> <ConfigurationVersion majorVersion="4" minorVersion="0"/> <CreatedAt>1461577127892</CreatedAt> <CreatedBy>defaultUser</CreatedBy> <Description>MavenTest1</Description> <DisplayName>MavenPluginTest</DisplayName> <LastModifiedAt>1461577127892</LastModifiedAt> <LastModifiedBy>defaultUser</LastModifiedBy> <Policies/> <ProxyEndpoints> <ProxyEndpoint>default</ProxyEndpoint> </ProxyEndpoints> <Resources/> <TargetServers/> <TargetEndpoints> <TargetEndpoint>default</TargetEndpoint> </TargetEndpoints> </APIProxy>

However, the policies folder has a assign message policy xml - which should have ideally been listed in the proxy xml above.

It's not so much the folder structure, but the contents that look incorrect. How were the proxies created?

@Venkataraghavan : I have corrected the code.

But even after that I am getting the same error.

Request prepared for the server 
 **************************
POST  https://api.enterprise.apigee.com/v1/organizations/demo34/apis?action=import&name=parent-pom
accept: application/json
accept-encoding: gzip
authorization: Basic [Not shown in log]
content-type: application/octet-stream
 [Request body contains data, not shown] 


[ERROR] 400 Bad Request
{
  "code" : "messaging.config.beans.InvalidBundle",
  "message" : "Bundle is invalid. Unable to read/find APIProxy contents",
  "contexts" : [ ]
}
[ERROR] 

From the error logs what I can see is it is trying to upload a bundle for parent-pom as well. I don't know why..

I am uploading a new bundle with the error logs.

Please have a look.apigeehome2.zip

log.txt

@Vipul Agarwal From which directory do you run the command?

@Vipul Agarwal - From your logs, I see the api name as parent-pom instead of the actual proxy name (mavenplugintest/mavenplugintest2)

Even from the log file attached, the app name is wrongly passed due to which it expects a project bundle with parent-pom as the name

[DEBUG] URL parameters API Versionv1
[DEBUG] URL parameters URL https://api.enterprise.apigee.com
[DEBUG] URL parameters Orgdemo34
[DEBUG] URL parameters App parent-pom

Please try as @swilliams suggested below and let us know if you still have issues

@Vipul Agarwal

First I checked to make sure that the bundles would import directly to the UI and those imported successfully.

Here is my maven command. Make sure to execute this from the /apigeehome2/src/gateway directory.

mvn install -Ptest -Dusername=username -Dpassword=password -Dorg=myorg -f parent-pom/pom.xml

Here are the results of my maven command.

....

[INFO]

Deployed revision is: 1

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] parent-pom ......................................... SUCCESS [ 1.047 s]

[INFO] mavenplugintest .................................... SUCCESS [ 5.878 s]

[INFO] mavenplugintest2 ................................... SUCCESS [ 3.380 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 10.416 s

[INFO] Finished at: 2016-05-23T17:00:56-05:00

[INFO] Final Memory: 13M/256M

[INFO] ------------------------------------------------------------------------

You can see from the screen shot that both proxies were imported successfully.

2749-screen-shot-2016-05-23-at-50658-pm.png

@swilliams

Thanks for the help. This command is working fine.

One thing I would like to say that I could not find this "-f " option in maven command anywhere in the GitHub documentation or anywhere else. If we have sth then please provide a link for the same.