Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to complete network request" or "connection rejected" for Firebird, on just one machine

I've got a seemingly unique issue on just one computer in the company (had to be my boss's). I've got a program from Borland C++ that uses a TSQLConnection. It connects to a local Firebird server 2.1.1.17910 running as an application. The other computers work fine.

It will absolutely not connect on this one lappy (local server) for anything. I remember he always had trouble with InterBase when it was installed as well. I think he installed up to 7.5 possibly. It's gone now and I went through and wiped out any old GDS32.dll files and updated them with the FireBird ones, and the connection is using fbclient.dll anyways...

I tried uninstalling and reinstalling FB and running it as a service. Didn't work.

I went into etc/services and added in this line:

gds_db           3050/tcp                           #Firebird

No dice.

Sticking "localhost:" in front of the database location gets this error

Unable to complete network request to host "localhost". Failed to establish a connection.

I checked netstat, it's listening on 127.0.0.1 port 3050...

Tried sticking "127.0.0.1:" before the database location, I get:

connection rejected by remote interface

Tried taking 127.0.0.1 or localhost out entirely and just using the database location, which is the right location, I get

Unavailable Database.

The exact same CD works fine on other machines. I tried sticking "localhost", "127.0.0.1", and nothing at all in front of the database location and all connect fine on other machines.

I've made him turn his firewall off, still no dice... This problem has been going on for a long time and I'm at the end of my rope. I've tried everything I can possibly think of. It works fine on my computer, blank test computers, for the beta testers... everybody except my boss. Any help would be vastly appreciated.

like image 528
Cyprus106 Avatar asked Apr 13 '09 21:04

Cyprus106


5 Answers

I authored the "InterBase Operations Guide" way back in 1998, when I worked for Borland. I tried to address troubleshooting for common connection-related errors.

  • Connection Refused is when the client application cannot complete a network connection to the IB/FB server at all. If a firewall were blocking connections, this is the error you'd get.

  • Connection Rejected is when the network connection reached the database server, but the database server decided to terminated the connection request. Reasons for this include:

    • You entered the wrong path to the database.
    • You specified an incorrect username or password (i.e. they don't match entries in isc4.gdb).
    • The database directory is on a networked filesystem. It must be on a filesystem that is physically local to the laptop.
    • The database server process doesn't have filesystem-level permission to read & write the database files (including isc4.gdb). Could there be anti-virus software or other filesystem security blocking I/O for unauthorized processes?
like image 99
Bill Karwin Avatar answered Nov 14 '22 07:11

Bill Karwin


I had "exactly" same problem now today 5/11-2011 and went to work quite methodically on the issue. Searched internet for hints and tips. I tried uninstalling my Firebird 2. I reinstalled it. Same error persisted when I tried using database via Delphi. I renamed GDS32.DLL in system32 folder and copied it from another computer where everything was working fine. Still same problem. Always refusing to connect to the database for some reason.

I checked the logfile of Firebird and.. yes. it always refuse, but when I use IB-Console, I can create a new database or work with existing ones.

I decided to do one final attempt and uninstalled Firebird again. I then deleted the rest of the installation in programfiles\firebird. I did a complete registry check with AML Free registry cleaner. (I think most good ones will do)

It found about 1500 entries that were invalid and I just decided to "Fix All"

When finished, I reinstalled firebird 2. Installed it as a server.

Voila.

I can now use IBqueries and SQL Databases with Firebird in my development of software again. My best guess is that something was wrong with Windows Registry, although I can not pinpoint this.

Good luck and best regards. Morten, Norway, a very late Saturday evening.

like image 23
Morten Brendefur Avatar answered Nov 14 '22 06:11

Morten Brendefur


For those who have smilar problem. A common problem on 64-bit OS: bad copies of GDS32.DLL and FBCLIENT.DLL are in C:\Windows\SysWOW64 directory. Uninstall FireBird, remove all copies of mentioned libraries from both C:\Windows\System32 and C:\Windows\SysWOW64 and then reinstall FireBird. It will create new and valid copies of those libraries for both 64bit and 32bit applications.

like image 3
Igor Gottwald Avatar answered Nov 14 '22 07:11

Igor Gottwald


As Bill pointed the "rejected by remote interface" message means the TCP connection was established correctly, but the Firebird server itself rejected the connection.
Check the firebird.log file in the firebird server \bin folder.
It may have useful information on why the server rejected the connection.

like image 2
Douglas Tosi Avatar answered Nov 14 '22 08:11

Douglas Tosi


I just worked through a similar problem with an old D7 Interbase client app connected to Firebird 1.5.x on a remote linux server. To get things working, I migrated the XP Interbase client directory structure to a Win7 x64 workstation, and wrote a registry entry similar to the following:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Borland\InterBase\CurrentVersion]
"RootDirectory"="c:\\utils\\INTRBASE"

which in my case is necessary to locate the ib_licen.dat file. The migrated IB tools also worked but required the correct GDS32.DLL file that was located in the system32 directory of the retired XP workstation.

On the active Win7 workstation, I didn't bother hunting down and deleting gds32.dll files especially since I have a newer but incompatible gds32.dll installed in SysWow64. So to make D7 and the app happy, I copied the older GDS32.DLL file to the same directories containing D7 (delphi32.exe) and the compiled app; not exactly practical but workable. The DLL was also copied to the BDE directory for the convenience of using bdeadmin.exe to maintain the corresponding Interbase alias.

By the way, the connection rejected by remote interface message that I received via bdeadmin.exe was symptomatic of an incompatible/missing GDS32.DLL. With the correct GDS32.DLL in place, the following message concerning licensing was then displayed: product REMOTE INTERFACE is not licensed which was resolved with the aforementioned registry entry. Also, Firebird and the network were not contributing factors to the connectivity problems.

Another point: the ib_licen.dat being used supported the R option.

like image 2
bvj Avatar answered Nov 14 '22 06:11

bvj