How to prevent ssh connection from timing out? - tcp

I got a problem with ssh connection.
I executed commands on a remote Linux server via python paramiko. The command executed for a long time(more than 40 minutes) and then returned the message which I want to check, there was no message returned during the executing.
I have tried different ways:
The ssh connection fails before the result returns if I don't change the sshd config on the remote server.
Enabled TCPKeepAlive/ClientAliveInterval/ClientAliveCountMax on the remote server, the server sent messages to the client during the idle period cyclically, the message was unhandled keepalive request...... It prevents the connection from timing out, but in this way, I can't get the message returned by the command.
Help me, thank you!

Related

docker redis server get/set command issue

I'm asking you a question because I need your help.
I have built a redis server in a docker container and am using it in cluster mode.
I can access the redis server and ping well.
However, when executing the get/set command, the following error message is output and the connection with the redis is lost.
Could not connect to Redis at 172.19.0.4:6300: Connection failed due to no response from the connected member or connection was lost due to no response from the host.
I would really appreciate it if you could help me with the above problem.
I guessed that the connection and ping were done well, so it was a security-related configuration problem.
So I tried to set the security setting of the redis.conf file to no, but the problem was not solved.
'protected-mode no'

tmux session getting killed when I have a broken pipe from ssh

I am using paramiko as ssh client for remote machine and starting a new tmux session using the client. After sometime I am getting a broken pipe exception. Socket exception: Connection reset by peer (54). Because of this my tmux sessions are killed. I tried changing ssh.socket to service and also added Killmode in ssh#.service. But still i am getting the same exception. Any suggestions to solve this error?

How do I solve a WSAECONNRESET error?

I am using Perforce as part of a small development team. Everyone was able to connect to the P4V client except for one person who gets the following error:
TCP receive failed.
read: socket: WSAECONNRESET
We have deactivated his McAfee firewall and virus scan, but the error persists. I really don't know what to do with this error and it seems to be rather undocumented on the perforce website. From what I gather, it's because it's not a perforce-specific issue, but rather a TCP communication problem that might be caused by something else.
Any tips?
a TCP communication problem that might be caused by something else.
This is possible, or it's possible that whenever this user connects it causes some sort of server fault.
https://msdn.microsoft.com/en-us/library/ms740668.aspx
WSAECONNRESET 10054 Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
Beyond the usual connection troubleshooting questions (is this user on the same subnet? same version of the client software? same exact P4PORT setting? is the user able to connect via the command line client and if not does it give a more helpful error? why is this user unlike all other users?) I'd look at the server logs to see if it's logging any sort of more helpful error when this user tries to connect.

Unable to read the Server response messages when WSAECONNRESET error is encountered?

Working on a client application (running on windows) problem which uses asynchronous communication (with sockets) with the database server (running on linux).
The client application hit with WSAECONNRESET error while loading data to the server and the server terminates the socket. I have used the WSAGetLastError function and extracted the error message. The server had send some messages (reporting application specific error message) to the client before terminating the socket with WSAECONNRESET error. The client is unable to extract the last message which is sent by the server (as the socket is closed and "recv" function fails). My question is how to extract the last messages sent by the database server (on linux) to client(on windows) ?
Please note, this case is working fine with linux database server to linux client. I mean, unix socket to unix socket. But problem occurs only with linux socket to windows socket communication.
Appreciate your help Please !!
You can't. 'Connection reset' destroys the connection, and all in-flight data is lost, including any that may be already buffered at the receiver.
You need to fix the problem that causes the reset.

Connection refused - not consistent

I have an application that is used to make hotel bookings. The application takes an XML message, transforms the XML into another XML message and sends this new XML to another application. I am able to book hotels successfully.
When I try to amend this booking (different XML request, same application, same URL) I get a 'Connection refused' error.
I would have thought that there'd be consistency (all work or none) but there's not.
Anyone any idea why?
"Connection refused" means that no application is accepting connections on the port and host that you try to connect to. It can be caused by
The application is actually running on a different host or a different port
The application crashed and hasn't been restarted
The application is buggy: it closes the listening server socket from time to time, so that it is not listening for connection attempts all the time
Firewall is configured to respond to new connections with a "connection refused" even if the application was able to accept a connection

Resources