1

I've been using WSO2 API Manager 1.9.1 for the past month on a static IP and we liked it enough to put it on Azure behind a full qualified domain name. As we are still only using for internal purposes, we shut the VM down during off hours to save money. Our Azure setup does not guarantee the same IP address each time the VM restarts. The FQDN allows us to always reach https://api.mydomain.com regardless of what happens with the VM IP.

I updated the appropriate config files to the FQDN and everything seems to be working well. However! The one issue I have and cannot seem to resolve is calling APIs from the API consoloe. No matter what I do, I get a response as below

Response Body no content Response Code 0 Response Headers { "error": "no response from server" }

Mysteriously, I can successfully make the same calls from command line or SOAPUI. So it's something unique about the API Console. I can't seem to find anything useful in the logs or googling. I do see a recurring error but it's not very clear or even complete (seems to cut off).

[2015-11-17 21:33:21,768] ERROR - AsyncDataPublisher Reconnection failed for

Happy to provide further inputs / info. Any suggestions on root cause or where to look is appreciated. Thanks in advance for your help!

Edit#1 - adding screenshots from chrome Summary Headers Timing

  • Can you enable the wire logs of API Manager and see how requests are going in and out of API Manager? See http://mytecheye.blogspot.com.es/2013/09/wso2-esb-all-about-wire-logs.html – harsha89 Nov 18 '15 at 12:16
  • Thanks @harsha89. I tried that but I am not seeing any logs for wire. Any suggestions? ` /opt/wso2am-1.9.1/repository/conf/log4j.properties # uncomment the following logs to see HTTP headers and messages log4j.logger.org.apache.synapse.transport.http.headers=DEBUG log4j.logger.org.apache.synapse.transport.http.wire=DEBUG log4j.logger.httpclient.wire.header=DEBUG log4j.logger.httpclient.wire.content=DEBUG wso2@525cf4c3775d:/opt/wso2am-1.9.1$ grep -ircl --include="*.log*" "DEBUG - wire" * wso2@525cf4c3775d:/opt/wso2am-1.9.1$ ` – Jonathan Hamilton Nov 18 '15 at 17:33
  • So you don't see any wire logs? It indicates that message is not coming to the gateway. Can you check the it what is the reququest going out from chrome webtools or firebug? – harsha89 Nov 19 '15 at 17:03
  • Strange, my CORS settings are already pretty permissive. Anywhere else I should check?? ` true * GET,PUT,POST,DELETE,OPTIONS authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction ` – Jonathan Hamilton Nov 19 '15 at 17:32
  • Yeah with that settings you should be able to access. What is the option response header you getting? It should work these settings. – harsha89 Nov 20 '15 at 10:55
  • Sorry for delay; out sick for a bit. Here's the request captured by tamper data; strangely no response. So it's being caught on client side (?) which would explain why it works from CLI and SOAPUI. Any suggestions? Thx for your continued help! Host=api.mydomain.com:8243 User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language=en-US,en;q=0.5 Accept-Encoding=gzip, deflate Origin=https ://api.mydomain.com Access-Control-Request-Method=GET Access-Control-Request-Headers=authorization – Jonathan Hamilton Nov 24 '15 at 22:09
  • Strange that host is not https while Origin is. (space on https is mine to ensure it did not get formatted by SO) – Jonathan Hamilton Nov 24 '15 at 22:11
  • I have tried various tamperings to make the browser request match what is sent from curl / SOAPUI and no success - always stuck in "pending" status in TamperData while browser says same error. Pretty sure it's client side issue at this point. Any suggestions? Cheers. – Jonathan Hamilton Nov 24 '15 at 22:50
  • It's strange. It should work. So you still getting CORS issue right? I hope you calling to http enndpoint. If it's https you will need to add the certificate to the gateway as well. Iss it possible to send a screenshot of request and and response in chome ? – harsha89 Nov 25 '15 at 09:29
  • It is https. Perhaps the issue is with adding the certificate to the gateway; I need to check w/ the person from my team who did this as they may have only added it to portal. Can you recommend an article on this? – Jonathan Hamilton Nov 25 '15 at 15:50
  • Please find following article https://udaraliyanage.wordpress.com/2014/06/16/add-a-ca-certificate-to-wso2-truststore/ – harsha89 Nov 25 '15 at 16:35
  • I just double checked, server certificate is listed, so client-trustore.jks shows our server certificate. I am reviewing documentation, what I haven´t done is disabling SSL 3 or updating cyphers which most likely is not causing the issue. Thanks –  Nov 26 '15 at 14:12
  • @harsha89 any further suggestions based on the screenprints I added and confirmation from my team mate that the steps were followed? – Jonathan Hamilton Nov 30 '15 at 22:03
  • @jonathan is access control allow origins returns with options call? Also can you go to API Url through browser and accept the gateway certificate. Might be issue with browser. – harsha89 Dec 02 '15 at 12:22
  • @harsha89 Interesting, I tried in Firefox and no longer see the issue! But a few weeks ago I saw the issue in Firefox. Now issue is till present in Chrome, but I haven't figured out how to fix the cert there. Thanks for all your help! If you want to type up the resolution as an answer for posterity I am happy to accept. – Jonathan Hamilton Dec 02 '15 at 21:19
  • Great should have been a certificate issue. Basically if you are using https. Please type API gateway url in browser and accept the server certificate :) – harsha89 Dec 03 '15 at 20:36

1 Answers1

2

The API Console may not be giving you response due to following issues

  1. If you are using https, you have to type the gateway url in browser and accept it before invoke the API from the API Console (This case there is no signed certificate in the gateway)

  2. CORS issue which may due to your domain is not in access allow origins response of Options call

  3. If you create a API which having https backend. You have to import endpoint SSL certificate to client-trustore.jks

harsha89
  • 347
  • 4
  • 19