'WSO2 Analytics 3.2.0 | Dashboard | Only show widget data when logging with the "admin" username

When I login with the admin user (username-->admin) it shows me the data correctly. However other users with admin role or with different roles, subscriber for example in this case does not show data and returns by console this error:

[2021-11-23 00:36:37,073] ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error occurred while authorizing the access to data provider. SiddhiStoreDataProvider. Unauthorized to get response from admin rest api. Status Code: 401 org.wso2.carbon.data.provider.exception.DataProviderException: Unauthorized to get response from admin rest api. Status Code: 401
        at org.wso2.analytics.apim.dashboards.core.data.provider.Authorizer.getTenantId(Authorizer.java:358)
        at org.wso2.analytics.apim.dashboards.core.data.provider.Authorizer.assembleQuery(Authorizer.java:291)
        at org.wso2.analytics.apim.dashboards.core.data.provider.Authorizer.authorize(Authorizer.java:209)
        at org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint.onMessage(DataProviderEndPoint.java:152)
        at jdk.internal.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.wso2.msf4j.internal.MSF4JWSConnectorListener.executeMethod(MSF4JWSConnectorListener.java:360)
        at org.wso2.msf4j.internal.MSF4JWSConnectorListener.lambda$handleTextWebSocketMessage$18(MSF4JWSConnectorListener.java:196)
        at java.base/java.util.Optional.ifPresent(Optional.java:183)
        at org.wso2.msf4j.internal.MSF4JWSConnectorListener.handleTextWebSocketMessage(MSF4JWSConnectorListener.java:177)
        at org.wso2.msf4j.internal.MSF4JWSConnectorListener.onMessage(MSF4JWSConnectorListener.java:85)
        at org.wso2.transport.http.netty.contractimpl.websocket.DefaultWebSocketConnectorFuture.notifyWebSocketListener(DefaultWebSocketConnectorFuture.java:52)
        at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.notifyTextMessage(WebSocketInboundFrameHandler.java:203)
        at org.wso2.transport.http.netty.contractimpl.websocket.WebSocketInboundFrameHandler.channelRead(WebSocketInboundFrameHandler.java:158)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
        at io.netty.handler.codec.http.websocketx.Utf8FrameValidator.channelRead(Utf8FrameValidator.java:77)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1476)
        at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1225)
        at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1272)
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:829)

[2021-11-23 00:36:37,074] ERROR {org.wso2.carbon.data.provider.endpoint.DataProviderEndPoint} - Error found in method : org.wso2.carbon.data.provider.exception.DataProviderException: Unauthorized to get response from admin rest api. Status Code: 401

View dasboard errors from the browser

Affected Product Version:

OS: Red Hat Enterprise Linux Server release 7.8 (Maipo) JDK:openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

WSO2 API Manager v3.2.0 WSO2 Analytics wso2am-analytics-3.2.0

The accesses are through APACHE HTTPD, three different DNS: example

  • int.apimanager.es
  • int.apigateway.es
  • int.apianalytics.es

Steps to reproduce: Switch from admin user to any other user



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source