eos icon indicating copy to clipboard operation
eos copied to clipboard

assertion failed: unable to find key

Open lelence opened this issue 8 years ago • 14 comments

when I set the contract of eosio.system failed, eos-dawn-v4.0.0

> ./cleos set contract eosio ../../contracts/eosio.system -p eosio
Reading WAST/WASM from ../../contracts/eosio.system/eosio.system.wasm...
Using already assembled WASM...
Publishing contract...
2820266ms thread-0   main.cpp:2316                 main                 ] Failed with error: Assert Exception (10)
condition: assertion failed: unable to find key

lelence avatar May 16 '18 16:05 lelence

+1, same problem

guaiguaihw avatar May 17 '18 04:05 guaiguaihw

+1,same problem too

imoonstal avatar May 17 '18 05:05 imoonstal

1../cleos set contract eosio ../../contracts/eosio.token -p eosio 2. push action eosio.token create '["eosio", "10000000000.0000 EOS",0,0,0]' -p eosio.token 3. push action eosio.token issue '["eosio","1000000000.0000 EOS", "issue"]' -p eosio.token 4. set contract eosio ../../contracts/eosio.system -p eosio

dboyzhong avatar May 17 '18 06:05 dboyzhong

it is worked, but first time response is

Error 3080006: transaction took too long
Error Details:
deadline exceeded

the second time is success.

lelence avatar May 17 '18 07:05 lelence

  1. create eosio.token account
  2. eosio.token contract should be set first then create EOS tokens & issue tokens
  3. set eosio.system contract

dboyzhong avatar May 17 '18 09:05 dboyzhong

Edit - I think I managed to get past this. It was the order of the operations as well as using an account incorrectly in the steps below. This sequence indeed works:

cleos create account eosio eosio.token EOS8XYmXRzTFG2LboHQiT1Y48ZZyGmg6eYzxMUjf8SFzXAZXwyTqK
cleos set contract eosio.token /contracts/eosio.token
cleos push action eosio.token create '[eosio, "1000000000.0000 EOS"]' -p eosio.token
cleos push action eosio.token issue '[eosio, "1000000000.0000 EOS"]' -p eosio
cleos set contract eosio /contracts/eosio.system -p eosio

Original

I'm running into this too (using DAWN-2018-05-16) - and have followed the steps outlined above a couple times now while restarting the chain each time.

cleos create account eosio eosio.token EOS8XYmXRzTFG2LboHQiT1Y48ZZyGmg6eYzxMUjf8SFzXAZXwyTqK
cleos set contract eosio /contracts/eosio.token -p eosio
cleos push action eosio.token create '["eosio", "10000000000.0000 EOS", 0, 0, 0]' -p eosio.token
cleos push action eosio.token issue '["eosio","1000000000.0000 EOS", "issue"]' -p eosio.token
cleos set contract eosio /contracts/eosio.system -p eosio

As soon as I set the eosio.system contract it it returns the unknown key error:

> cleos set contract eosio /contracts/eosio.system -p eosio
Reading WAST/WASM from /contracts/eosio.system/eosio.system.wasm...
Using already assembled WASM...
Publishing contract...
425560ms thread-0   main.cpp:2444                 main                 ] Failed with error: Assert Exception (10)
condition: assertion failed: unable to find key

aaroncox avatar May 18 '18 07:05 aaroncox

Got the same error.

noprom avatar May 23 '18 14:05 noprom

@dboyzhong I followed your step but still meet 'unable to find key' assertion.

littlekfc avatar May 29 '18 07:05 littlekfc

systemAccounts = [
    'eosio.bpay',
    'eosio.msig',
    'eosio.names',
    'eosio.ram',
    'eosio.ramfee',
    'eosio.saving',
    'eosio.stake',
    'eosio.token',
    'eosio.vpay',
]

This accounts needs to be created before installing eosio.system contract

elmato avatar May 29 '18 08:05 elmato

Also the CORE token symbol must match the one nodeos has been compiled with. Default is SYS so the eosio.token line must be:

cleos push action eosio.token create '["eosio", "10000000000.0000 SYS"]' -p eosio.token

elmato avatar May 29 '18 08:05 elmato

@elmato Thanks! Building the software using eosio_build.sh script, which parameter we should pass? If we need to use other symbol.

littlekfc avatar May 29 '18 09:05 littlekfc

-DCORE_SYMBOL_NAME=XXX

matthewdarwin avatar May 29 '18 09:05 matthewdarwin

-DCORE_SYMBOL_NAME=XXX didn't work for eosio_build.sh, do I need to edit the cmake file?

littlekfc avatar May 30 '18 02:05 littlekfc

#3586

littlekfc avatar May 30 '18 06:05 littlekfc