Opened 3 weeks ago
Last modified 43 hours ago
#32552 new defect
stem says "dictionary keys changed during iteration" with new python
Reported by: | cypherpunks | Owned by: | atagar |
---|---|---|---|
Priority: | Medium | Milestone: | |
Component: | Core Tor/Nyx | Version: | Tor: 0.4.1.6 |
Severity: | Normal | Keywords: | |
Cc: | atagar | Actual Points: | |
Parent ID: | Points: | ||
Reviewer: | Sponsor: |
Description
Every single time I try to connect to for from Nyx I get
Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/stem/connection.py", line 370, in _connect_auth authenticate(control_socket, password, chroot_path) File "/usr/lib/python3.8/site-packages/stem/connection.py", line 625, in authenticate raise auth_exc stem.connection.MissingPassword: no passphrase provided During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/nyx", line 11, in <module> load_entry_point('nyx==2.1.0', 'console_scripts', 'nyx')() File "/usr/lib/python3.8/site-packages/nyx/__init__.py", line 176, in main nyx.starter.main() File "/usr/lib/python3.8/site-packages/stem/util/conf.py", line 289, in wrapped return func(*args, config = config, **kwargs) File "/usr/lib/python3.8/site-packages/nyx/starter.py", line 90, in main controller = init_controller( File "/usr/lib/python3.8/site-packages/nyx/__init__.py", line 325, in init_controller TOR_CONTROLLER = stem.connection.connect(*args, **kwargs) File "/usr/lib/python3.8/site-packages/stem/connection.py", line 291, in connect return _connect_auth(control_connection, password, password_prompt, chroot_path, controller) File "/usr/lib/python3.8/site-packages/stem/connection.py", line 404, in _connect_auth return _connect_auth(control_socket, password, password_prompt, chroot_path, controller) File "/usr/lib/python3.8/site-packages/stem/connection.py", line 375, in _connect_auth return controller(control_socket, is_authenticated = True) File "/usr/lib/python3.8/site-packages/stem/control.py", line 1057, in __init__ super(Controller, self).__init__(control_socket, is_authenticated) File "/usr/lib/python3.8/site-packages/stem/control.py", line 585, in __init__ self._post_authentication() File "/usr/lib/python3.8/site-packages/stem/control.py", line 3902, in _post_authentication owning_pid = self.get_conf('__OwningControllerProcess', None) File "/usr/lib/python3.8/site-packages/stem/control.py", line 2170, in get_conf entries = self.get_conf_map(param, default, multiple) File "/usr/lib/python3.8/site-packages/stem/control.py", line 2273, in get_conf_map for key in reply: RuntimeError: dictionary keys changed during iteration
Using Arch Linux on a headless server, python 3.8.0b4. Tried both cookie and password authentication methods. Controlport is 9051, inaccessible from outside (firewall set up to allow any internal connections to any port)
Child Tickets
Ticket | Status | Owner | Summary | Component |
---|---|---|---|---|
#32566 | closed | atagar | nyx not starting | Core Tor/Nyx |
Change History (9)
comment:1 Changed 3 weeks ago by
comment:2 Changed 3 weeks ago by
Cc: | atagar added |
---|---|
Component: | Applications → Core Tor/Nyx |
Owner: | set to atagar |
Looks like the same as #32525 and #32533.
The current advice is that if you want to use a super new python, then you should use a super new stem too (get it from git).
Damian, we had a person on #tor have this issue yesterday, and here is yet another ticket about it. I bet there will be more confused nyx users. Might be smart to reconsider whether to do a Stem stable release if there is such a concept.
comment:3 Changed 3 weeks ago by
Hi Roger. There certainly is a sharp uptick in these reports over the last couple days which begs the question: what changed?
This bug was originally reported by teor on #30882 but I was unable to reproduce this issue with python 3.5. I'm not positive what's up, but I suspect it's something like the following...
- This bug only occurs with new python versions (3.8?).
- Python 2.x is discontinuing at the end of 2019.
- A popular linux distribution (probably Debian and Ubuntu) finally made the python 3.x switch and picked the latest interpreter, causing the sharp uptick of this issue from 'obscure' to 'frequent'.
I plan to release Stem 1.8 in December, concluding our Python 2.x support and Stem's 1.x series. Hidden service v3 support is not mature enough to cut a stable release right now.
I hate to hotfix when we're so near another release but if folks would like I could provide a Stem 1.7.2 release with this one line fix. However, if I'm correct that the uptick in these reports are coming from a new linux distribution this likely won't resolve confusion (due to debian's glacial pace). That said, it would change the steps to fix this from...
% git clone https://git.torproject.org/stem.git % cd stem % sudo python setup.py --install
... to...
% sudo pip install --upgrade stem
Would folks prefer a hotfix or to wait for the Stem 1.8 release?
comment:4 Changed 3 weeks ago by
As for Debian or Ubuntu, this ticket is about Arch.
I think your question is exactly the right one: do a hotfix now, or wait some more weeks for the intended next release?
I guess it depends in part on how many more confused users we hear from -- and how many confused users we think that there are behind the scenes who just aren't reporting the breakage.
comment:7 Changed 3 weeks ago by
Assumptions:
- Arch now ships the Python that exposes the stem bug
- We need to get those arch users a newer stem
- It will take a while, after the release of the newer stem, for arch to give it to them
Leads to:
- We should do a stem release asap that has this fix, so arch can begin the process of getting it to them.
i.e. the above reasoning argues for the hotfix.
https://www.archlinux.org/packages/community/any/python-stem/ looks like it might be the package that will want the update.
comment:8 Changed 2 weeks ago by
Summary: | can't connect to for, whether using cookie or password → stem says "dictionary keys changed during iteration" with new python |
---|
comment:9 Changed 43 hours ago by
After a lot of failed debugging, I found this thread by googling: tor stem dictionary keys changed during iteration.
I uninstalled Python 3.8 then installed Python 3.7. The problem went away. Solved. Thank you!
I thought I should add my two cents because I'm using Windows 10.
Stem version: 1.7.1
*can't connect to tor not for