BitShares Forum

Main => Technical Support => Topic started by: monsterer on April 09, 2016, 08:31:35 pm

Title: [api] bizarre get_block error
Post by: monsterer on April 09, 2016, 08:31:35 pm
This is occuring on the MUSE chain, for some reason, calling the get_block() api call on certain blocks has started failing with a strange error:

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:530 get_array,data:{code:7,name:bad_cast_exception,message:Bad Cast,stack:[{context:{level:error,file:variant.cpp,line:53
0,method:get_array,hostname:,thread_name:th_a,timestamp:2016-04-09T20:28:59},format:Invalid cast from ${type} to Array,data:{type:object_type}}
]}}

If I call the function on the prior block it returns fine. Any ideas what could be causing this?
Title: Re: [api] bizarre get_block error
Post by: xeroc on April 09, 2016, 09:12:43 pm
Paging @pc
Title: Re: [api] bizarre get_block error
Post by: abit on April 09, 2016, 09:35:05 pm
This is occuring on the MUSE chain, for some reason, calling the get_block() api call on certain blocks has started failing with a strange error:

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:530 get_array,data:{code:7,name:bad_cast_exception,message:Bad Cast,stack:[{context:{level:error,file:variant.cpp,line:53
0,method:get_array,hostname:,thread_name:th_a,timestamp:2016-04-09T20:28:59},format:Invalid cast from ${type} to Array,data:{type:object_type}}
]}}

If I call the function on the prior block it returns fine. Any ideas what could be causing this?
Using an old cli_wallet with new witness_node? I guess it's caused by serialization changes on the extensions struct. Just guess, don't count on me.  :P
Title: Re: [api] bizarre get_block error
Post by: pc on April 09, 2016, 10:13:29 pm

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array


I'm with abit - this looks suspiciously like the API change we'd seen in BitShares in February.

get_block 4658091 works for me in the cli_wallet as well as via curl. Most likely your client is not compatible with the latest node.
Title: Re: [api] bizarre get_block error
Post by: monsterer on April 09, 2016, 10:30:38 pm
Many thanks guys - that was indeed the solution :)