2 @message |
Network / firewall ?
failed on teardown with "firebird.driver.types.DatabaseError: Unable to complete network request to host "localhost".
-Failed to establish a connection."
LOG DETAILS:
2024-10-16 06:23:55.032
2024-10-16 06:23:55.032 act = <firebird.qa.plugin.Action object at [hex]>
2024-10-16 06:23:55.032
2024-10-16 06:23:55.032 @pytest.mark.version('>=3')
2024-10-16 06:23:55.032 def test_1(act: Action):
2024-10-16 06:23:55.032 script = f"""
2024-10-16 06:23:55.032 create database '{act.db.dsn}' user '{act.db.user}'
2024-10-16 06:23:55.032 password '{act.db.password}' LENGTH 300
2024-10-16 06:23:55.032 FILE '{act.db.db_path.with_name('TMP_CREATE_DB_09.F00')}' LENGTH 300
2024-10-16 06:23:55.032 FILE '{act.db.db_path.with_name('TMP_CREATE_DB_09.F01')}' LENGTH 300
2024-10-16 06:23:55.032 FILE '{act.db.db_path.with_name('TMP_CREATE_DB_09.F02')}' LENGTH 300
2024-10-16 06:23:55.032 ;
2024-10-16 06:23:55.032 set list on ;
2024-10-16 06:23:55.032 select
2024-10-16 06:23:55.032 cast(rdb$file_name as varchar(100)) db_file
2024-10-16 06:23:55.033 ,rdb$file_sequence
2024-10-16 06:23:55.033 ,rdb$file_start
2024-10-16 06:23:55.033 ,rdb$file_length
2024-10-16 06:23:55.033 from rdb$files ;
2024-10-16 06:23:55.033 """
2024-10-16 06:23:55.033 act.expected_stdout = expected_stdout
2024-10-16 06:23:55.033 act.isql(switches = ['-q'], input=script, connect_db=False, combine_output = True)
2024-10-16 06:23:55.033 > assert act.clean_stdout == act.clean_expected_stdout
2024-10-16 06:23:55.033 E assert
2024-10-16 06:23:55.033 E + Statement failed, SQLSTATE = 08006
2024-10-16 06:23:55.033 E + Unable to complete network request to host "localhost".
2024-10-16 06:23:55.033 E + -Failed to establish a connection.
2024-10-16 06:23:55.033 E - TMP_CREATE_DB_09.F00
2024-10-16 06:23:55.033 E - RDB$FILE_SEQUENCE 1
2024-10-16 06:23:55.033 E - RDB$FILE_START 301
2024-10-16 06:23:55.033 E - RDB$FILE_LENGTH 300
2024-10-16 06:23:55.033 E - TMP_CREATE_DB_09.F01
2024-10-16 06:23:55.033 E - RDB$FILE_SEQUENCE 2
2024-10-16 06:23:55.033 E - RDB$FILE_START 601
2024-10-16 06:23:55.033 E - RDB$FILE_LENGTH 300
2024-10-16 06:23:55.034 E - TMP_CREATE_DB_09.F02
2024-10-16 06:23:55.034 E - RDB$FILE_SEQUENCE 3
2024-10-16 06:23:55.034 E - RDB$FILE_START 901
2024-10-16 06:23:55.034 E - RDB$FILE_LENGTH 300
2024-10-16 06:23:55.034
2024-10-16 06:23:55.034 tests\functional\database\create\test_09.py:52: AssertionError
|
3 #text |
request = <SubRequest 'db' for <Function test_1>>
db_path = WindowsPath('H:/QA/temp/qa2024.tmp/fbqa/test_11737')
db_cache = <firebird.qa.plugin.DbCache pytest object at [hex]>
@pytest.fixture
def database_fixture(request: pytest.FixtureRequest, db_path, db_cache) -> Database:
db = Database(db_path, filename, user, password, charset, debug=str(request.module),
config_name=config_name, utf8filename=utf8filename)
if not do_not_create:
if from_backup is None and copy_of is None:
db.create(page_size, sql_dialect, db_cache)
elif from_backup is not None:
db.restore(from_backup)
elif copy_of is not None:
db.copy(copy_of)
if async_write:
db.set_async_write()
if init: # Do not check for None, we want to skip empty scripts as well
try:
db.init(init)
except Error as exc:
if hasattr(exc, 'stderr'):
request.node.user_properties.append(("dbinit-stderr", exc.stderr))
raise
yield db
if not do_not_drop:
> db.drop()
src\firebird\qa\plugin.py:987:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
server = 'qa_rundaily_hq40'
def connect_server(server: str, *, user: str=None, password: str=None,
crypt_callback: iCryptKeyCallbackImpl=None,
expected_db: str=None, role: str=None, encoding: str=None,
encoding_errors: str=None) -> Server:
"""Establishes a connection to server's service manager.
Arguments:
server: Server host machine or Server configuration name.
user: User name.
password: User password.
crypt_callback: Callback that provides encryption key.
expected_db: Database that would be accessed (for using services with non-default
security database)
role: SQL role used for connection.
encoding: Encoding for string values passed in parameter buffer. Default is
`.ServerConfig.encoding`.
encoding_errors: Error handler used for encoding errors. Default is
`.ServerConfig.encoding_errors`.
Hooks:
Event `.ServerHook.ATTACHED`: Executed before `Service` instance is
returned. Hook must have signature::
hook_func(server: Server) -> None
Any value returned by hook is ignored.
"""
srv_config = driver_config.get_server(server)
if srv_config is None:
srv_config = driver_config.server_defaults
host = server or None
port = None
else:
host = srv_config.host.value
port = srv_config.port.value
if host is None:
host = 'service_mgr'
if not host.endswith('service_mgr'):
if host and not host.endswith(':'):
if port:
host += f"/{port}"
host += ':'
host += 'service_mgr'
if user is None:
user = srv_config.user.value
if password is None:
password = srv_config.password.value
spb = SPB_ATTACH(user=user, password=password, config=srv_config.config.value,
trusted_auth=srv_config.trusted_auth.value,
auth_plugin_list=srv_config.auth_plugin_list.value,
expected_db=expected_db, role=role)
spb_buf = spb.get_buffer()
with a.get_api().master.get_dispatcher() as provider:
if crypt_callback is not None:
provider.set_dbcrypt_callback(crypt_callback)
> svc = provider.attach_service_manager(host, spb_buf)
C:\Python3x\Lib\site-packages\firebird\driver\core.py:5596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iProvider pytest object at [hex]>
service = 'localhost/33337:service_mgr'
spb = b'\x02\x02\x1c\x06SYSDBA\x1d\tmasterkey'
def attach_service_manager(self, service: str, spb: bytes) -> iService:
"Replaces `isc_service_attach()`"
result = self.vtable.attachServiceManager(self, self.status, service.encode(), len(spb), spb)
> self._check()
C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:1305:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iProvider pytest object at [hex]>
def _check(self) -> None:
state = self.status.get_state()
if StateFlag.ERRORS in state:
> raise self.__report(DatabaseError, self.status.get_errors())
E firebird.driver.types.DatabaseError: Unable to complete network request to host "localhost".
E -Failed to establish a connection.
C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:113: DatabaseError
|