2 @message |
Authentification problem
firebird.driver.types.DatabaseError: Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
LOG DETAILS:
2024-05-12 19:15:46.091
2024-05-12 19:15:46.097 act = <firebird.qa.plugin.Action object at [hex]>
2024-05-12 19:15:46.103 user_1 = <firebird.qa.plugin.User object at [hex]>
2024-05-12 19:15:46.110 user_2 = <firebird.qa.plugin.User object at [hex]>
2024-05-12 19:15:46.116 user_3 = <firebird.qa.plugin.User object at [hex]>
2024-05-12 19:15:46.122 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-05-12 19:15:46.132
2024-05-12 19:15:46.138 @pytest.mark.version('>=2.5')
2024-05-12 19:15:46.144 def test_1(act: Action, user_1: User, user_2: User, user_3: User, capsys):
2024-05-12 19:15:46.151 act.expected_stdout = expected_stdout
2024-05-12 19:15:46.157 for user in [user_1, user_2, user_3]:
2024-05-12 19:15:46.162 > with act.db.connect(user=user.name, password=user.password) as con:
2024-05-12 19:15:46.167
2024-05-12 19:15:46.172 tests/bugs/core_1642_test.py:45:
2024-05-12 19:15:46.178 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 19:15:46.183
2024-05-12 19:15:46.190 database = '/var/tmp/qa_2024/test_1266/test.fdb'
2024-05-12 19:15:46.195
2024-05-12 19:15:46.200 def connect(database: str, *, user: str=None, password: str=None, role: str=None,
2024-05-12 19:15:46.205 no_gc: bool=None, no_db_triggers: bool=None, dbkey_scope: DBKeyScope=None,
2024-05-12 19:15:46.210 crypt_callback: iCryptKeyCallbackImpl=None, charset: str=None,
2024-05-12 19:15:46.216 auth_plugin_list: str=None, session_time_zone: str=None) -> Connection:
2024-05-12 19:15:46.220 """Establishes a connection to the database.
2024-05-12 19:15:46.225
2024-05-12 19:15:46.230 Arguments:
2024-05-12 19:15:46.235 database: DSN or Database configuration name.
2024-05-12 19:15:46.240 user: User name.
2024-05-12 19:15:46.245 password: User password.
2024-05-12 19:15:46.254 role: User role.
2024-05-12 19:15:46.259 no_gc: Do not perform garbage collection for this connection.
2024-05-12 19:15:46.263 no_db_triggers: Do not execute database triggers for this connection.
2024-05-12 19:15:46.268 dbkey_scope: DBKEY scope override for connection.
2024-05-12 19:15:46.273 crypt_callback: Callback that provides encryption key for the database.
2024-05-12 19:15:46.278 charset: Character set for connection.
2024-05-12 19:15:46.283 auth_plugin_list: List of authentication plugins override
2024-05-12 19:15:46.287 session_time_zone: Session time zone [Firebird 4]
2024-05-12 19:15:46.292
2024-05-12 19:15:46.298 Hooks:
2024-05-12 19:15:46.304 Event `.ConnectionHook.ATTACH_REQUEST`: Executed after all parameters
2024-05-12 19:15:46.310 are preprocessed and before `Connection` is created. Hook
2024-05-12 19:15:46.316 must have signature::
2024-05-12 19:15:46.320
2024-05-12 19:15:46.325 hook_func(dsn: str, dpb: bytes) -> Optional[Connection]
2024-05-12 19:15:46.330
2024-05-12 19:15:46.335 Hook may return `Connection` instance or None.
2024-05-12 19:15:46.343 First instance returned by any hook will become the return value
2024-05-12 19:15:46.348 of this function and other hooks are not called.
2024-05-12 19:15:46.353
2024-05-12 19:15:46.358 Event `.ConnectionHook.ATTACHED`: Executed before `Connection` instance is
2024-05-12 19:15:46.365 returned. Hook must have signature::
2024-05-12 19:15:46.371
2024-05-12 19:15:46.377 hook_func(connection: Connection) -> None
2024-05-12 19:15:46.384
2024-05-12 19:15:46.389 Any value returned by hook is ignored.
2024-05-12 19:15:46.395 """
2024-05-12 19:15:46.402 db_config = driver_config.get_database(database)
2024-05-12 19:15:46.410 if db_config is None:
2024-05-12 19:15:46.416 db_config = driver_config.db_defaults
2024-05-12 19:15:46.421 else:
2024-05-12 19:15:46.427 database = db_config.database.value
2024-05-12 19:15:46.432 if db_config.server.value is None:
2024-05-12 19:15:46.438 srv_config = driver_config.server_defaults
2024-05-12 19:15:46.443 else:
2024-05-12 19:15:46.452 srv_config = driver_config.get_server(db_config.server.value)
2024-05-12 19:15:46.459 if srv_config is None:
2024-05-12 19:15:46.466 raise ValueError(f"Configuration for server '{db_config.server.value}' not found")
2024-05-12 19:15:46.473 if user is None:
2024-05-12 19:15:46.481 user = db_config.user.value
2024-05-12 19:15:46.486 if user is None:
2024-05-12 19:15:46.492 user = srv_config.user.value
2024-05-12 19:15:46.497 if password is None:
2024-05-12 19:15:46.502 password = db_config.password.value
2024-05-12 19:15:46.508 if password is None:
2024-05-12 19:15:46.513 password = srv_config.password.value
2024-05-12 19:15:46.519 if role is None:
2024-05-12 19:15:46.524 role = db_config.role.value
2024-05-12 19:15:46.529 if charset is None:
2024-05-12 19:15:46.534 charset = db_config.charset.value
2024-05-12 19:15:46.539 if charset:
2024-05-12 19:15:46.544 charset = charset.upper()
2024-05-12 19:15:46.548 if auth_plugin_list is None:
2024-05-12 19:15:46.553 auth_plugin_list = db_config.auth_plugin_list.value
2024-05-12 19:15:46.557 if session_time_zone is None:
2024-05-12 19:15:46.563 session_time_zone = db_config.session_time_zone.value
2024-05-12 19:15:46.568 dsn = _connect_helper(db_config.dsn.value, srv_config.host.value, srv_config.port.value,
2024-05-12 19:15:46.573 database, db_config.protocol.value)
2024-05-12 19:15:46.578 dpb = DPB(user=user, password=password, role=role, trusted_auth=db_config.trusted_auth.value,
2024-05-12 19:15:46.584 sql_dialect=db_config.sql_dialect.value, timeout=db_config.timeout.value,
2024-05-12 19:15:46.589 charset=charset, cache_size=db_config.cache_size.value,
2024-05-12 19:15:46.594 no_linger=db_config.no_linger.value, utf8filename=db_config.utf8filename.value,
2024-05-12 19:15:46.598 no_gc=no_gc, no_db_triggers=no_db_triggers, dbkey_scope=dbkey_scope,
2024-05-12 19:15:46.604 dummy_packet_interval=db_config.dummy_packet_interval.value,
2024-05-12 19:15:46.609 config=db_config.config.value, auth_plugin_list=auth_plugin_list,
2024-05-12 19:15:46.614 session_time_zone=session_time_zone, set_bind=db_config.set_bind.value,
2024-05-12 19:15:46.619 decfloat_round=db_config.decfloat_round.value,
2024-05-12 19:15:46.625 decfloat_traps=db_config.decfloat_traps.value,
2024-05-12 19:15:46.630 parallel_workers=db_config.parallel_workers.value)
2024-05-12 19:15:46.635 > return __make_connection(False, dsn, db_config.utf8filename.value, dpb.get_buffer(),
2024-05-12 19:15:46.640 db_config.sql_dialect.value, charset, crypt_callback)
2024-05-12 19:15:46.645
2024-05-12 19:15:46.650 ../lib/python3.11/site-packages/firebird/driver/core.py:2149:
2024-05-12 19:15:46.655 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 19:15:46.660
2024-05-12 19:15:46.665 create = False, dsn = 'localhost/3702:/var/tmp/qa_2024/test_1266/test.fdb'
2024-05-12 19:15:46.671 utf8filename = False
2024-05-12 19:15:46.675 dpb = b'\x01\x1c\x0eTMP$C1642_ALAN\x1d\x03123?\x04\x03\x00\x00\x00'
2024-05-12 19:15:46.680 sql_dialect = 3, charset = None, crypt_callback = None
2024-05-12 19:15:46.684
2024-05-12 19:15:46.689 def __make_connection(create: bool, dsn: str, utf8filename: bool, dpb: bytes,
2024-05-12 19:15:46.698 sql_dialect: int, charset: str,
2024-05-12 19:15:46.703 crypt_callback: iCryptKeyCallbackImpl) -> Connection:
2024-05-12 19:15:46.708 with a.get_api().master.get_dispatcher() as provider:
2024-05-12 19:15:46.713 if crypt_callback is not None:
2024-05-12 19:15:46.718 provider.set_dbcrypt_callback(crypt_callback)
2024-05-12 19:15:46.723 if create:
2024-05-12 19:15:46.728 att = provider.create_database(dsn, dpb, 'utf-8' if utf8filename else FS_ENCODING)
2024-05-12 19:15:46.733 con = Connection(att, dsn, dpb, sql_dialect, charset)
2024-05-12 19:15:46.738 else:
2024-05-12 19:15:46.742 con = None
2024-05-12 19:15:46.748 for hook in get_callbacks(ConnectionHook.ATTACH_REQUEST, Connection):
2024-05-12 19:15:46.752 try:
2024-05-12 19:15:46.757 con = hook(dsn, dpb)
2024-05-12 19:15:46.762 except Exception as e:
2024-05-12 19:15:46.767 raise InterfaceError("Error in DATABASE_ATTACH_REQUEST hook.", *e.args) from e
2024-05-12 19:15:46.771 if con is not None:
2024-05-12 19:15:46.776 break
2024-05-12 19:15:46.780 if con is None:
2024-05-12 19:15:46.787 > att = provider.attach_database(dsn, dpb, 'utf-8' if utf8filename else FS_ENCODING)
2024-05-12 19:15:46.791
2024-05-12 19:15:46.796 ../lib/python3.11/site-packages/firebird/driver/core.py:2064:
2024-05-12 19:15:46.801 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 19:15:46.806
2024-05-12 19:15:46.811 self = <firebird.driver.interfaces.iProvider object at [hex]>
2024-05-12 19:15:46.816 filename = 'localhost/3702:/var/tmp/qa_2024/test_1266/test.fdb'
2024-05-12 19:15:46.821 dpb = b'\x01\x1c\x0eTMP$C1642_ALAN\x1d\x03123?\x04\x03\x00\x00\x00'
2024-05-12 19:15:46.825 encoding = 'utf-8'
2024-05-12 19:15:46.830
2024-05-12 19:15:46.834 def attach_database(self, filename: str, dpb: Optional[bytes] = None, encoding: str = 'ascii') -> iAttachment:
2024-05-12 19:15:46.839 "Replaces `isc_attach_database()`"
2024-05-12 19:15:46.844 result = self.vtable.attachDatabase(self, self.status, filename.encode(encoding),
2024-05-12 19:15:46.849 0 if dpb is None else len(dpb), dpb)
2024-05-12 19:15:46.854 > self._check()
2024-05-12 19:15:46.860
2024-05-12 19:15:46.865 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:1295:
2024-05-12 19:15:46.870 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-05-12 19:15:46.875
2024-05-12 19:15:46.880 self = <firebird.driver.interfaces.iProvider object at [hex]>
2024-05-12 19:15:46.884
2024-05-12 19:15:46.889 def _check(self) -> None:
2024-05-12 19:15:46.893 state = self.status.get_state()
2024-05-12 19:15:46.898 if StateFlag.ERRORS in state:
2024-05-12 19:15:46.904 > raise self.__report(DatabaseError, self.status.get_errors())
2024-05-12 19:15:46.909 E firebird.driver.types.DatabaseError: Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
2024-05-12 19:15:46.914
2024-05-12 19:15:46.919 ../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
2024-05-12 19:15:46.927 ---------------------------- Captured stdout setup -----------------------------
2024-05-12 19:15:46.934 Cached db: db-12.0-None-None-NONE.fdb [page_size=None, sql_dialect=None, charset='NONE'
2024-05-12 19:15:46.939 DROP user: TMP$C1642_ALAN PLUGIN: Srp
2024-05-12 19:15:46.944 CREATE user: TMP$C1642_ALAN PLUGIN: Srp
2024-05-12 19:15:46.948 DROP user: TMP$C1642_JOHN PLUGIN: Srp
2024-05-12 19:15:46.956 CREATE user: TMP$C1642_JOHN PLUGIN: Srp
2024-05-12 19:15:46.961 CREATE user: TMP$C1642_MICK PLUGIN: Srp
2024-05-12 19:15:46.967 --------------------------- Captured stdout teardown ---------------------------
2024-05-12 19:15:46.971 DROP user: TMP$C1642_MICK PLUGIN: Srp
2024-05-12 19:15:46.976 DROP user: TMP$C1642_JOHN PLUGIN: Srp
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
user_1 = <firebird.qa.plugin.User pytest object at [hex]>
user_2 = <firebird.qa.plugin.User pytest object at [hex]>
user_3 = <firebird.qa.plugin.User pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=2.5')
def test_1(act: Action, user_1: User, user_2: User, user_3: User, capsys):
act.expected_stdout = expected_stdout
for user in [user_1, user_2, user_3]:
> with act.db.connect(user=user.name, password=user.password) as con:
tests/bugs/core_1642_test.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
database = '/var/tmp/qa_2024/test_1266/test.fdb'
def connect(database: str, *, user: str=None, password: str=None, role: str=None,
no_gc: bool=None, no_db_triggers: bool=None, dbkey_scope: DBKeyScope=None,
crypt_callback: iCryptKeyCallbackImpl=None, charset: str=None,
auth_plugin_list: str=None, session_time_zone: str=None) -> Connection:
"""Establishes a connection to the database.
Arguments:
database: DSN or Database configuration name.
user: User name.
password: User password.
role: User role.
no_gc: Do not perform garbage collection for this connection.
no_db_triggers: Do not execute database triggers for this connection.
dbkey_scope: DBKEY scope override for connection.
crypt_callback: Callback that provides encryption key for the database.
charset: Character set for connection.
auth_plugin_list: List of authentication plugins override
session_time_zone: Session time zone [Firebird 4]
Hooks:
Event `.ConnectionHook.ATTACH_REQUEST`: Executed after all parameters
are preprocessed and before `Connection` is created. Hook
must have signature::
hook_func(dsn: str, dpb: bytes) -> Optional[Connection]
Hook may return `Connection` instance or None.
First instance returned by any hook will become the return value
of this function and other hooks are not called.
Event `.ConnectionHook.ATTACHED`: Executed before `Connection` instance is
returned. Hook must have signature::
hook_func(connection: Connection) -> None
Any value returned by hook is ignored.
"""
db_config = driver_config.get_database(database)
if db_config is None:
db_config = driver_config.db_defaults
else:
database = db_config.database.value
if db_config.server.value is None:
srv_config = driver_config.server_defaults
else:
srv_config = driver_config.get_server(db_config.server.value)
if srv_config is None:
raise ValueError(f"Configuration for server '{db_config.server.value}' not found")
if user is None:
user = db_config.user.value
if user is None:
user = srv_config.user.value
if password is None:
password = db_config.password.value
if password is None:
password = srv_config.password.value
if role is None:
role = db_config.role.value
if charset is None:
charset = db_config.charset.value
if charset:
charset = charset.upper()
if auth_plugin_list is None:
auth_plugin_list = db_config.auth_plugin_list.value
if session_time_zone is None:
session_time_zone = db_config.session_time_zone.value
dsn = _connect_helper(db_config.dsn.value, srv_config.host.value, srv_config.port.value,
database, db_config.protocol.value)
dpb = DPB(user=user, password=password, role=role, trusted_auth=db_config.trusted_auth.value,
sql_dialect=db_config.sql_dialect.value, timeout=db_config.timeout.value,
charset=charset, cache_size=db_config.cache_size.value,
no_linger=db_config.no_linger.value, utf8filename=db_config.utf8filename.value,
no_gc=no_gc, no_db_triggers=no_db_triggers, dbkey_scope=dbkey_scope,
dummy_packet_interval=db_config.dummy_packet_interval.value,
config=db_config.config.value, auth_plugin_list=auth_plugin_list,
session_time_zone=session_time_zone, set_bind=db_config.set_bind.value,
decfloat_round=db_config.decfloat_round.value,
decfloat_traps=db_config.decfloat_traps.value,
parallel_workers=db_config.parallel_workers.value)
> return __make_connection(False, dsn, db_config.utf8filename.value, dpb.get_buffer(),
db_config.sql_dialect.value, charset, crypt_callback)
../lib/python3.11/site-packages/firebird/driver/core.py:2149:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
create = False, dsn = 'localhost/3702:/var/tmp/qa_2024/test_1266/test.fdb'
utf8filename = False
dpb = b'\x01\x1c\x0eTMP$C1642_ALAN\x1d\x03123?\x04\x03\x00\x00\x00'
sql_dialect = 3, charset = None, crypt_callback = None
def __make_connection(create: bool, dsn: str, utf8filename: bool, dpb: bytes,
sql_dialect: int, charset: str,
crypt_callback: iCryptKeyCallbackImpl) -> Connection:
with a.get_api().master.get_dispatcher() as provider:
if crypt_callback is not None:
provider.set_dbcrypt_callback(crypt_callback)
if create:
att = provider.create_database(dsn, dpb, 'utf-8' if utf8filename else FS_ENCODING)
con = Connection(att, dsn, dpb, sql_dialect, charset)
else:
con = None
for hook in get_callbacks(ConnectionHook.ATTACH_REQUEST, Connection):
try:
con = hook(dsn, dpb)
except Exception as e:
raise InterfaceError("Error in DATABASE_ATTACH_REQUEST hook.", *e.args) from e
if con is not None:
break
if con is None:
> att = provider.attach_database(dsn, dpb, 'utf-8' if utf8filename else FS_ENCODING)
../lib/python3.11/site-packages/firebird/driver/core.py:2064:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iProvider pytest object at [hex]>
filename = 'localhost/3702:/var/tmp/qa_2024/test_1266/test.fdb'
dpb = b'\x01\x1c\x0eTMP$C1642_ALAN\x1d\x03123?\x04\x03\x00\x00\x00'
encoding = 'utf-8'
def attach_database(self, filename: str, dpb: Optional[bytes] = None, encoding: str = 'ascii') -> iAttachment:
"Replaces `isc_attach_database()`"
result = self.vtable.attachDatabase(self, self.status, filename.encode(encoding),
0 if dpb is None else len(dpb), dpb)
> self._check()
../lib/python3.11/site-packages/firebird/driver/interfaces.py:1295:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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: Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
../lib/python3.11/site-packages/firebird/driver/interfaces.py:113: DatabaseError
|