Not able to change the default H2 database to Mysql in WSO2 .
Getting SSL handshake error when connecting from WSO2 to Mysql(MySql is a saas hosted in azure)
Steps I have taken to connect to the MySQL 5.7 from wso2 api manager 260
1) I have added the https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem to the client-truststore.jks
Link form where I got the crt is https://learn.microsoft.com/en-us/azure/mysql/howto-configure-ssl
2) I have updated the master-datasources.xml file
<url>jdbc:mysql://***.mysql.database.azure.com:3306/regdb?verifyServerCertificate=false&useSSL=true&requireSSL=false</url>
<username>***</username>
<password>***</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
3) Created the schema and the required tables as well
Below is the error log when starting the wso2 server
Start Level Event Dispatcher, received EOFException: error
Start Level Event Dispatcher, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Start Level Event Dispatcher, SEND TLSv1.2 ALERT: fatal, description = handshake_failure
Start Level Event Dispatcher, WRITE: TLSv1.2 Alert, length = 2
Start Level Event Dispatcher, Exception sending alert: java.net.SocketException: Broken pipe (Write failed)
Related
when running
dotnet ef database update --startup-project ../webapi/webapi.WebAPI.csproj
on my MAC 10.13.5
I get this error -
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> System.EntryPointNotFoundException: Unable to find an entry point named 'AppleCryptoNative_SslCreateContext' in shared library 'System.Security.Cryptography.Native.Apple'.
at Interop.AppleCrypto.SslCreateContext(Int32 isServer)
at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
--- End of inner exception stack trace ---
...
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
I originally thought this was my local docker database was not available but when connecting to new database instance it still occurs, this was working yesterday.
Whilst typing this I came across this, but thought would just add the answer as someone on a MAC EF Core install may miss that also when searching -
A connection was successfully established with the server, but then an error occurred during the pre-login handshake
Cleaning my project (I personally deleted all the folders) and rebuilding, sorted it!
Get this error when sending data to the cluster:
2018-01-22 18:49:54 101 4859929 [SIGPIPE handler] WARN snappystore - SignalHandler: received explicit OS signal SIGPIPE
java.lang.Throwable: null
at com.pivotal.gemfirexd.internal.engine.SigThreadDumpHandler.handle(SigThreadDumpHandler.java:112)
at sun.misc.Signal$1.run(Signal.java:212)
at java.lang.Thread.run(Thread.java:745)
This means that there has been an unclean socket close on a receiver/sender so the OS has sent a SIGPIPE. Not a problem itself but could indicate some problem on the connection to a remote node. Usually happens when network connectivity to a remote node is down in the middle of operation or remote node has gone down abruptly. I would see the logs before and after to see if any exception was received from a remote node and then go check that node.
Mule project has multiple flows some of which have endpoints that may be offline at startup during testing. A failed endpoint in any flow is causing the entire Mule project to fail to deploy. Console logs that domain status is deployed but application status = FAILED.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Starting app 'test' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
. Root Exception was: Connection refused: connect. Type: class java.net.ConnectException
ERROR 2018-01-09 10:31:08,287 [main] org.mule.module.launcher.application.DefaultMuleApplication:
********************************************************************************
Message : Could not connect to broker URL: tcp://localhost:61616.
Reason: java.net.ConnectException: Connection refused: connect
JMS Code : null
*************************************************************
* Application "test" shut down normally on: 1/9/18 10:31 AM *
* Up for: 0 days, 0 hours, 0 mins, 1.449 sec *
*************************************************************
ERROR 2018-01-09 10:31:08,413 [main] org.mule.module.launcher.DefaultArchiveDeployer:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Failed to deploy artifact 'test', see below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
org.mule.module.launcher.DeploymentStartException: ConnectException: Connection refused: connect
Have tried to set initialState="stopped" on flows that could have startup connection issues but has no affect on running the project. Project still fails to run and no flows are running.
Added CatchExceptionStrategy to the inbound endpoints that can fail at startup to no available. Also tried "Until Successful" scope in flow.
In particular have some JMS and Web service components which may be offline at different times during development and testing. Want to configure flows to allow overall project to continue even if a single component/flow fails to connect at startup. Want to manage a single project with multiple flows such that some flows may not be active.
Environment: Anypoint Studio and Mule 3.9.0 EE.
If you would like your deployment to succeed even when your service is not available, you will need to supply a reconnection strategy on the JMS Connector with blocking=false. For example:
<jms:activemq-connector name="Active_MQ" username="a" password="b" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ">
<reconnect-forever blocking="false"/>
</jms:activemq-connector>
More information on reconnection strategies can be found in the MuleSoft documentation here: https://docs.mulesoft.com/mule-user-guide/v/3.9/configuring-reconnection-strategies if needed.
At the moment I am trying to follow this documentation in order to connect to my Second Generation Cloud SQL database. However, my application fails on startup since it cannot connect to it ..
As been told by the documentation, I have added both service accounts
my-project#appspot.gserviceaccount.com
1234-compute#developer.gserviceaccount.com
as Editor under IAM.
I am using the IPv4 of the Cloud SQL instance to connect. Here the connection string:
jdbc:mysql://w.x.y.z:3306/app_db?useSSL=false
but in the Stackdriver Logging view I see:
[main] ERROR com.mz.server.BootstrappingServerConfig - Error trying to migrate SQL scripts ..
org.flywaydb.core.api.FlywayException: Unable to obtain Jdbc connection from DataSource
at org.flywaydb.core.internal.util.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
at org.flywaydb.core.Flyway.execute(Flyway.java:1385)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1006)
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
...
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
...
Both instances are in the same region: us-central1-b for the compute instances and us-central1 for the SQL instances.
My app.yaml file:
runtime: java
vm: true
runtime_config:
jdk: openjdk8
server: jetty9
env_variables:
'ALPN_ENABLE': 'true' # OPTIONAL
beta_settings:
cloud_sql_instances: mz-test:us-central1:mz-test-cloudsql
health_check:
enable_health_check: false
I am not sure what's wrong here. Am I actually allowed to use the local IPv4 address of the SQL instance?
The documentation actually says
"In your application code, connect to the instance by opening a socket with the following name: /cloudsql/[INSTANCE_CONNECTION_NAME}"
But I am not sure what that would mean for the connection string.
I am also missing the information about what username/password is required or do I not need one here?
Why am I not able to connect?
For Java applications running on App Engine Flexible Environment applications use the following library: https://github.com/GoogleCloudPlatform/cloud-sql-mysql-socket-factory
I am trying to start sync_gateway from cmd with following command:
sync_gateway -url http://75.76.221.21:8091
I received following error:
20:33:23.014229 WARNING: Error installing Couchbase design doc: Put
http://192.168.2.102:8092/sync_gateway/_design/sync_gateway: dial tcp
192.168.2.102:8092: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to
respond. -- db.installViews() at database.go:29120:33:44.055739
WARNING: Error installing Couchbase design doc: Put
http:/_design/sync_housekeeping: dial tcp 192.168.2.102:8092:
ConnectExtcp: A connection attempt failed because the connected party
did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. --
db.installViews() at database.go:30520:33:44.055739
FATAL: Error opening database: Put
192.168.2.102:8092/omnibazaar/_design/sync_housekeeping: dial tcp 192.168.2.102:8092: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to
respond. -- rest.RunServer() at config.go:415
How did you name your nodes in your Couchbase instance? If you look at the Server Nodes tab, is one of your nodes named "192.168.2.102". I see that from your sync gateway machine, you are trying to reach the Couchbase cluster using the 75.76.221.21 address. Have you checked network connectivity, from your sync gateway machine, try "telnet 192.168.2.102 8092" and see if it connects.
One other thing, it is more common to start sync gateway by redirecting in a configuration file, you can find them in the examples directory. For instance "sync_gateway < examples/config-server.json"