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] dictionary changed size during iteration #15142

Closed
bramv-chia opened this issue Apr 26, 2023 · 5 comments · Fixed by #15149 or #15150
Closed

[Bug] dictionary changed size during iteration #15142

bramv-chia opened this issue Apr 26, 2023 · 5 comments · Fixed by #15149 or #15150
Assignees
Labels
1.8.0 bug Something isn't working

Comments

@bramv-chia
Copy link

What happened?

when switching between wallets
wallet_change_error_GUI
occured.
after clicking [OK] and clicking on the desired wallet, it will load without issue

Version

1.8.0rc3

What platform are you using?

Windows

What ui mode are you using?

GUI

Relevant log output or stacktrace

No response

@bramv-chia bramv-chia added the bug Something isn't working label Apr 26, 2023
@paninaro
Copy link
Contributor

Interestingly, this is actually a python error message. @bramv-chia any chance you can find that error message in your debug log?

@paninaro paninaro added the 1.8.0 label Apr 27, 2023
@bramv-chia
Copy link
Author

@paninaro
2023-04-26T07:06:48.114 wallet chia.wallet.wallet_node : INFO Sync (trusted: True) duration was: 51.454047441482544
2023-04-26T07:06:48.148 wallet chia.rpc.rpc_server : WARNING Error while handling message: Traceback (most recent call last):
File "chia\rpc\rpc_server.py", line 340, in safe_handle
File "chia\rpc\rpc_server.py", line 331, in ws_api
File "chia\rpc\wallet_rpc_api.py", line 317, in log_in
File "chia\wallet\wallet_node.py", line 388, in _start_with_fingerprint
RuntimeError: dictionary changed size during iteration

@paninaro
Copy link
Contributor

Thanks @bramv-chia I'll transfer this to the blockchain repo and assign it.

@paninaro paninaro transferred this issue from Chia-Network/chia-blockchain-gui Apr 27, 2023
@paninaro
Copy link
Contributor

paninaro commented Apr 27, 2023

@trepca @xdustinface the error message shown in the GUI is originating from the backend when logging into a wallet key. Bram provided the following debug.log output:

2023-04-26T07:06:48.114 wallet chia.wallet.wallet_node : INFO Sync (trusted: True) duration was: 51.454047441482544
2023-04-26T07:06:48.148 wallet chia.rpc.rpc_server : WARNING Error while handling message: Traceback (most recent call last):
File "chia\rpc\rpc_server.py", line 340, in safe_handle
File "chia\rpc\rpc_server.py", line 331, in ws_api
File "chia\rpc\wallet_rpc_api.py", line 317, in log_in
File "chia\wallet\wallet_node.py", line 388, in _start_with_fingerprint
RuntimeError: dictionary changed size during iteration

Looks to me like it the collection of wallets is updating while iterating over it:

        # Populate the balance caches for all wallets
        for wallet_id in self.wallet_state_manager.wallets:
            await self.get_balance(wallet_id)

@paninaro
Copy link
Contributor

Closing since @xdustinface has made a couple of fixes in this area including #15149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment