Dev-Portal Internal Error: On-prem

@Anil Sagar
I am trying to access an api proxy through dev-portal but I am getting an internal error. While accessing the same api proxy through Trace tool on edge works fine, giving 200 status code.
Can you tell how I should go about debugging this issue?

Solved Solved
0 11 443
1 ACCEPTED SOLUTION

@Arun Kumar

Developer tool helped solving the issue. It was a mixed content error:

"Mixed Content: The page at 'https://<devportal>/<api>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://<edgehost/smartdocs/v1/sendrequest?targeturl=http%3A%2F%2F10.…. This request has been blocked; the content must be served over HTTPS"

So I changed my SmartDocs proxy URL to https (OneWay) and its working now.

Since most of the proxies are on 2WayTLS host, can you tell me a way to access that SmartDocs proxy using 2WayTLS URL?

Thanks for all the help!

View solution in original post

11 REPLIES 11

Not applicable

@kkhanna ask the DevPortal administrator to validate:

  • The configuration to ensure DevPortal is connecting to the Management Server
  • The credentials used by the DevPortal to connect to Edge are correct
  • I assume that the above test is using smart docs, if so, make sure SmartDocs proxy is deployed to the Org/Env you are trying to use via DevPortal.
  • Ensure DevPortal have access to Routers on the virtual host used by the Env.
  • Make sure smart docs modules are enable on DevPortal

@Maudrit

@Anil Sagar

The issue still persists. Checked all of the above steps -

  • The configuration to ensure DevPortal is connecting to the Management Server
    DevPortal is able to connect to Management Server ( Sits on the same machine).
    Devportal config file:
    MGMT_URL=http://localhost:8080/v1
    curl -L http://localhost:8080/v1/servers/self/up
    true
  • The credentials used by the DevPortal to connect to Edge are correct
    Dev Portal Config file has these two parameters as org admin credential for Edge organization
    DEVADMIN_USER=abc
    DEVADMIN_PWD=xyz
    I can connect using curl command from DevPortal to Edge-UI using these credentials
  • I assume that the above test is using smart docs, if so, make sure SmartDocs proxy is deployed to the Org/Env you are trying to use via DevPortal.
    Yes, we are using SmartDocs.
    # curl -v -u adminEmail:adminPword 0:8080/v1/o/myorg/apis
    [ "smartdocs", "myapi1", "myapi2" ]
  • Ensure DevPortal have access to Routers on the virtual host used by the Env.
    Yes, a curl request from DevPortal host to the router succeeds
  • Make sure smart docs modules are enable on DevPortal
    Published Swagger spec using SmartDocs

Can you tell me where I can see the logs in order to debug the issue.

Thanks for your help.

Not applicable

@kkhanna There are a couple of things you can check:

1. Ensure that the smartdocs proxy url is configured correctly. You will see this setting at : admin/config/smartdocs . Proxy URL should be of the format "http://hostname:port/smartdocs/v1/sendrequest" , where "hostname" should resolve from the machine you are accessing devportal ( via the browser).

2. If the smartdocs proxy URL is configured correct, enable trace on the smartdocs proxy on edge and trigger a API request from devportal. Ideally you should see the call land on the smartdocs proxy.

Let us know if this helps.

Proxy URL is http://hostname/v1/proxyendpoint ( Its the same api proxy that works through trace on edge ). So am I doing something wrong.

@kkhanna I am referring to the Smartdocs proxy URL that is configured through Devportal. Please don't confuse it with the API proxy that you intend to invoke from devportal. All API calls that you try to access from Devportal gets proxied through the Smartdocs proxy ( Another proxy that is deployed on edge). This proxy adds support for CORS headers and then forwards the call to the API proxy published on the portal. Please refer to the attached screenshot to locate the smartdocs proxy URL configuration. Please ensure that this proxy is accessible from the system you are trying to access the devportal.

5131-smartdocs-proxy-url.png

@Arun Kumar -

1. The URL configured through DevPortal is set to the smartdocs proxy URL deployed to org in edge-ui.
2. I do not see any call made to smartdocs proxy after enabling trace

Thanks for the help!

Not applicable

@kkhanna I am assuming that you tried invoking calls through portal when you had the trace enabled on the smartdocs proxy. This would indicate that the smartdocs proxy is not reachable from the system you are trying to access devportal from ( via the browser). You can confirm this by making the following curl call from the same system:

curl -X OPTIONS "https://{your_host}/smartdocs/v1/sendrequest" -v

Switch to http if you have don't have https endpoint. 200 response is expected. You would also see errors in the console tab of developer tools on your browser as well.

5135-screen-shot-2017-06-19-at-21246-pm.png

@Arun Kumar - Yes, I tried invoking calls through portal when the trace was enabled on the smartdocs proxy.
My setup : Node-1 > Router & MP, Node-2 > Router & MP, Node-7 > DevPortal & Management Server

Making call from DevPortal (Node7) while trace was enabled on smartdocs proxy results in nothing in trace session.

From DevPortal I ran `curl "http://<router-ip>:9001/smartdocs/v1/sendrequest" -v` and I am able to see the call in trace session. Since I didn't provide targeturl it results in 500.

Not applicable

@kkhanna Is possible for you to share the SmartDocs Proxy URL you have configured ? Also are you able to use developer tools on the browser to see the error getting logged ?

@Arun Kumar

Developer tool helped solving the issue. It was a mixed content error:

"Mixed Content: The page at 'https://<devportal>/<api>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://<edgehost/smartdocs/v1/sendrequest?targeturl=http%3A%2F%2F10.…. This request has been blocked; the content must be served over HTTPS"

So I changed my SmartDocs proxy URL to https (OneWay) and its working now.

Since most of the proxies are on 2WayTLS host, can you tell me a way to access that SmartDocs proxy using 2WayTLS URL?

Thanks for all the help!

Not applicable

@kkhanna Thanks for the update and glad that you were able to resolve the issue. Can i ask you to open a new topic on the community with the question around 2 way TLS for smartdocs ? This is unrelated to the original issue that was reported and hence would be better tracked as a new topic.