{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Faij Ahmad · Mar 08, 2018 at 10:44 AM · 94 Views java callout

Deploy failed with status 400

I am trying to deploy Java sample proxy but it always failed with status 400. Please let me know if i am missing some configuration.

Writing ../java-cookbook\buildsetup.sh to .\buildsetup.sh
Writing ../java-cookbook\deploy.sh to .\deploy.sh
Writing ../java-cookbook\invoke.sh to .\invoke.sh
Writing ../java-cookbook\README.md to .\README.md
Writing ../java-cookbook\apiproxy\java-cookbook.xml to apiproxy\java-cookbook.xml
Writing ../java-cookbook\apiproxy\policies\responseUppercase.xml to apiproxy\policies\responseUppercase.xml
Writing ../java-cookbook\apiproxy\proxies\default.xml to apiproxy\proxies\default.xml
Writing ../java-cookbook\apiproxy\resources\java\edge-custom-policy-java-cookbook.jar to apiproxy\resources\java\edge-custom-policy-java-cookbook.jar
Writing ../java-cookbook\apiproxy\resources\java\ResponseUppercase.jar to apiproxy\resources\java\ResponseUppercase.jar
Writing ../java-cookbook\apiproxy\targets\default.xml to apiproxy\targets\default.xml
Writing ../java-cookbook\callout\pom.xml to callout\pom.xml
Writing ../java-cookbook\callout\src\main\java\ResponseUppercase.java to callout\src\main\java\ResponseUppercase.java
Writing ../java-cookbook\callout\target\edge-custom-policy-java-cookbook.jar to callout\target\edge-custom-policy-java-cookbook.jar
Writing ../java-cookbook\callout\target\classes\com\apigeesample\ResponseUppercase.class to callout\target\classes\com\apigeesample\ResponseUppercase.class
Writing ../java-cookbook\callout\target\lib\commons-lang-2.6.jar to callout\target\lib\commons-lang-2.6.jar
Writing ../java-cookbook\callout\target\lib\expressions-1.0.0.jar to callout\target\lib\expressions-1.0.0.jar
Writing ../java-cookbook\callout\target\lib\message-flow-1.0.0.jar to callout\target\lib\message-flow-1.0.0.jar
Writing ../java-cookbook\callout\target\lib\slf4j-api-1.6.1.jar to callout\target\lib\slf4j-api-1.6.1.jar
Writing ../java-cookbook\javadocs-javacallout\README.md to javadocs-javacallout\README.md
Writing ../java-cookbook\lib\expressions-1.0.0.jar to lib\expressions-1.0.0.jar
Writing ../java-cookbook\lib\message-flow-1.0.0.jar to lib\message-flow-1.0.0.jar
Writing ../java-cookbook\lib\README.md to lib\README.md
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'



Comment
Add comment Show 1
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Faij Ahmad · Mar 08, 2018 at 10:45 AM 0
Link

I am using sample from this doc reference

https://docs.apigee.com/api-services/cookbook/use-java-customize-api#trythesample-deployandcalltheproxy

Close

1 Answer

  • Sort: 
avatar image
0

Answer by Dino-at-Google   · Mar 08, 2018 at 05:26 PM

Hi @Faij Ahmad -

unfortunately the log you've provided doesn't give a clear explanation of why the deployment failed.

Deploying from a command line tool involves sending a secured API request to the Administrative API for Apigee Edge. The log file indicates that Apigee Edge responded with a 400, which translates to "Bad Request". But the log file doesn't provide more information than that.

All we know is that the deployment failed.

One thing you can try - retry the deployment, using the Administrative UI. Login to your org via apigee.com, navigate to the proxy in question, then deploy it with the dropdown button. If that works, then you can conclude that the deployment problem was a transient one, an you can just continue working. If the deployment fails again, then there is something else going on, and I don't know how you could diagnose or troubleshoot it.

You can also try the deploy.sh script again, with shell-script tracing enabled. like this:

bash -x deploy.sh 

This won't fix the error, but it might give you more insight into what is happening when the error occurs.

Really I would like to see a curl -i output. I suppose that deploy script is doing a curl command to dpeloy the proxy, and I would like to see the exact payload of the 400 response being send back from apigee Edge. if you can edit the deploy.sh script to make that happen, it would be helpful .

Comment
Add comment Show 4 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Faij Ahmad · Mar 08, 2018 at 11:07 PM 0
Link

Yes. When i go back to apigee.com and try to deploy , it works fine. I tried again with

bash -x deploy.sh  

but same result. proxy is successfully imported with new version but deployment failed.

I will check what i can do with with deploy.sh to give more informatio about deployement error.

avatar image Faij Ahmad · Mar 08, 2018 at 11:28 PM 0
Link

One this i noticed that deployment path seems have basepath wrong showing as "C:/Program Files/Git"

/v1/organizations/xxxxxxx-eval/apis/java-cookbook/deployments?action=deploy&env=test&revision=7&basepath=C:/Program Files/Git

though the basepath in deploy.py is defined as BasePath = '/'

avatar image Dino-at-Google ♦♦ Faij Ahmad   · Mar 09, 2018 at 12:33 AM 0
Link

ahh, yes, good sleuthing ! That script is obviously not working properly on Windows. The basepath ought to be the basepath of the proxy itself, which should be... / .

just slash.

not c:/Program Files

!!!!

avatar image Faij Ahmad Dino-at-Google ♦♦ · Mar 09, 2018 at 08:42 AM 0
Link

I will try to figure out why its taking basepath as "C:/Program Files/Git" . Thanks for you help @DinoChiesa-at-Google. Will post again once found the issue.

Follow this Question

Answers Answers and Comments

39 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Accessing Keystores and Certificate files 1 Answer

Details about Java Call out Policy 2 Answers

Install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy 1 Answer

How can i receive Mutipart/ form-data request in policy level? 1 Answer

Deploy java callout policy on Apigee cloud 2 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges