steemit / sbds

Steem Blockchain Data Service
https://developers.steem.io/#services-sbds
Other
37 stars 23 forks source link

get_dynamic_global_properties() RPC throws 'v.size() == 2: method specification invalid. Should be api.method' #76

Closed hkjn closed 6 years ago

hkjn commented 7 years ago

Hi Steemit folks,

I attempted to run the dockerized sbds tool @ 1e867 just now, and hit an error which I traced to the get_dynamic_global_properties() RPC call.

I'm at:

$ git show
commit 1e867f89408ce915c44a88f399ae664168430120
Merge: 992969c e049eea
Author: Jeffrey Paul <sneak@acidhou.se>
Date:   Tue Sep 19 20:01:02 2017 -0500

Full error logged when building and running a container at that commit is:

$ docker build -t sbds . && docker run --name steem -it sbds
[...]
success connected to sqlite:////tmp/sqlite.db and found 36 tables
[2/6]   Initialising db if required...
{"levelname": "ERROR", "asctime": "2017-10-03T14:43:43.1507041823GMT", "filename": "populate.py", "module": "populate", "funcName": "_populate", "lineno": 238, "msecs": 250.08296966552734, "message": "ERROR", "name": "sbds.storages.db.scripts.populate", "pathname": "/usr/local/lib/python3.5/dist-packages/sbds/storages/db/scripts/populate.py", "process": 19, "processName": "MainProcess", "threadName": "MainThread", "exc_info": "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.5/dist-packages/sbds/storages/db/scripts/populate.py\", line 218, in _populate\n    steemd_http_url, task_num=3)\n  File \"/usr/local/lib/python3.5/dist-packages/sbds/storages/db/scripts/populate.py\", line 94, in task_get_last_irreversible_block\n    last_chain_block = rpc.last_irreversible_block_num()\n  File \"/usr/local/lib/python3.5/dist-packages/sbds/http_client.py\", line 195, in last_irreversible_block_num\n    return self.get_dynamic_global_properties()[\n  File \"/usr/local/lib/python3.5/dist-packages/sbds/http_client.py\", line 130, in exec\n    return_with_args=return_with_args)\n  File \"/usr/local/lib/python3.5/dist-packages/sbds/http_client.py\", line 151, in _return\n    raise RPCError(error_message)\nsbds.http_client.RPCError: Assert Exception:v.size() == 2: method specification invalid. Should be api.method"}

Using pdb to trace through the code, the following line seems to be originating the get_dynamic_global_properties() RPC call, which when its response is processed logs the error above:

The HTTP POST call to https://steemd.steemitdev.com sent at https://github.com/steemit/sbds/blob/master/sbds/http_client.py#L146 is what seems to fail, when request is:

{'body': b'{"id": 0, "params": [], "jsonrpc": "2.0", "method": "get_dynamic_global_properties"}'}

The response is:

{'message': 'Assert Exception:v.size() == 2: method specification invalid. Should be api.method', 'data': {'name': 'assert_exception', 'message': 'AssertException', 'code': 10, 'stack': [{'data': {}, 'context': {'level': 'error', 'line': 126, 'method': 'rpc', 'timestamp': '2017-10-03T1438:51', 'hostname': 
'', 'file': 'json_rpc_plugin.cpp'}, 'format': 'v.size() == 2: method specification invalid. Should be api.method'}]}, 'code': -32601}

I'm assuming this is due to a mismatch of the contract between client-code sending the request and the server-side code at steemd.steemitdev.com, but I'm not familiar enough with this code-base to say if it's the client or server-side code that needs to be fixed.

Let me know if I can file this bug elsewhere, or provide more info to help get this fixed.

hkjn commented 7 years ago

Also, the linked docs in the repo description don't seem to work: the URL https://developer.steem.io/ doesn't resolve currently.