Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_sync_with_encryption_and_password_change : "zlib.error: Error -3 while decompressing data: incorrect header check" instead of InvalidPasswordError #3658

Closed
moodyjon opened this issue Sep 10, 2022 · 3 comments · Fixed by #3667
Assignees
Labels
area: wallet type: bug Existing functionality is wrong or broken

Comments

@moodyjon
Copy link
Contributor

https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true

======================================================================
[3608](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3609)
ERROR: test_sync_with_encryption_and_password_change (integration.blockchain.test_wallet_commands.WalletEncryptionAndSynchronization)
[3609](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3610)
----------------------------------------------------------------------
[3610](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3611)
Traceback (most recent call last):
[3611](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3612)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/testcase.py", line 145, in run
[3612](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3613)
    self.loop.run_until_complete(maybe_coroutine)
[3613](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3614)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
[3614](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3615)
    return future.result()
[3615](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3616)
  File "/home/runner/work/lbry-sdk/lbry-sdk/tests/integration/blockchain/test_wallet_commands.py", line 389, in test_sync_with_encryption_and_password_change
[3616](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3617)
    await daemon.jsonrpc_sync_apply('password', data=data['data'], blocking=True)
[3617](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3618)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/extras/daemon/daemon.py", line 1994, in jsonrpc_sync_apply
[3618](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3619)
    added_accounts, merged_accounts = wallet.merge(self.wallet_manager, password, data)
[3619](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3620)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/wallet.py", line 181, in merge
[3620](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3621)
    decrypted_data = self.unpack(password, data)
[3621](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3622)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/wallet.py", line 174, in unpack
[3622](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3623)
    decompressed = zlib.decompress(decrypted)
[3623](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3624)
zlib.error: Error -3 while decompressing data: incorrect header check
[3624](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3625)

[3625](https://github.com/moodyjon/lbry-sdk/runs/8281333893?check_suite_focus=true#step:11:3626)
----------------------------------------------------------------------

Evidently the decrypted data appears to pass initial checks, but because the password is wrong, it's actually bad data that zlib cannot decompress.

        # need to use new password2 in sync_apply
        with self.assertRaises(InvalidPasswordError):
            await daemon.jsonrpc_sync_apply('password', data=data['data'], blocking=True)
@moodyjon moodyjon added type: bug Existing functionality is wrong or broken area: wallet labels Sep 10, 2022
@moodyjon
Copy link
Contributor Author

@moodyjon
Copy link
Contributor Author

A variant with slightly different error string:

zlib.error: Error -3 while decompressing data: unknown compression method

https://github.com/moodyjon/lbry-sdk/actions/runs/3091639309/jobs/5001957283

@moodyjon
Copy link
Contributor Author

Another one just discovered:

======================================================================
[470](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:471)
ERROR: test_sync_with_encryption_and_password_change (integration.blockchain.test_wallet_commands.WalletEncryptionAndSynchronization)
[471](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:472)
----------------------------------------------------------------------
[472](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:473)
Traceback (most recent call last):
[473](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:474)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/testcase.py", line 145, in run
[474](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:475)
    self.loop.run_until_complete(maybe_coroutine)
[475](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:476)
  File "/opt/hostedtoolcache/Python/3.7.15/x64/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
[476](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:477)
    return future.result()
[477](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:478)
  File "/home/runner/work/lbry-sdk/lbry-sdk/tests/integration/blockchain/test_wallet_commands.py", line 398, in test_sync_with_encryption_and_password_change
[478](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:479)
    await daemon.jsonrpc_sync_apply(bad_guess, data=data['data'], blocking=True)
[479](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:480)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/extras/daemon/daemon.py", line 1993, in jsonrpc_sync_apply
[480](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:481)
    added_accounts, merged_accounts = wallet.merge(self.wallet_manager, password, data)
[481](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:482)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/wallet.py", line 195, in merge
[482](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:483)
    decrypted_data = self.unpack(password, data)
[483](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:484)
  File "/home/runner/work/lbry-sdk/lbry-sdk/lbry/wallet/wallet.py", line 179, in unpack
[484](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:485)
    decompressed = zlib.decompress(decrypted)
[485](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:486)
zlib.error: Error -3 while decompressing data: invalid window size
[486](https://github.com/moodyjon/lbry-sdk/actions/runs/3447738325/jobs/5754062366#step:11:487)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: wallet type: bug Existing functionality is wrong or broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant