On a freshly installed nodeos with the net_api_plugin trying to call v1/net/status results in this error:
{
"code": 500,
"message": "Internal Service Error",
"error": {
"code": 7,
"name": "bad_cast_exception",
"what": "Bad Cast",
"details": []
}
}
the node logs the following during that:
3160299ms thread-0 http_plugin.cpp:405 handle_exception ] FC Exception encountered while processing net.status
3160299ms thread-0 http_plugin.cpp:406 handle_exception ] Exception Details: 7 bad_cast_exception: Bad Cast
Invalid cast from object_type to string
{"type":"object_type"}
thread-0 variant.cpp:476 as_string
Can you show the full command for "v1/net/status". BTW is your nodeos work well?
curl -X GET http://localhost:3777/v1/net/status this is the full command.
yes, the nodeos seems to run fine, it gives me a proper response on v1/chain/get_info
@yankunsam
This issue is occurring in my freshly built 1.4.1 copy of EOS as well.
/v1/net/status gets the status for a particular peer, so you need to POST a json string of the peer you want the status of (via curl you might do this through --data-binary)
If you want the status of all connections you should use /v1/net/connections
Closing this as it appears to operating as designed
This could be improved dramatically by having a proper error message; "Internal server error" because an expected parameter (the peer) is missing is not friendly nor proper response for an api.
Most helpful comment
This could be improved dramatically by having a proper error message; "Internal server error" because an expected parameter (the peer) is missing is not friendly nor proper response for an api.