2 @message |
firebird.driver.types.DatabaseError: message length error (encountered 32, expected 65568)
-gds_$receive failed
-Exiting before completion due to errors
LOG DETAILS:
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 act = <firebird.qa.plugin.Action object at [hex]>
2024-03-29 21:56:50.717 db_tmp = <firebird.qa.plugin.Database object at [hex]>
2024-03-29 21:56:50.717 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 @pytest.mark.version('>=4.0')
2024-03-29 21:56:50.717 def test_1(act: Action, db_tmp: Database, capsys):
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 #with act.db.connect() as con:
2024-03-29 21:56:50.717 # if act.is_version('>=5'):
2024-03-29 21:56:50.717 # pytest.skip("currently works only in FB 4.x.")
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 backup = BytesIO()
2024-03-29 21:56:50.717 with act.connect_server() as srv:
2024-03-29 21:56:50.717 # 5.0.0.882:
2024-03-29 21:56:50.717 # firebird.driver.types.DatabaseError: message length error (encountered 32, expected 65568)
2024-03-29 21:56:50.717 # -gds_$receive failed
2024-03-29 21:56:50.717 # -Exiting before completion due to errors
2024-03-29 21:56:50.717 #
2024-03-29 21:56:50.717 > srv.database.local_backup(database=act.db.db_path, backup_stream=backup)
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 tests\bugs\gh_7436_test.py:263:
2024-03-29 21:56:50.717 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 self = <firebird.driver.core.ServerDbServices4 object at [hex]>
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 def local_backup(self, *, database: FILESPEC, backup_stream: BinaryIO,
2024-03-29 21:56:50.717 flags: SrvBackupFlag=SrvBackupFlag.NONE, role: str=None,
2024-03-29 21:56:50.717 skip_data: str=None, include_data: str=None, keyhoder: str=None,
2024-03-29 21:56:50.717 keyname: str=None, crypt: str=None) -> None:
2024-03-29 21:56:50.717 """Request logical (GBAK) database backup into local byte stream. **(SYNC service)**
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 Arguments:
2024-03-29 21:56:50.717 database: Database specification or alias.
2024-03-29 21:56:50.717 backup_stream: Binary stream to which the backup is to be written.
2024-03-29 21:56:50.717 flags: Backup options.
2024-03-29 21:56:50.717 role: SQL ROLE name passed to gbak.
2024-03-29 21:56:50.717 skip_data: String with table names whose data should be excluded from backup.
2024-03-29 21:56:50.717 include_data: String with table names whose data should be included into backup [Firebird 4].
2024-03-29 21:56:50.717 keyholder: Keyholder name [Firebird 4]
2024-03-29 21:56:50.717 keyname: Key name [Firebird 4]
2024-03-29 21:56:50.717 crypt: Encryption specification [Firebird 4]
2024-03-29 21:56:50.717 """
2024-03-29 21:56:50.717 self._srv()._reset_output()
2024-03-29 21:56:50.717 with a.get_api().util.get_xpb_builder(XpbKind.SPB_START) as spb:
2024-03-29 21:56:50.717 spb.insert_tag(ServerAction.BACKUP)
2024-03-29 21:56:50.717 spb.insert_string(SPBItem.DBNAME, str(database), encoding=self._srv().encoding)
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.FILE, 'stdout')
2024-03-29 21:56:50.717 spb.insert_int(SPBItem.OPTIONS, flags)
2024-03-29 21:56:50.717 if role is not None:
2024-03-29 21:56:50.717 spb.insert_string(SPBItem.SQL_ROLE_NAME, role, encoding=self._srv().encoding)
2024-03-29 21:56:50.717 if skip_data is not None:
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.SKIP_DATA, skip_data,
2024-03-29 21:56:50.717 encoding=self._srv().encoding)
2024-03-29 21:56:50.717 if include_data is not None:
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.INCLUDE_DATA, include_data,
2024-03-29 21:56:50.717 encoding=self._srv().encoding)
2024-03-29 21:56:50.717 if keyhoder is not None:
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.KEYHOLDER, keyhoder)
2024-03-29 21:56:50.717 if keyname is not None:
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.KEYNAME, keyname)
2024-03-29 21:56:50.717 if crypt is not None:
2024-03-29 21:56:50.717 spb.insert_string(SrvBackupOption.CRYPT, crypt)
2024-03-29 21:56:50.717 self._srv()._svc.start(spb.get_buffer())
2024-03-29 21:56:50.717 while not self._srv()._eof:
2024-03-29 21:56:50.717 > backup_stream.write(self._srv()._read_next_binary_output())
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 C:\Python3x\Lib\site-packages\firebird\driver\core.py:4424:
2024-03-29 21:56:50.717 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 self = <firebird.driver.core.Server object at [hex]>
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 def _read_next_binary_output(self, *, timeout: int=-1) -> bytes:
2024-03-29 21:56:50.717 assert self._svc is not None
2024-03-29 21:56:50.717 result = None
2024-03-29 21:56:50.717 if not self._eof:
2024-03-29 21:56:50.717 send = self._make_request(timeout)
2024-03-29 21:56:50.717 self.response.clear()
2024-03-29 21:56:50.717 > self._svc.query(send, bytes([SrvInfoCode.TO_EOF]), self.response.raw)
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 C:\Python3x\Lib\site-packages\firebird\driver\core.py:5399:
2024-03-29 21:56:50.717 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 self = <firebird.driver.interfaces.iService object at [hex]>
2024-03-29 21:56:50.717 send = None, receive = b'?'
2024-03-29 21:56:50.717 buffer = <ctypes.c_char_Array_65535 object at [hex]>
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 def query(self, send: bytes, receive: bytes, buffer: bytes) -> None:
2024-03-29 21:56:50.717 """Send and request information to/from service, with different `receive`
2024-03-29 21:56:50.717 may be used for both running services and to obtain various server-wide information.
2024-03-29 21:56:50.717 Replaces `isc_service_query()`.
2024-03-29 21:56:50.717 """
2024-03-29 21:56:50.717 self.vtable.query(self, self.status, 0 if send is None else len(send),
2024-03-29 21:56:50.717 send, len(receive), receive, len(buffer), buffer)
2024-03-29 21:56:50.717 > self._check()
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:1258:
2024-03-29 21:56:50.717 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 self = <firebird.driver.interfaces.iService object at [hex]>
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 def _check(self) -> None:
2024-03-29 21:56:50.717 state = self.status.get_state()
2024-03-29 21:56:50.717 if StateFlag.ERRORS in state:
2024-03-29 21:56:50.717 > raise self.__report(DatabaseError, self.status.get_errors())
2024-03-29 21:56:50.717 E firebird.driver.types.DatabaseError: message length error (encountered 32, expected 65568)
2024-03-29 21:56:50.717 E -gds_$receive failed
2024-03-29 21:56:50.717 E -Exiting before completion due to errors
2024-03-29 21:56:50.717
2024-03-29 21:56:50.717 C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:113: DatabaseError
2024-03-29 21:56:50.717 ---------------------------- Captured stdout setup ----------------------------
2024-03-29 21:56:50.717 Cached db: db-13.0-None-None-WIN1251.fdb [page_size=None, sql_dialect=None, charset='WIN1251'
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
db_tmp = <firebird.qa.plugin.Database pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=4.0')
def test_1(act: Action, db_tmp: Database, capsys):
#with act.db.connect() as con:
# if act.is_version('>=5'):
# pytest.skip("currently works only in FB 4.x.")
backup = BytesIO()
with act.connect_server() as srv:
# 5.0.0.882:
# firebird.driver.types.DatabaseError: message length error (encountered 32, expected 65568)
# -gds_$receive failed
# -Exiting before completion due to errors
#
> srv.database.local_backup(database=act.db.db_path, backup_stream=backup)
tests\bugs\gh_7436_test.py:263:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.core.ServerDbServices4 pytest object at [hex]>
def local_backup(self, *, database: FILESPEC, backup_stream: BinaryIO,
flags: SrvBackupFlag=SrvBackupFlag.NONE, role: str=None,
skip_data: str=None, include_data: str=None, keyhoder: str=None,
keyname: str=None, crypt: str=None) -> None:
"""Request logical (GBAK) database backup into local byte stream. **(SYNC service)**
Arguments:
database: Database specification or alias.
backup_stream: Binary stream to which the backup is to be written.
flags: Backup options.
role: SQL ROLE name passed to gbak.
skip_data: String with table names whose data should be excluded from backup.
include_data: String with table names whose data should be included into backup [Firebird 4].
keyholder: Keyholder name [Firebird 4]
keyname: Key name [Firebird 4]
crypt: Encryption specification [Firebird 4]
"""
self._srv()._reset_output()
with a.get_api().util.get_xpb_builder(XpbKind.SPB_START) as spb:
spb.insert_tag(ServerAction.BACKUP)
spb.insert_string(SPBItem.DBNAME, str(database), encoding=self._srv().encoding)
spb.insert_string(SrvBackupOption.FILE, 'stdout')
spb.insert_int(SPBItem.OPTIONS, flags)
if role is not None:
spb.insert_string(SPBItem.SQL_ROLE_NAME, role, encoding=self._srv().encoding)
if skip_data is not None:
spb.insert_string(SrvBackupOption.SKIP_DATA, skip_data,
encoding=self._srv().encoding)
if include_data is not None:
spb.insert_string(SrvBackupOption.INCLUDE_DATA, include_data,
encoding=self._srv().encoding)
if keyhoder is not None:
spb.insert_string(SrvBackupOption.KEYHOLDER, keyhoder)
if keyname is not None:
spb.insert_string(SrvBackupOption.KEYNAME, keyname)
if crypt is not None:
spb.insert_string(SrvBackupOption.CRYPT, crypt)
self._srv()._svc.start(spb.get_buffer())
while not self._srv()._eof:
> backup_stream.write(self._srv()._read_next_binary_output())
C:\Python3x\Lib\site-packages\firebird\driver\core.py:4424:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.core.Server pytest object at [hex]>
def _read_next_binary_output(self, *, timeout: int=-1) -> bytes:
assert self._svc is not None
result = None
if not self._eof:
send = self._make_request(timeout)
self.response.clear()
> self._svc.query(send, bytes([SrvInfoCode.TO_EOF]), self.response.raw)
C:\Python3x\Lib\site-packages\firebird\driver\core.py:5399:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iService pytest object at [hex]>
send = None, receive = b'?'
buffer = <ctypes.c_char_Array_65535 pytest object at [hex]>
def query(self, send: bytes, receive: bytes, buffer: bytes) -> None:
"""Send and request information to/from service, with different `receive`
may be used for both running services and to obtain various server-wide information.
Replaces `isc_service_query()`.
"""
self.vtable.query(self, self.status, 0 if send is None else len(send),
send, len(receive), receive, len(buffer), buffer)
> self._check()
C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:1258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <firebird.driver.interfaces.iService 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: message length error (encountered 32, expected 65568)
E -gds_$receive failed
E -Exiting before completion due to errors
C:\Python3x\Lib\site-packages\firebird\driver\interfaces.py:113: DatabaseError
|