2
votes

I've installed WSO2 Api Manager on a server and i'm trying to add Analytics. The problem is when i change admin's password in WSO2 Api Manager, my instance of Analytics keep his old password. Because of this, Api Manager can't no longer access to Analytics.

How can i change password of API-M Analytics, and create other user ?

Thank you !

edit : APIM Version 2.6.0 and APIM-Analytics 2.6.0

After editing deployment.yaml

I added auth segment inside my deployment.yaml and change password inside api-manager.xml (Analytics segment, StreamprocessorPassword attribut and StreamProcessorRestApiPassword attribut) to match with my password in deployment.yaml.

I've also changed password inside log4j.properties (DAS_AGENT and LOGEVENT). API Manager keeps saying i have wrong username or password (username didn't change)

API Manager log

TID: [-1] [] [2018-11-27 15:51:41,481] ERROR {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker} - Error while trying to connect to the endpoint. Cannot borrow client for ssl://10.16.243.135:9711. {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker} org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Cannot borrow client for ssl://10.16.243.135:9711. at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:134) at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:59) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Error while trying to login to data receiver :/10.16.243.135:9711 at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:50) at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:128) ... 6 more Caused by: org.wso2.carbon.databridge.commons.exception.AuthenticationException: wrong userName or password at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryEventSender.processResponse(BinaryEventSender.java:163) at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:44) ... 7 more

API Manager Analytics Worker log

ERROR {org.wso2.carbon.databridge.core.internal.queue.QueueWorker} - Dropping wrongly formatted event sent org.wso2.carbon.databridge.core.exception.EventConversionException: Error when converting loganalyzer:1.0.0 of event bundle with events 1 at org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.createEventList(ThriftEventConverter.java:188) at org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.toEventList(ThriftEventConverter.java:90) at org.wso2.carbon.databridge.core.internal.queue.QueueWorker.run(QueueWorker.java:72) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.wso2.carbon.databridge.core.exception.EventConversionException: No StreamDefinition for streamId loganalyzer:1.0.0 present in cache at org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.createEventList(ThriftEventConverter.java:171) ... 7 more

2
What is your APIM version?Bee
@Bee the last one, 2.6.0 for APIM and 2.6.0 for APIM-AnalyticsRobyn.D
port 9711 is not related to analytics. it's related to traffic manager. if you have a seperate trafic manager you have to update <TrafficManager> section in api-manager.xml accordingly. By default this should be pointed to the same node.Bee
Analytics and APIM are on the same node. This is my conf <TrafficManager> <Type>Binary</Type> <ReceiverUrlGroup>tcp://${carbon.local.ip}:${receiver.url.port}</ReceiverUrlGroup> <AuthUrlGroup>ssl://${carbon.local.ip}:${auth.url.port}</AuthUrlGroup> <Username>${admin.username}</Username> <Password>samepsswdAsAnaAndApiM</Password> </TrafficManager>Robyn.D
Are you having the same admin username/password in both servers? can you use samepsswdAsAnaAndApiM to login to carbon console of APIM?Bee

2 Answers

7
votes

In APIM 2.6.0 Analytics, it uses WSO2 Stream Processor internally. It uses a file based IDP by default. So you can update the admin password in <SP_HOME>/conf/<PROFILE>/deployment.yaml file.

auth.configs: 
  type: 'local'
  userManager:
    adminRole: admin
    userStore:
      users:
       -
         user:
           username: admin
           password: YWRtaW4=
           roles: 1
      roles:
       -    
         role:
           id: 1
           displayName: admin

Ref: https://docs.wso2.com/display/SP430/User+Management+via+the+IdP+Client+Interface#UserManagementviatheIdPClientInterface-LocalIdPClient

2
votes

Problem resolved with multiple solutions :

First - Bee's answer about modification in deployment.yaml to overwrite the admin's account (in API-M Analytics).

Second - I had to modify my user-mgt.xml and change admin's password with my custom password (from API Manager).

Third - I had a problem with JMS Connection, so i had to manualy change my password in api-manager.xml <JMSConnectionDetails> Segment -> <connectionfactory.TopicConnectionFactory>amqp://${admin.username}:MYPASSWORD@Clientid/.........</connectionfactory.TopicConnectionFactory>

Thank all of you, you helped me a lot !