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
Related
I'm running IIS 10.0 on Windows Server 2019 Standard a simple ASP.NET Framework 4.7.2 with long running Websocket connection and SignalR.
Things work well when it comes to stopping the website and sockets are closed if I'm using non secured sockets. However if I have a secure socket connection (TLS/SSL) the worker process will hang as long as the sockets are open. The client will continue to send and receive responses from the server. The only way to fix this is to have the client restart the connection.
Both direct websockets or via SignalR will cause this issue, the application will keep on running after trying to stop the website, transmitting and receiving messages over the secure socket; as soon as the socket closes the worker process dies as expected.
Here is a similar issue with no response : Server keeps sending ping messages to client after IIS site is stopped.
Connections do not timeout after the app pool timeout (90s)
Here is a screenshot of the active connections
What could be causing this and how do I make sure these connections are dropped when a stop/recycle is requested by IIS ?
Update:
If I change the port but still use a secure connection, the problem goes away. On website stop, the connections are dropped and the worker process dies as expected. So it seems to have something to do with port 443...
While trying to connect to SQLAnywhere (Sybase) database (C# code) from Azure ServiceFabric:
await using var connection = new SAConnection(connectionString);
await connection.OpenAsync();
receive iAnywhere.Data.SQLAnywhere.SAException
Connection error: Connection was dropped (may not be a SQL Anywhere server)
Error code is Error 832. This is generic connection error: An error occurred while attempting to establish a connection with the database server, but before attempting to connect to a database. Failure to initialize a communication link during the connection attempt is an example of this error. Creating a debug log file using the LogFile connection parameter may provide more information.
Locally it works, but does not work from Service Fabric.
Fix ideas tried:
Missing driver? Looks like no, Sybase (now SAP) SQLAnywhere requires special driver or client - but locally also works without this driver, just with iAnywhere.Data.SQLAnywhere.NETCore nupackage installed
Network connection/ firewall problems? Looks like no, database server can be pinged from Service Fabric node
It was another traffic protection tool. Although it was possible to telnet the port, still traffic from app was blocked by another tool.
Had a similar issue - turned out that whilst standard incoming traffic from the Sybase Server had been whitelisted in our Firewall, encrypted traffic from this had not been.
This meant I could ping and connect with Telnet, but got the same error when trying to log-in with my credentials
Connection error: Connection was dropped (may not be a SQL Anywhere server)
Our comms team solved the issue by whitelisted encrypted traffic from the server address as well. They also mentioned it possibly could have been solved we shared a valid security certificate for the encrypted data with their team, but were happy with the first course of action.
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.
I am having a desktop application which can talk to a server application using TCP/IP. It was working all these days but now we ran into an issue. The log message in the server shows that the socket is disconnected after a while, but we are able to exchange heart beat messages. When i ran the WhireShark tool i am getting this log which i dont know how to interpret.
The other thing is when i run this application in the LAN where the server is running it just works fine.
Please help me to understand what is happening in the network.
It is difficult for me to see the trace details but it looks like .218 is the client trying to connect to .135? If so, 218's connection attempts (SYN) are being immediately rejected by 135 (RST). Normal 3-way TCP handshake should be SYN, SYN-ACK, ACK.
If the server is accepting requests from other hosts has some sort of firewall or the sort been setup to allow local LAN connections but disallow remote hosts?
I was wondering if there is a way to see if a server blocks outgoing connections. I am trying to connect to an external database from a client's server.
This is the error I get:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - 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.)
Edit:
I forgot to say I only have access to the plesk control panel. That's why I was asking if there is a way with asp.net.
When you say "server", do you mean the asp.net server, or the SQL server? And are both machines on the same network? Is this hosted?
Sql Server:
They can remove the OPENROWSET functionality, so you can't connect to remote servers, regardless
I doubt they are giving you access to linked servers in a hosted env
ASP.Net
You can try to connect to the other server via a regular connection, and see if that works.
Download a tracert component, and use that to try to trace from your server to the remote one.
If it dies somewhere inside your network, then that is your answer (it is blocked)
If it works, the outbound is open. Doesn't mean 1433 is open though.
If it dies after, not blocked, but maybe the remote is blocking icmp echo
Remember to try to tracert to somewhere else that you know works
It will be hard to tell what is killing the connection on 1433, if you can get to the server using other means. Could be the firewall, their fw, etc.
The trusty telnet method:
telnet theserver 1433
If this times out, the server is not listening. If the screen blanks and you can type something, the server is listening and no firewall is blocking the connection.
In Vista and Windows 7, you have to install telnet as a Windows component from Control Panel -> Programs and Features.