+
Skip to content

Conversation

cbeck88
Copy link
Contributor

@cbeck88 cbeck88 commented May 23, 2022

I am not sure if there's a better way to detect the error than searching for strings in the details, but this currently seems to me like the best available way.

we may backport this to 1.2

additional context:

This is what an insufficient funds error looks like, in release testing:

INFO:drain-accounts:82: Time to sync: 3.0057718753814697
INFO:drain-accounts:87: Starting balance prior to transfer: 237500000000000000
Traceback (most recent call last):
  File "drain-accounts.py", line 162, in <module>
    run_test(stub, amount, src_account.monitor_id, dest, args.max_seconds, args.token_id)
  File "drain-accounts.py", line 88, in run_test
    tx_resp = stub.SendPayment(
  File "/usr/local/lib/python3.8/dist-packages/grpc/_channel.py", line 946, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/usr/local/lib/python3.8/dist-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.INTERNAL
	details = "transactions_manager.build_transaction: Insufficient funds"
	debug_error_string = "{"created":"@1653184158.286040845","description":"Error received from peer ipv4:10.43.188.128:3229","file":"src/core/lib/surface/call.cc","file_line":903,"grpc_message":"transactions_manager.build_transaction: Insufficient funds","grpc_status":13}"

This is what it looks like when it's a fragmentation error:

debug_error_string = "{"created":"@1653232420.516201609","description":"Error received from peer ipv4:10.43.188.128:3229","file":"src/core/lib/surface/call.cc","file_line":903,"grpc_message":"transactions_manager.build_transaction: Insufficient funds due to UTXO fragmentation","grpc_status":13}"

This is where these strings come from in rust code:

/// Insufficient funds due to UTXO fragmentation

@cbeck88 cbeck88 self-assigned this May 23, 2022
@cbeck88 cbeck88 requested a review from a team May 24, 2022 00:07
Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>
@iamalwaysuncomfortable
Copy link
Contributor

I think in general - if we have the bandwidth on team, it'd be worth looking at refactoring some of the mobilecoind python towards better error handling, maybe updating some of the approaches, and adding a pylint check to CI. I know that's not the highest priority, but potentially worth it if we keep supporting mobilecoind.

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>
Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>
@cbeck88
Copy link
Contributor Author

cbeck88 commented May 24, 2022

this failed in jenkins like this:


INFO:integration_test:207: Checking counters
INFO:integration_test:213: All tests passed
+ cd /home/jenkins/agent/workspace/ilecoin-internal_deploy_diogenes/strategies
+ python3 drain-accounts.py --key-dir ./keys --dest-key-dir ./fog_keys --max-accounts 6 --fee 1024 --mobilecoind-host mobilecoind.diogenes.svc.cluster.local --mobilecoind-port 3229 --token-id 1
  File "drain-accounts.py", line 109
    except grpc.RpcError as e:
                             ^
IndentationError: unindent does not match any outer indentation level
[Pipeline] }
[Pipeline] // dir

@cbeck88
Copy link
Contributor Author

cbeck88 commented May 24, 2022

this failed in jenkins like so:

INFO:integration_test:207: Checking counters
INFO:integration_test:213: All tests passed
+ cd /home/jenkins/agent/workspace/ilecoin-internal_deploy_diogenes/strategies
+ python3 drain-accounts.py --key-dir ./keys --dest-key-dir ./fog_keys --max-accounts 6 --fee 1024 --mobilecoind-host mobilecoind.diogenes.svc.cluster.local --mobilecoind-port 3229 --token-id 1
  File "drain-accounts.py", line 117
    token_id=token_id,
           ^
SyntaxError: invalid syntax

@cbeck88 cbeck88 merged commit bae68b2 into master May 24, 2022
@cbeck88 cbeck88 deleted the drain-accounts-defrag branch May 24, 2022 20:14
cbeck88 added a commit that referenced this pull request May 24, 2022
* make drain accounts script handle defragmentation errors

* make it subtract fee from sending amount after successful defragmentation

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* fix indentation

* fix syntax

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>
cbeck88 added a commit that referenced this pull request May 25, 2022
* make drain accounts script handle defragmentation errors

* make it subtract fee from sending amount after successful defragmentation

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* Update mobilecoind/strategies/drain-accounts.py

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

* fix indentation

* fix syntax

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>

Co-authored-by: Mike Turner <zaphrod.beeblebrox@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载