Closed herdma closed 3 years ago
Very strange. I can say from the error, that just like you demonstrated with nc
, the TCP connection is established just fine. The error you are seeing from this library is that, after your TCP connectioj has been opened, a packet was received with either FIN or RST set, but you didn't make any API calls to end the connection. This us what it means by the server closed the connection.
Of course the question as to why the server closed your open connection on you is the mystery. Perhaps there is something in the mysql server logs to indicate why? Perhaps if you could include a packet capture of the transaction I can confirm that this module did indeed see the connection close, though that doesn't answer the why, only confirms the issue is outside of this module, somewhere in the environment.
We don't actually see anything in the MySQL logs, but we found the following in /var/log/messages:
mysqld[2960]: refused connect from 10.11.22.33
But the connection is possible from other servers. We set the bind_address to 0.0.0.0 and allowed connections for the user:
grant insert,select,delete,update on database.* to user@'%' identified by '....'
Its a MariaDB server, is that an issue? But then again, it works just fine from my laptop. Do you have any idea if another MySQL setting could be the issue?
We fixed it by allowing the host in /etc/hosts.allow :)
I'm trying to run the following code:
This works just fine on my laptop and prints the data I am expecting. Node Version: v14.16.0 Windows 10 Version 20H2
But when I try to run the exact same code on a server, it fails instantly Node Version: v14.16.0 SUSE Linux Enterprise Server 12 (x86_64)
What am I doing wrong?
It shouldn't be a firewall issue: