Test framework JSONRPCException should specify which node failed #12945

issue Sjors opened this issue on April 11, 2018
  1. Sjors commented at 2:11 PM on April 11, 2018: member

    I can guess from context, and by trial and error, which node was throwing this exception (a v0.15 node that I tested for backwards compatibility while rebasing #12134). But it's not very clear from the messages.

     ... 
     node0 2018-04-11T13:35:49.811352Z Received a POST request for / from 127.0.0.1:49312 
     node0 2018-04-11T13:35:49.811429Z ThreadRPCServer method=syncwithvalidationinterfacequeue user=__cookie__ 
     node1 2018-04-11T13:35:49.811966Z Received a POST request for / from 127.0.0.1:49314 
     node1 2018-04-11T13:35:49.812043Z ThreadRPCServer method=syncwithvalidationinterfacequeue user=__cookie__ 
     test  2018-04-11T13:35:49.813000Z TestFramework (ERROR): JSONRPC error
    
    Traceback (most recent call last):
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/test_framework.py", line 146, in main
    
        self.setup_network()
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/test_framework.py", line 224, in setup_network
    
        self.sync_all()
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/test_framework.py", line 331, in sync_all
    
        sync_mempools(group)
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/util.py", line 394, in sync_mempools
    
        r.syncwithvalidationinterfacequeue()
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/coverage.py", line 47, in __call__
    
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    
      File "/Volumes/SSD/src/bitcoin/test/functional/test_framework/authproxy.py", line 138, in __call__
    
        raise JSONRPCException(response['error'])
    
    test_framework.authproxy.JSONRPCException: Method not found (-32601) 
     test  2018-04-11T13:35:49.814000Z TestFramework (INFO): Stopping nodes 
     test  2018-04-11T13:35:49.814000Z TestFramework.node0 (DEBUG): Stopping node 
     node0 2018-04-11T13:35:49.814963Z Received a POST request for / from 127.0.0.1:49312 
    ...
    

    cc @jnewbery

  2. fanquake added the label Tests on Apr 11, 2018
  3. jnewbery commented at 8:24 PM on April 11, 2018: member

    At the moment, the AuthServiceProxy object doesn't know anything about which node it's connected to. You could easily change that by updating get_rpc_proxy() to pass in the node_number, have that stored by AuthServiceProxy's __init__ method, and then have it passed into the JSONRPCException.

    It's quite unusual that the stack trace doesn't indicate which node the RPC is being called on, and it's fairly easy to add pdb tracepoints or additional logging where that's not the case, so I don't know how useful this would be in general.

  4. Sjors commented at 9:06 AM on April 12, 2018: member

    Maybe close as up for grabs?

  5. jnewbery added the label Up for grabs on Apr 12, 2018
  6. jnewbery closed this on Apr 12, 2018

  7. MarcoFalke locked this on Sep 8, 2021
  8. MarcoFalke removed the label Up for grabs on Mar 22, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 09:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me