dlbmusic
dlbmusic

Reputation: 1

WSO2 API Manager 3.1.0 Analytics stucks on dashboard widget API loading

I have encountered some problems running APIM with Analytics 3.1.0, seems to be stuck in some point and finally shows an error due it cannot load or find API list. We have checked every step in documentation and logs don’t show us any configuration error. The certificates seems to be ok cause I haven't seen SSL connection error in log. API Manager module connects ok with worker

My deployment consists on nginx proxy and a all-in-one node with SQL Server Databases (I have tested MySQL getting the same behaviour).

Any ideas please ?

Thanks in advance, David

img capture when error is shown

================ nginx ================

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events { } 

http {

   upstream am-back.inda.es {
        server 172.x.x.33:9443;
   }

   upstream gw-back.inda.es {
        server 172.x.x.33:8243;
   }

   upstream an-back.inda.es {
        server 172.x.x.33:9643;
   }

   server {
        listen 80;
        server_name apiam.inda.es;
        rewrite ^/(.*) https://apiam.inda.es/$1 permanent;
   }

   server {
        listen 443;
        server_name apiam.inda.es;
        proxy_set_header X-Forwarded-Port 443;
        ssl on;
        #ssl_certificate /etc/nginx/ssl/STAR_inda_es.crt;
        #ssl_certificate_key /etc/nginx/ssl/private.key;
        ssl_certificate /root/autocerts/inda_auto.crt;
        ssl_certificate_key /root/autocerts/inda_auto.key;
        location / {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_read_timeout 5m;
            proxy_send_timeout 5m;
            proxy_pass https://am-back.inda.es;
        }

        access_log /etc/nginx/log/am/https/access.log;
        error_log /etc/nginx/log/am/https/error.log;
   }

   server {
        listen 443;
        server_name apigw.inda.es;
        proxy_set_header X-Forwarded-Port 443;
        ssl on;
        #ssl_certificate /etc/nginx/ssl/STAR_inda_es.crt;
        #ssl_certificate_key /etc/nginx/ssl/private.key;
        ssl_certificate /root/autocerts/inda_auto.crt;
        ssl_certificate_key /root/autocerts/inda_auto.key;
        location / {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_read_timeout 5m;
            proxy_send_timeout 5m;
            proxy_pass https://gw-back.inda.es;
         }

         access_log /etc/nginx/log/gw/https/access.log;
         error_log /etc/nginx/log/gw/https/error.log;
   }

   server {
        listen 443;
        server_name apian.inda.es;
        proxy_set_header X-Forwarded-Port 443;
        ssl on;
        #ssl_certificate /etc/nginx/ssl/STAR_inda_es.crt;
        #ssl_certificate_key /etc/nginx/ssl/private.key;
        ssl_certificate /root/autocerts/inda_auto.crt;
        ssl_certificate_key /root/autocerts/inda_auto.key;
        location / {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_read_timeout 5m;
            proxy_send_timeout 5m;
            proxy_pass https://an-back.inda.es;
         }

         access_log /etc/nginx/log/an/https/access.log;
         error_log /etc/nginx/log/an/https/error.log;
   }
}

================ WSO2 APIM deployment.toml ================

[transport.https.properties]
proxyPort = 443

[server]
hostname = "apiam.inda.es"
node_ip = "127.0.0.1"
#offset=0
mode = "single" #single or ha
base_path = "${carbon.protocol}://${carbon.host}:${carbon.management.port}"
#discard_empty_caches = false
server_role = "default"

[super_admin]
username = "admin"
password = "admin"
create_admin_account = true

.
.
.

[apim.analytics]
enable = true
store_api_url = "https://localhost:7444"
#username = "$ref{super_admin.username}"
#password = "$ref{super_admin.password}"
#event_publisher_type = "default"
#event_publisher_impl = "org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher"
#publish_response_size = true
.
.
.

================ extract from dashboard deployment.yaml ================

.
.
.
## Authentication configuration
auth.configs:
  type: apim
  ssoEnabled: true
  properties:
    adminScope: apim_analytics:admin_carbon.super
    allScopes: apim_analytics:admin apim_analytics:product_manager apim_analytics:api_developer apim_analytics:app_developer apim_analytics:devops_engineer apim_analytics:analytics_viewer apim_analytics:everyone openid apim:api_view apim:subscribe
    adminUsername: admin
    adminPassword: admin
    kmDcrUrl: https://localhost.inda.es:9443/client-registration/v0.16/register
    kmTokenUrlForRedirection: https://apiam.inda.es/oauth2
    kmTokenUrl: https://localhost.inda.es:9443/oauth2
    kmUsername: admin
    kmPassword: admin
    portalAppContext: analytics-dashboard
    businessRulesAppContext : business-rules
    cacheTimeout: 30
    baseUrl: https://apian.inda.es
    grantType: authorization_code
    publisherUrl: https://localhost.inda.es:9443
    devPortalUrl: https://localhost.inda.es:9443
    externalLogoutUrl: https://localhost.inda.es:9443/oidc/logout
.
.
.

Upvotes: 0

Views: 618

Answers (2)

Roberto Furtado
Roberto Furtado

Reputation: 43

Well, I had the same problem, I solved this using this headers in my nginx configs:

proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";

Source: https://medium.com/microservices-on-wso2/configuring-analytics-with-api-manager-bde5ef7ee741

Upvotes: 1

Solved with transparent proxy option (nginx plus or hapoxy) and exposing source IP to endpoint.

Upvotes: 0

Related Questions