eos icon indicating copy to clipboard operation
eos copied to clipboard

STD Exception encountered while processing chain.get_code: unknown key

Open lingyiliu016 opened this issue 8 years ago • 6 comments

when I run node pingPong.js , error occured! details are as followed! api error => { message: 'unknown key', file: 'http_plugin.cpp', line_number: 371, method: 'handle_exception' } http://127.0.0.1:8888/v1/chain/get_code {"account_name":"child.acnt"} { Error: {"code":500,"message":"Internal Service Error","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"unknown key","file":"http_plugin.cpp","line_number":371,"method":"handle_exception"}]}} at /Users/changlingyi/node_modules/eosjs/node_modules/eosjs-api/lib/apigen.js:115:23 at at process._tickCallback (internal/process/next_tick.js:188:7) status: 500, statusText: 'Internal Server Error' } { Error: {"code":500,"message":"Internal Service Error","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"unknown key","file":"http_plugin.cpp","line_number":371,"method":"handle_exception"}]}} at /Users/changlingyi/node_modules/eosjs/node_modules/eosjs-api/lib/apigen.js:115:23 at at process._tickCallback (internal/process/next_tick.js:188:7) status: 500, statusText: 'Internal Server Error' } (node:80202) UnhandledPromiseRejectionWarning: Error: {"code":500,"message":"Internal Service Error","error":{"code":0,"name":"exception","what":"unspecified","details":[{"message":"unknown key","file":"http_plugin.cpp","line_number":371,"method":"handle_exception"}]}} at /Users/changlingyi/node_modules/eosjs/node_modules/eosjs-api/lib/apigen.js:115:23 at at process._tickCallback (internal/process/next_tick.js:188:7) (node:80202) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:80202) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. nodeos show STD Exception encountered while processing chain.get_code: unknown key in red color. Here is content of pingPong.js let EOS = require('eosjs')

eos = EOS.Localnet({ keyProvider:['5KQVzEFg4PbDNtCbdhbfgwfaqQYPNzhjna3ZCm5AzrFZCpeoccg','5KcHE3HF4zAecKWFxBiizG3KBPpkBxbbMDAn1HPeHQZecy69bZy'], httpEndpoint:'http://127.0.0.1:8888' })

eos.contract('child.acnt').then((contract) => { contract.ping("child.acnt",{authorization:['child.acnt']}).then((res) => { console.log(res) }) }) I think the problem may be in keyProvider.but '5KQVzEFg4PbDNtCbdhbfgwfaqQYPNzhjna3ZCm5AzrFZCpeoccg','5KcHE3HF4zAecKWFxBiizG3KBPpkBxbbMDAn1HPeHQZecy69bZy' is owner_private_key and active_private_key of child.acnt.

lingyiliu016 avatar May 30 '18 06:05 lingyiliu016

i'm stuck with the same issue

vicraft18 avatar May 30 '18 07:05 vicraft18

edit ~/Library/Application Support/eosio/nodeos/config/config.ini, cancel comment and add ` Specify the Access-Control-Allow-Origin to be returned on each request. (eosio::http_plugin)

access-control-allow-origin = *

Specify the Access-Control-Allow-Headers to be returned on each request. (eosio::http_plugin)

access-control-allow-headers = * ` ,error may be different

lingyiliu016 avatar May 30 '18 08:05 lingyiliu016

I'm stuck with this as well...

cipherzzz avatar Jun 05 '18 20:06 cipherzzz

Can you provide the detail steps to reproduce this issue. Normally "unknown key" is because the account is not found.

taokayan avatar Jun 22 '18 01:06 taokayan

Hi:

Why is this Closed? I'm stuck with the Same Issue, tried doing what @lingyiliu016 says here: https://github.com/EOSIO/eos/issues/3588#issuecomment-393084126

But NO RESULT...

Can Anyone help me out?

hernanarber avatar Aug 29 '18 19:08 hernanarber

me too

koeltp avatar Nov 04 '21 03:11 koeltp