Dev portal smartdocs proxy error on prem

Hi,

We have a 4.17.05 on prem AIO instance of edge on one box and dev portal on another. Both boxes are in same subnet so no port issue. I am able to connect to 59001 port from dev portal box to edge box. Also I can call the smartdocs proxy from edge box locally. I have also confirmed that smartdocs are installed and we are able to upload open API specs into the portal.

The issue is when I test the API from dev portal it says some internal error occurred and when I debug the IE browser it says some error related to CORS profile. We have enabled CORS in our API that we are testing. The errors are listed below -

XMLHttpRequest for http://validate.apigee.com:59001/smartdocs/v1/sendrequest?targeturl=<my test API URL> required Cross Origin Resource Sharing (CORS).

XMLHttpRequest for http://validate.apigee.com:59001/smartdocs/v1/sendrequest?targeturl=<my test API URL> required CORS preflight.

XMLHttpRequest: Network Error 0x80070005, Access is denied.

I referred to the link - https://community.apigee.com/questions/43075/dev-portal-internal-error-on-prem.html and have checked that the required configuration like smartdocs proxy URL, edge admin credentials, etc. is there.

The org that gets created when we install smartdocs, which contains smartdocs proxy, is called VALIDATE and the org that we have created to deploy our proxies is different say 'ABC'. Now I wanted to know -

1. If the org that is configured in the dev portal should be 'VALIDATE' or 'ABC'.

2. Is there any other configuration that we need to do in dev portal that will help to resolve the issue.

Appreciate the help to resolve the issue.

Regards,

Santosh

0 6 2,323
6 REPLIES 6

Hi @santosh_ghalsasi

The org configuration on dev portal should be same as the org where your api proxies are deployed, but the org configuration only takes care of the synchronization of developer apps and developer accounts. Smartdocs is a drupal module which creates the smartdocs model and the method listing views. The smartdocs try it out page is rendered from a template created using handlebar js. Hence configuration of org will not have any bearing on the working of smartdocs module

Did you check the network logs in the browser while invoking the APIs via smartdocs ? For the cloud environment i know that the module invokes this rest url https://apiconsole-prod.apigee.net/smartdocs/v1/sendrequest with the actual api url as a query param. Have a look this might help you in debugging

Not applicable

@santosh_ghalsasi The issue very likely here is the hostname "validate.apigee.com". You will have to update the default virtualhost on the org "VALIDATE" to a hostname that resolves to the router. You will then have to update the smartdocs proxy url to contain the new hostname on devportal. Let me know if this helps.

Hi @Arun Kumar ,

Thank you for reply. I am able to hit the smartdocs api form command line of the first box where edge is installed -

curl -v -X OPTIONS http://validate.apigee.com:59001/smartdocs/v1/sendrequest

and it gives me a 200 CORS OK response.

But when I run same command from the other box where dev portal is installed it keeps trying to connect. I have already updated /etc/hosts file to map hostname in above command to the IP address of the box. I am also able to successfully execute below command from dev portal box's command line -

curl -v -X OPTIONS -H "Host:validate.apigee.com" http://10.54.16.174:59001/smartdocs/v1/sendrequest

Do we need to map the hostname anywhere else?

Regards,

Santosh

@santosh_ghalsasi Given that you are able to call the smartdocs proxy from the devportal box, the issue here is network related. You mentioned that you have modified the host file on server you are trying to access devportal from to have entry for validate.apigee.com. This solution won't scale as you expose the portal to wide range of users. In any case, could you try doing a "dig validate.apigee.com" and confirm if the resolved IP address is 10.54.16.174 ?

And to answer your question, there is no need to map the hostname in Apigee configuration.

Hi @Arun Kumar ,

Thank you again for the help. We had updated the /etc/hosts entries on the box where edge is installed and not on the box where the dev portal is installed. We did it and the command -

curl -v -X OPTIONS http://validate.apigee.com:59001/smartdocs/v1/sendrequest

that was not working earlier is working now from the command line of dev portal box.

Still form the UI of the portal it is not able to connect to the smartdocs proxy. I am wondering if there is any configuration that is holding it work from UI.

Regards,

Santosh

Hi @Arun Kumar ,

The issue indeed was related to port 59001 that we had not opened from the the network from where we were accessing the dev portal to the VM network. That is why all command line calls were working( since the VMs were in same subnet) and UI calls were failing.

We have changed the virtual host with a port that has network connectivity and it is working now.

Thank you so much for you help.!

Regards,

Santosh