SQL Firebird 的“无法完成网络请求”或“连接被拒绝”,仅在一台机器上

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/745494/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 01:41:48  来源:igfitidea点击:

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

sqlodbcfirebirdc++builder

提问by Cyprus106

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.

我在公司的一台计算机上遇到了一个看似独特的问题(必须是我老板的)。我有一个来自 Borland C++ 的程序,它使用TSQLConnection. 它连接到作为应用程序运行的本地 Firebird 服务器 2.1.1.17910。其他电脑工作正常。

It will absolutely notconnect 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.dllfiles and updated them with the FireBird ones, and the connection is using fbclient.dllanyways...

绝对不会在这台 lappy(本地服务器)上连接任何东西。我记得他在安装 InterBase 时也总是遇到问题。我认为他最多安装了 7.5。现在它已经消失了,我彻底清除了所有旧的GDS32.dll文件并用 FireBird 更新了它们,并且连接仍然使用fbclient.dll......

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

我尝试卸载并重新安装 FB 并将其作为服务运行。没用。

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

我进入了 etc/services 并添加了这一行:

gds_db           3050/tcp                           #Firebird

No dice.

没有骰子。

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

在数据库位置前粘贴“localhost:”会出现此错误

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

无法完成对主机“localhost”的网络请求。建立连接失败。

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

我检查了 netstat,它正在侦听 127.0.0.1 端口 3050 ...

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

尝试在数据库位置之前粘贴“127.0.0.1:”,我得到:

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

尝试完全取出 127.0.0.1 或 localhost 并仅使用数据库位置,这是正确的位置,我得到

Unavailable Database.

不可用的数据库。

The exact same CDworks 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.

完全相同的CD作品在其他机器上的罚款。我尝试在数据库位置前粘贴“localhost”、“127.0.0.1”和任何内容,并且在其他机器上连接正常。

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 vastlyappreciated.

我让他关掉他的防火墙,仍然没有骰子......这个问题已经持续了很长时间,我已经快不行了。我已经尝试了所有我能想到的方法。它在我的计算机、空白测试计算机、beta 测试人员上都可以正常工作……除了我的老板之外的所有人。任何帮助将大大赞赏。

采纳答案by Morten Brendefur

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.

我今天在 2011 年 5 月 11 日遇到了“完全”相同的问题,并且非常有条理地解决了这个问题。在互联网上搜索提示和技巧。我尝试卸载我的 Firebird 2。我重新安装了它。当我尝试通过 Delphi 使用数据库时,同样的错误仍然存​​在。我将 system32 文件夹中的 GDS32.DLL 重命名,并从另一台一切正常的计算机复制它。还是一样的问题。由于某种原因总是拒绝连接到数据库。

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.

我检查了 Firebird 的日志文件,然后……是的。它总是拒绝,但是当我使用 IB-Console 时,我可以创建一个新数据库或使用现有数据库。

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)

我决定做最后一次尝试并再次卸载 Firebird。然后我删除了 programfiles\firebird 中的其余安装。我使用 AML Free 注册表清理器进行了完整的注册表检查。(我认为大多数好的都可以)

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

它发现了大约 1500 个无效条目,我决定“全部修复”

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

完成后,我重新安装了 firebird 2。将其安装为服务器。

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.

我现在可以在我的软件开发中再次使用 IBqueries 和 SQL 数据库和 Firebird。我最好的猜测是 Windows 注册表有问题,尽管我无法查明这一点。

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

祝你好运和最好的问候。Morten,挪威,一个很晚的星期六晚上。

回答by Bill Karwin

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.

我在 1998 年为 Borland 工作时撰写了“InterBase 操作指南”。我尝试解决常见连接相关错误的故障排除。

  • Connection Refusedis 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 Rejectedis 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?
  • 连接被拒绝是指客户端应用程序根本无法完成与 IB/FB 服务器的网络连接。如果防火墙阻止连接,这就是您会得到的错误。

  • 连接被拒绝是指网络连接到达数据库服务器,但数据库服务器决定终止连接请求。原因包括:

    • 您输入了错误的数据库路径。
    • 您指定了错误的用户名或密码(即它们与 中的条目不匹配isc4.gdb)。
    • 数据库目录位于网络文件系统上。它必须位于笔记本电脑物理本地的文件系统上。
    • 数据库服务器进程没有读取和写入数据库文件(包括isc4.gdb)的文件系统级权限。是否有防病毒软件或其他文件系统安全阻止未授权进程的 I/O?

回答by Igor Gottwald

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\SysWOW64directory. Uninstall FireBird, remove all copies of mentioned libraries from both C:\Windows\System32and C:\Windows\SysWOW64and then reinstall FireBird. It will create new and valid copies of those libraries for both 64bit and 32bit applications.

对于那些有 smilar 问题的人。64 位操作系统上的一个常见问题:GDS32.DLL 和 FBCLIENT.DLL 的错误副本在C:\Windows\SysWOW64目录中。卸载火鸟,从两个删除提到库的所有副本C:\Windows\System32C:\Windows\SysWOW64,然后重新安装火鸟。它将为 64 位和 32 位应用程序创建这些库的新的有效副本。

回答by bvj

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:

我刚刚解决了一个类似的问题,将旧的 D7 Interbase 客户端应用程序连接到远程 linux 服务器上的 Firebird 1.5.x。为了使事情正常进行,我将 XP Interbase 客户端目录结构迁移到了 Win7 x64 工作站,并编写了一个类似于以下内容的注册表项:

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

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

在我的情况下,这是找到ib_licen.dat文件所必需的。迁移后的 IB 工具也可以工作,但需要位于退役 XP 工作站的 system32 目录中的正确GDS32.DLL文件。

On the active Win7 workstation, I didn't bother hunting down and deleting gds32.dllfiles especially since I have a newer but incompatible gds32.dllinstalled in SysWow64. So to make D7 and the app happy, I copied the older GDS32.DLLfile 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.exeto maintain the corresponding Interbase alias.

在活动的 Win7 工作站上,我没有费心寻找和删除gds32.dll文件,尤其是因为我在 SysWow64 中安装了更新但不兼容的gds32.dll。因此,为了让 D7 和应用程序满意,我将旧的GDS32.DLL文件复制到包含 D7 ( delphi32.exe) 和编译的应用程序的相同目录中;不完全实用但可行。为了方便使用bdeadmin.exe维护相应的 Interbase 别名,DLL 也被复制到 BDE 目录中。

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

顺便说一下,我通过bdeadmin.exe收到的远程接口消息拒绝连接是不兼容/缺少GDS32.DLL 的症状。使用正确的GDS32.DLL后,将显示以下有关许可的消息:产品远程接口未获得许可,已通过上述注册表项解决。此外,Firebird 和网络不是导致连接问题的因素。

Another point: the ib_licen.datbeing used supported the R option.

另一点:使用的ib_licen.dat支持 R 选项。

回答by Maurice Arnold

Others may have discovered this before me but when I was faced with the message 'Unable to complete network request to host "localhost". Failed to establish a connection' I concluded there was a good chance that it was due to interference by malware or perhaps a PUP. Consequently I ran Malwarebytes which cleaned up almost 400 instances of these things, mostly PUPs and after the clean up the error disappeared. Unfortunately I cannot say which one of the malware or PUP instances was the guilty party but it was certainly one of them. Thus, I would like to suggest that running Malwarebytes would be a good first step before resorting to something more drastic like reinstalling the product.

其他人可能在我之前已经发现了这一点,但是当我遇到消息“无法完成托管“localhost”的网络请求时。未能建立连接'我得出结论,很有可能是由于恶意软件或 PUP 的干扰。因此,我运行了 Malwarebytes,它清理了近 400 个这些东西的实例,主要是 PUP,清理后错误消失了。不幸的是,我不能说哪个恶意软件或 PUP 实例是有罪的一方,但它肯定是其中之一。因此,我想建议运行 Malwarebytes 将是一个很好的第一步,然后再求助于更激烈的事情,比如重新安装产品。

回答by Douglas Tosi

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.logfile in the firebird server \bin folder.
It may have useful information on why the server rejected the connection.

正如比尔指出的那样,“被远程接口拒绝”消息意味着 TCP 连接已正确建立,但 Firebird 服务器本身拒绝了该连接。
检查firebird.log在火鸟服务器\ bin文件夹中的文件。
它可能包含有关服务器拒绝连接的原因的有用信息。

回答by bluish

I solved removing the gds32.dllfile which was in the same directory of my .exe. I guess in this way the programm uses the DLL installed somewhere else in the system, which probably is more compatible.

我解决了删除与我的 .exe 相同目录中的gds32.dll文件的问题。我想通过这种方式,程序使用安装在系统其他地方的 DLL,这可能更兼容。

回答by ABTOMOHTEP

In my personal case I solved the problem by backuping/restoring the targeted database.

在我的个人情况下,我通过备份/恢复目标数据库解决了这个问题。

回答by Rodney

I had this issue on a Virtual XP Machine. I simply shut down Firebird, and then shut down and started back up the Virtual XP machine. Started Firebird back up and the problem was gone.

我在虚拟 XP 机器上遇到了这个问题。我只是关闭 Firebird,然后关闭并开始备份 Virtual XP 机器。启动 Firebird 备份,问题消失了。

回答by Brastax

Here's the solution to this issue:

下面是这个问题的解决方案:

Go to services and Start Firebird services. There should be two services.

转到服务并启动 Firebird 服务。应该有两个服务。

The application does start but when trying to locate the database using FB it fails due to the FB services being not started.Cheers.. Siseko Bukani

应用程序确实启动了,但是当尝试使用 FB 定位数据库时,由于 FB 服务未启动而失败。干杯.. Siseko Bukani