Sample XML Deploy failed with status 400

Not applicable

Hi I am trying out the tutorial at

http://apigee.com/docs/api-services/tutorials/part-3-use-xml-samples-and-deployment-tools . At step 2.4 my deployment fails with status 400.

Here is the log:

Enter your password for the Apigee Enterprise organization zzz, followed by[ENTER]:
Deploying to test on https://api.enterprise.apigee.com using zzz@zzz.com and zzz
Writing ../conditional-policy\deploy.sh to .\deploy.sh
Writing ../conditional-policy\invoke.sh to .\invoke.sh
Writing ../conditional-policy\README.md to .\README.md
Writing ../conditional-policy\apiproxy\conditional-policy.xml to apiproxy\conditional-policy.xml
Writing ../conditional-policy\apiproxy\policies\Timer.xml to apiproxy\policies\Timer.xml
Writing ../conditional-policy\apiproxy\proxies\default.xml to apiproxy\proxies\default.xml

Writing ../conditional-policy\apiproxy\resources\py\timer to apiproxy\resources\py\timer
Writing ../conditional-policy\apiproxy\targets\default.xml to apiproxy\targets\default.xml

Imported new proxy version 3
Deploy failed with status 400:

If 'State: deployed', then your API Proxy is ready to be invoked.
Run 'invoke.sh'

I can manually deploy the proxy from the Management UI, but I am not able to figure out what is going wrong with me running the scripts.

Please help.

Solved Solved
0 4 354
1 ACCEPTED SOLUTION

I just took a look at this tutorial, and made a change to step 2.4 from:

$ deploy.sh

to:

$ sh deploy.sh

Please see if that helps.

Stephen

View solution in original post

4 REPLIES 4

Not applicable

Can someone please help me with this or atleast direct me to where I can see more detailed logs around why the deploy failed?

Not applicable

Couple of updates:

I tried deploying it directly through the deployments API and it worked. So very likely the issue is with the Python script deploy.sh.

Note, there is no additional details regarding the failure after the statement

Deploy failed with status 400:

Ideally there should be, as I found out from the script.

On a side note, there is a bug in the deployments API - or rather it does not handle an error condition - if I misspell the query parameter "action", it does not throw an error, it simply tries to deploy the workload.

@ritwik_chatterjee

It's been so long since you asked this question, I'm sure you're past the problem.

On the odd chance you're not past it, here's my reply.

Are you using a script that you obtained from a github repo?

Some of the scripts that are included with, or used by, the platform samples perhaps do not handle exception or error cases very thoroughly. I recall seeing, some time ago, one or two deploy.sh or deploy.py scripts that were basically just lists of curl commands with no error checking at all, and no option to emit or show the output of commands. I don't recall the repo.

I've since been using this tool, to deploy arbitrary API proxy bundles. It has a -v option, and also prints out the output of any curl command that unexpectedly returns a non-200 status. You might want to try this tool, too, if you just want to get past the deployment error.

If you'd like to improve things, please go to Github and raise an issue against the deploy.sh (or is it deploy.py - not sure, you mention "python" but you say "deploy.sh"). Report exactly what you see, and what you expect to see. Someone will attend to it.

I just took a look at this tutorial, and made a change to step 2.4 from:

$ deploy.sh

to:

$ sh deploy.sh

Please see if that helps.

Stephen