from firebird.driver import connect_server, driver_config
srv_cfg = """[main_server]
host = localhost
port = 3051
user = SYSDBA
password = masterkey
"""
driver_config.register_server('main_server', srv_cfg)
Attach to 'main' server
con = connect_server('main_server')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anton/env/lib/python3.10/site-packages/firebird/driver/core.py", line 5571, in connect_server
svc = provider.attach_service_manager(host, spb_buf)
File "/home/anton/env/lib/python3.10/site-packages/firebird/driver/interfaces.py", line 1302, in attach_service_manager
self._check()
File "/home/anton/env/lib/python3.10/site-packages/firebird/driver/interfaces.py", line 111, in _check
raise self.__report(DatabaseError, self.status.get_errors())
firebird.driver.types.DatabaseError: Unable to complete network request to host "localhost".
-Failed to establish a connection.
If I specify a port value other than 3050 in server configuration, I will get an error when trying to connect to the server listening this port.
Run server on port 3051:
./firebird -a -p 3051
Check connection:
Register Firebird server
Attach to 'main' server
I think the problem is in connect_server(). Port is not added to host: https://github.com/FirebirdSQL/python3-driver/blob/7bb33ab32b3a925e63ea478176a2537b2f35dafd/src/firebird/driver/core.py#L5557