apigee / apigee-deploy-maven-plugin

Apache License 2.0
80 stars 167 forks source link

Maven deployment failed: Jar file: edgemicro-auth proxy: "The revision is deployed, but traffic cannot flow" #155

Open vdineshTM opened 3 years ago

vdineshTM commented 3 years ago

We are trying to install MicroGateway. Out of box, edgemicro-auth proxy doesn't satisfy our business requirement. Hence we added extra policies and it was working fine.

To make production-ready, we created a repository for edgemicro-auth and tried to instal from Maven install command. edgemicro-auth deployment failed with Error in Apigee UI saying

"Error in deployment for environment dev. The revision is deployed, but traffic cannot flow"

Maven command failed with "Deployment failed: Bundle did not activate within the expected time. Please check deployment status manually before trying again "

We contacted the APIGEE support and they mentioned it is "steps.javacallout.JavaCalloutInstantiationFailed" from jar file(1)

If we manually upload the JAR file(1) from UI, the same deployment works fine.

Hence it is pointing to the problem in Maven deployment plugin.

APIGEE support can't investigate further as it is an open-source maven plugin issue.

Could you please help us to resolve the maven deployment error?

(1) The output of Jar file content.


├── META-INF
│   ├── MANIFEST.MF
│   └── maven
│   └── com.apigee.gateway
│   └── edge-micro-javacallout
│   ├── pom.properties
│   └── pom.xml
├── io
│   └── apigee
│   └── microgateway
│   └── javacallout
│   ├── Callout.class
│   └── Products.class
└── release.properties
ssvaidyanathan commented 3 years ago

@vdineshTM The above info is not enough to investigate. I have deployed many proxies that has a Java callout policy. For example check this repo. It has the jar file in the resources/java directory and is referenced by the policy. You can try that to see if it gets deployed.

If you still see issues, please run the mvn command with "-X" to get the debug output and please share that. Make sure when you are sharing, you redact all the sensitive information like Apigee org, username, password, token, etc

rad264 commented 3 years ago

I had the same or a very similar issue. Deployed with the plugin, the Maven command finished no problem, but in the Edge UI it said it failed to deploy with the same message. Called the management API to get more info and saw the same error: "steps.javacallout.JavaCalloutInstantiationFailed". If I updated the jar manually through the Edge UI, it deployed successfully.

In my case, it was because I had enabled filtering for the maven-resources-plugin (true) on the entire apiproxy folder, which included the jar. I guess it must have tried to filter the jar contents, and corrupted it, because once I disabled filtering, it deployed successfully.

It's unlikely this was the OP's exact issue, but thought I'd share in case anyone else happens to have a similar problem! Make sure nothing is potentially altering the jar in any way when copying or packaging the bundle! I'll stick to using config.json for substitutions, as recommended 😰