SnappyData or SnappySession: SignalHandler: received explicit OS signal SIGPIPE - snappydata

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.

Related

AWS aurora (Mysql, serverless) drops connection after 5 minutes

My application creates multiple (6-7) connections to the server. After about 5 minutes, 1 of the connections will be dropped. I can't really figure out why. Other than the aurora_fwd_master_idle_timeout that is set to 60, other configs remain at their default values. wait_timeout value, for example, defaults at 8 hours, so it should be long enough.
If I limit the multiple connections to 3-4, sometimes it work, sometimes it doesn't.
When it doesn't work, the detailed error is as follows:
MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during data read.
---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed.
---> System.IO.IOException: The read operation failed, see inner exception.
---> System.TimeoutException: Unable to read data from the transport connection: 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.
---> System.IO.IOException: Unable to read data from the transport connection: 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.
---> System.Net.Sockets.SocketException: 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
Any ideas of what could possibly cause this?

Wso2 connection with Mysql (SSL connection) in azure

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)

EFCore MAC - Unable to find an entry point named 'AppleCryptoNative_SslCreateContext'

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!

unable to connect through sync_gateway to remote server

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"

Configure GlassFish JDBC connection pool to handle Amazon RDS Multi-AZ failover

I have a Java EE application running in GlassFish on EC2, with a MySQL database on Amazon RDS.
I am trying to configure the JDBC connection pool to in order to minimize downtime in case of database failover.
My current configuration isn't working correctly during a Multi-AZ failover, as the standby database instance appears to be available in a couple of minutes (according to the AWS console) while my GlassFish instance remains stuck for a long time (about 15 minutes) before resuming work.
The connection pool is configured like this:
asadmin create-jdbc-connection-pool --restype javax.sql.ConnectionPoolDataSource \
--datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource \
--isconnectvalidatereq=true --validateatmostonceperiod=60 --validationmethod=auto-commit \
--property user=$DBUSER:password=$DBPASS:databaseName=$DBNAME:serverName=$DBHOST:port=$DBPORT \
MyPool
If I use a Single-AZ db.m1.small instance and reboot the database from the console, GlassFish will invalidate the broken connections, throw some exceptions and then reconnect as soon the database is available. In this setup I get less than 1 minute of downtime.
If I use a Multi-AZ db.m1.small instance and reboot with failover from the AWS console, I see no exception at all. The server halts completely, with all incoming requests timing out. After 15 minutes I finally get this:
Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 940,715 milliseconds ago. The last packet sent successfully to the server was 935,598 milliseconds ago.
It appears as if each HTTP thread gets blocked on an invalid connection without getting an exception and so there's no chance to perform connection validation.
Downtime in the Multi-AZ case is always between 15-16 minutes, so it looks like a timeout of some sort but I was unable to change it.
Things I have tried without success:
connection leak timeout/reclaim
statement leak timeout/reclaim
statement timeout
using a different validation method
using MysqlDataSource instead of MysqlConnectionPoolDataSource
How can I set a timeout on stuck queries so that connections in the pool are reused, validated and replaced?
Or how can I let GlassFish detect a database failover?
As I commented before, it is because the sockets that are open and connected to the database don't realize the connection has been lost, so they stayed connected until the OS socket timeout is triggered, which I read might be usually in about 30 minutes.
To solve the issue you need to override the socket Timeout in your JDBC Connection String or in the JDNI COnnection Configuration/Properties to define the socketTimeout param to a smaller time.
Keep in mind that any connection longer than the value defined will be killed, even if it is being used (I haven't been able to confirm this, is what I read).
The other two parameters I mention in my comment are connectTimeout and autoReconnect.
Here's my JDBC Connection String:
jdbc:(...)&connectTimeout=15000&socketTimeout=60000&autoReconnect=true
I also disabled Java's DNS cache by doing
java.security.Security.setProperty("networkaddress.cache.ttl" , "0");
java.security.Security.setProperty("networkaddress.cache.negative.ttl" , "0");
I do this because Java doesn't honor the TTL's, and when the failover takes place, the DNS is the same but the IP changes.
Since you are using an Application Server, the parameters to disable DNS cache must be passed to the JVM when starting the glassfish with -Dnet and not the application itself.