WSO2 Api Manager Control Plane not starting JMS server - wso2

I have a wso2apimanager-4.1.0 with the role of control-plane. In the wso2carbon.log, the following stack trace keeps appearing, especially when I try to deploy an API change. The main errors are "Caused by: org.wso2.andes.AMQConnectionFailureException: Server did not respond in a timely fashion [error code 408: Request Timeout]" and "ERROR {org.wso2.andes.client.AMQConnection} - Throwable Received but no listener set. org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted."
error_1
error_2
Despite these errors, the gateway-workers can connect to the control-plane on startup pulling all the APIs deployed on the API Manager ecosystem. Although, when I deploy a new version of an API, the gateways are not notified (because the JMS is down) and they do not pull the changes until they are rebooted.
I've already reviewed the jndi.properties, user-mgt.xml and all the superuser username and password are correct (they are pulled from deployment.toml correctly). The JMS port exists when the control-plane service starts and is not being blocked by any firewall, also the superuser password doesn't have special characters like '#'.
I've migrated the control-plane from version 4.0.0 to version 4.1.0 recently, the error did not occur in 4.0.0. The config file (deployment.toml) is the same.
Has anyone come across this problem? How can I resolve this error?

Related

WSO2 API Manager - Sample PizzaShackAPI is not working

I am new to WSO2 API Manager. I followed the Quick Start Guide to learn by deploying sample PizzaShackAPI.
https://docs.wso2.com/display/AM210/Quick+Start+Guide
As I click "Try It Out!", I am not getting the correct response as mentioned in the guide.
I am getting the below response and there is no log in the console initially.
Response Code
0
Response Headers
{
"error": "no response from server"
}
After I added Self Signed Certificate in Firefox as Add Exception, I am getting the below error in the console,
[2017-03-01 15:06:51,309] ERROR - SourceHandler I/O error: An established connection was aborted by the software in your
host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:371)
I guess it may be a certificate configuration issue. Please help me to resolve this issue.
I tried with creating my own API. Facing the same issue.
Error message "error": "no response from server" on API console is mostly due to CORS error. Could you please check your browser console and see the error there, Most likely you will see error related to cors.
Note: these changes are not advised for production environment, for production environment you want to provide all relevant information instead of allow all (*)
To allow all headers and origin edit repository/conf/api-manager.xml and change values for following:
<Access-Control-Allow-Headers>*</Access-Control-Allow-Headers>
<Access-Control-Allow-Origin>*</Access-Control-Allow-Origin>
Second change to allow all host name and avoid any certificate host name validation.
Edit /repository/conf/axis2/axis2.xml and un comment HostnameVerifier and change value to AllowAll.
<parameter name="HostnameVerifier">AllowAll</parameter>
Restart API Manager and test again.

Can not validate authorization code in WSO2 IS 5.2.0 Cluster mode

I recently updated my environment from WSO2 IS 5.0.0 to WSO2 IS 5.2.0. My environment consists of 2 machines that are creating a cluster (using the WKA membership scheme and Load Balancer(AWS ELB) with sticky session enabled). I am using MySQL(not the default H2 database). The machines on which the IS is deployed are Windows Server 2012 R2 (EC2 AWS machines).
I ensured that the "IS_HOME\repository\conf\datasources\master-datasources.xml" is configured the same way on both machines and that they are using the exact same MySQL data sources. Also I am sure that the correct database is referenced in user-mgt.xml and identity.xml.
I have two worker nodes under AWS ELB as mentioned above. When the cluster was configured the following instructions were used:
https://docs.wso2.com/display/CLUSTER44x/Clustering+Identity+Server+5.1.0
I have application which is using the clientID and clientSecret of one of the service providers. I am using the authorization_code grant type. When I try to login in my application and I am redirected to NODE1 I receive authorization code and I am trying to get access token by calling: https://URL/oauth2/token?client_id=CLIENT_ID&redirect_uri=REDIRECT_URId&client_secret=CLIENT_SECRET&grant_type=authorization_code&code=AUTH_CODE.
If this request is processed by NODE1 I receive access token and everything is fine. However if the mentioned above request is processed by NODE2, I receive the following:
{
"error": "invalid_grant",
"error_description": "Error when validating an authorization code"
}
I am able to see the generated authorization code in the IDN_OAUTH2_AUTHORIZATION_CODE table. I double checked that the machine clocks are synchronized and are using NTP, but I am not able to validate authorization code generated by NODE1 through NODE2 and vice versa.
If I am running single node configuration, no such issues is reproduced.
I am not seeing any errors in wso2carbon.log regarding this issue.
I have patch0481 applied to my system.
Could this be some sort of configuration issue? If so in which configuration files I should take a look?
Thanks in advance.

Error occurred while getting the APIs

I locally installed WSO2 API manager and create API but API list is not coming at WSO2 dashboard . It displaying an error i.e
[2015-11-03 18:47:29,781] ERROR - AsyncDataPublisher Reconnection failed for for tcp://localhost:7614"
index:jag org.wso2.carbon.apimgt.api.APIManagementException: Error occurred while getting the APIs
Version of API manager is 1.9.1
I can't get any API statistics
This issue can be occurred when you have not configured information according to the Port Offset value. As an example if the port offset value of BAM instance is 3,need to configure as follows in property in the api-manager.xml which is in /repository/conf/ folder.
<ThriftPort>7614</ThriftPort>
<BAMServerURL>{tcp://<IP Address>:7614/}</BAMServerURL>
Also make sure to restart both servers.

Migrating web service from ColdFusion 8 to 10 issues

I have a web service that has been running on CF 8 for awhile now without issues. We've recently moved to CF10, and this web service no longer works. I've already tried switching the Axis setting to 1, it's still tossing errors. Has anyone else encountered this, or have an ideas on what else to look for here?
Process:
CF Server sends a web service request to App Server.
App Server processes request, generates another web service back to CF Server with SOAP data pushes, then replies back to the step 1 originating request with a boolean response on how its own web service request went.
CF Server Errors:
The web service operation caused an invocation exception.The root cause was that: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error.
Cannot perform web service invocation [Method Name]. The fault returned when invoking the web service operation is: java.lang.NoClassDefFoundError: org/apache/james/mime4j/MimeException
App Server Error Logs:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
Caused by: java.io.IOException: Error writing to server
I've gone as far as modifying the App Server configuration to have it's web service request push out to the CF 8 server for processing, while still replying back to the originating request from the CF 10 server. This worked fine. It's definitely something with the requests or my CF 10 web service config.
I can't post any of the code examples unfortunately.
24 Sept 13 Update
I've tried various combinations of v1 and v2 in the CF admin, with wsdl and wsdl2, and the application.cfc setup. The app that is interacting with this service has given me the ability to modify a variety of parameters for soap versioning and some internal items. I can get the two services to talk with a bare bones connection of give me your soap and I'll toss a YES back. Whenever I try to use the full request it seems to never actually hit my web service, and gets stopped somewhere by CF. I see no logging on it other than in the web service log.
I found the solution to my problem. The ColdFusion connector was causing the fault. After installing ColdFusion 10 and patching, I had run the wsconfig to rebuild the connector. I had either done this incorrectly, or for some reason it didn't take. I ran it this morning, removed the connector, re-added it.... everything working fine now. Very frustrating.

WSO2 API Key Manager

I am configuring our API Manager, but running into troubles authenticating via OAuth, seems to be an issue with the API Key Manager. I haven't dug into it yet, but does this come with the API Manager (as I have assumed) or is this a separate installation?
I had the same issue when using the wso2 api manager on a Amazon hosted machine, turn out that Thrift was not working correctly because some problem with multicasting and broadcasting.
What I did to get it working was to switch from ThriftClient to WSClient. If you have a huge amount of requests coming in then Thrift is the recommended solution from wso2 but in any "normal" case you will not have any differences between thrift and WS.
Here is how you switch:
Shut down the API Manager
Open up <api manager install dir>\repository\conf\api-manager.xml
Find ThriftClient
Change this to
<KeyValidatorClientType>WSClient</KeyValidatorClientType>
Start the API Manager
You may get some Warnings while starting up but, try it before you jump to the conclusion that it doesn't work.
Hope it helps!
you can use APIM manager product in a distributed setup as keymanger,gateway,store,publisher..but all functionality come in a single distribution.. ..
Go through the documentation for further guides
I was facing the same issue. Everything started when I created my own jks in order to use SSL without a self-signed certificate. I successfully created the jks and changed it in the carbon file. When I started the server, everything seemed ok; but when I used SOAPUI to test an API call, I got this (in the logs of the api manager):
APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
I started digging what was the problem by enabling Debug level in the log4j.properties file, and then tried again a tested with SOAPUI and I got:
APISecurityException: Could not connect to <my api ip address> on port 10397
Then, I read the comment of OneMuppet and I checked that file and I found that the Thrift config has a host option, so I uncommented it:
<KeyValidatorClientType>ThriftClient</KeyValidatorClientType>
<ThriftClientPort>10397</ThriftClientPort>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<ThriftServerPort>10397</ThriftServerPort>
This Line --> <ThriftServerHost>localhost</ThriftServerHost>
<EnableThriftServer>true</EnableThriftServer>
Save, restarted the server and everything start working correctly.
I got the same below issue after my installation, when i try to invoke the api service it is throwing below error:
900900 Unclassified Authentication Failure Error while accessing backend services for API key validation
After some random checks i have seen the axis2.xml file in /repository/conf/axis2 there it is refering a differnt ip's instead. I change these ip's to my local ip and restarted. The issue is resolved now.
I was facing the same issue. when I was trying to setup API Manager as an API Gateway in a different machine as per the steps given here,
https://docs.wso2.com/display/AM250/Publish+through+Multiple+API+Gateways
Once the setup is done and when I am trying to use this gateway URL, I was getting the below response,
{"fault":{"code":900900,"message":"Unclassified Authentication Failure","description":"Error while accessing backend services for API key validation"}}
After changing the KeyValidatorClientType value to WSClient from ThriftClient on the <api manager install dir>\repository\conf\api-manager.xml
It started working fine. And I was able to get the expected response.
If you changed the admin password, then you also have to update the repository/conf/api-manager.xml file with the new password. The 2 places I have changed (so far) are:
<AuthManager>
and
<APIKeyManager>
but there are other admin usernames in that file. No doubt, I'll get to them....