Subject Re: [firebird-support] How to troubleshoot "connection rejected by remote interface" error? Something has got wrong...
Author John vdW
Op 09-01-2019 om 14:14 schreef jonatan.lauritsen@... [firebird-support]:

My client occassionally receives "connection rejected by remote interface" error while trying to connect to the remote server. I know that incompatibility of versions between gds32.dll/fbclient32.dll and server version can create such errors, but those are deterministic errors that happens always. In my case the error appears and disappers.


I checked:

- CPU, RAM consumption by the Fireird service is normal

- there are no errors in firebird.log

- there are no antiviruses or firewalls

- telnet server 3050 is OK and ping is also OK

- the error happens during connection time only, once the user is connected to the server, the connection remains and there are no problems.


This is Firebird 2.1 on Linux machine, but such errors can happen with later version as well, web has many request for help.


There is the following code in the Firebird sources:


{335544421, "connection rejected by remote interface"}, /* 101, connect_reject */
const ISC_STATUS isc_connect_reject = 335544421L;
#define isc_connect_reject 335544421L


inet.cpp / xnet.cpp / wnet.cpp


rem_port* INET_analyze(Firebird::PathName& file_name,... {

...

PACKET* packet = &rdb->rdb_packet;    

...

rem_port* port = inet_try_connect(packet, rdb, file_name,
                                 node_name, status_vector, dpb, dpb_length);

...

if (packet->p_operation != op_accept)
    {
        *status_vector++ = isc_arg_gds;
        *status_vector++ = isc_connect_reject;
        *status_vector++ = 0;
        disconnect(port);
        return NULL;
    }

...

}


OK, the conclusions are that "connection rejected by remote interface" happens when there is no op_accept, i.e. Firebird does not try to analyse or log/journal the real status of p_operation and the cause why the p_operation is not op_accept. Essentially, this is code block that should have never been reached and that is why it is not elaborated.


However - such errors happen and what to do in those case? Are there some Linux logs that journals off the cases when p_operation is not op_accept. And essentially - as I can understand, then the cited code occurrs on the client machine, so, there can be network errors as well, but why Firebird code puts all the blame on the rejection of the server?


So confused...


From "gds32.dll" in your post I understand the client is on windows, right?

Windows often reports "connection rejected by remote interface" while in fact the local firewall (on the clients machine) is getting in the way. Just my 2 cents