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

[BUG] 0.7.1 onionbalance raises ImportError #30

Closed
conneryn opened this issue Jan 17, 2023 · 3 comments
Closed

[BUG] 0.7.1 onionbalance raises ImportError #30

conneryn opened this issue Jan 17, 2023 · 3 comments
Assignees
Labels
bug Something isn't working container onionbalance
Milestone

Comments

@conneryn
Copy link
Contributor

conneryn commented Jan 17, 2023

Describe the bug
The latest build (0.7.1) of the onionbalanace-manager is failing to run onionbalance successfully, as it throws an Import Error:

ImportError: Hidden service descriptor decryption requires cryptography version 2.6

To Reproduce
Create an OnionBalancedService using the latest version (0.7.1 docker containers).

Expected behavior
The OnionBalanceService should startup without issues, and the onion service should be discoverable.

Additional information

Error logs from the onionbalance container in the daemon pod:

[...]
2023-01-17 15:39:05,078 [WARNING]: Onionbalance initialized (stem version: 1.8.1) (tor version: 0.4.6.10 (git-22fd351cf582aa2b))!
2023-01-17 15:39:05,078 [WARNING]: ================================================================================
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/onionbalance/hs_v3/stem_controller.py", line 39, in handle_new_desc_content_event_wrapper
    my_onionbalance.handle_new_desc_content_event(desc_content_event)
  File "/usr/lib/python3.10/site-packages/onionbalance/hs_v3/onionbalance.py", line 148, in handle_new_desc_content_event
    instance.register_descriptor(descriptor_text, onion_address)
  File "/usr/lib/python3.10/site-packages/onionbalance/hs_v3/instance.py", line 57, in register_descriptor
    new_descriptor = ob_descriptor.ReceivedDescriptor(descriptor_text, onion_address)
  File "/usr/lib/python3.10/site-packages/onionbalance/hs_v3/descriptor.py", line 275, in __init__
    v3_desc.decrypt(onion_address)
  File "/usr/lib/python3.10/site-packages/stem/descriptor/hidden_service.py", line 1081, in decrypt
    raise ImportError('Hidden service descriptor decryption requires cryptography version 2.6')
ImportError: Hidden service descriptor decryption requires cryptography version 2.6

Between container images 0.7.0 and 0.7.1, the base version of alpine was upgraded from 3.16.2 to 3.17.1, which in turn caused several dependencies to be upgraded. Namely, py3-cyrptography is upgraded from 3.4.8 to 38.0.3

In the previous version (0.7.0), I would receive a deprecation warning:

2023-01-17 20:14:44,594 [WARNING]: Onionbalance initialized (stem version: 1.8.0) (tor version: 0.4.6.10 (git-22fd351cf582aa2b))!
2023-01-17 20:14:44,594 [WARNING]: ================================================================================
/usr/lib/python3.10/site-packages/stem/prereq.py:142: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes, int_to_bytes

Therefore, this is potentially related to: torproject/stem#118 (as int_from_bytes has been fully deprecated as of cryptography version 37.x). Although, there have been many other deprecations/changes between 3.4.8 and 38.0.3, so it really could be a number of things.

System (please complete the following information):

  • Platform: amd64
  • Version 0.7.1
@conneryn
Copy link
Contributor Author

conneryn commented Jan 17, 2023

I think simply pinning the alpine version could be a work-around, for now (see #31).

@bugfest
Copy link
Owner

bugfest commented Jan 18, 2023

Thanks again @conneryn, my bad I didn't double check it was working properly before release. #31 merged & building right now. Will release 0.7.2 for this fix and let you know

@bugfest bugfest added this to the 0.7.x milestone Jan 18, 2023
@bugfest bugfest self-assigned this Jan 18, 2023
@bugfest
Copy link
Owner

bugfest commented Jan 18, 2023

Released by #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working container onionbalance
Projects
None yet
Development

No branches or pull requests

2 participants