eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

check_authorization Error

Open yepp4you opened this issue 8 years ago • 12 comments

eos : dawn-v4.0.0 eosjs : 10.0.0

In cleos, the account is created well, but in eosjs, the following problem occurs when creating account.

http://localhost:3330/v1/chain/push_transaction {"compression":"none","transaction":{"expiration":"2018-05-14T00:41:47","region":0,"ref_block_num":8406,"ref_block_prefix":3983766411,"max_net_usage_words":0,"max_kcpu_usage":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea3055000000012103b89a01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000100000000010000000000ea305500000000a8ed32320100"}]},"signatures":["SIG_K1_Kb8rBwQepJth2tQ4r86o1ZB1UWMbnKCdhXSjuGFiWHAD9YujH6betfQtLaWeqXhQ1WpFL7n7aH7kU2ntg29HDTXb392hjz"]} api error => { message: 'transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms', file: 'authorization_manager.cpp', line_number: 405, method: 'check_authorization' } http://localhost:3330/v1/chain/push_transaction {"compression":"none","transaction":{"expiration":"2018-05-14T00:41:47","region":0,"ref_block_num":8406,"ref_block_prefix":3983766411,"max_net_usage_words":0,"max_kcpu_usage":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"eosio","name":"newaccount","authorization":[{"actor":"eosio","permission":"active"}],"data":"0000000000ea3055000000012103b89a01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000100000000010000000000ea305500000000a8ed32320100"}]},"signatures":["SIG_K1_Kb8rBwQepJth2tQ4r86o1ZB1UWMbnKCdhXSjuGFiWHAD9YujH6betfQtLaWeqXhQ1WpFL7n7aH7kU2ntg29HDTXb392hjz"]} { Error: {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}} at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:102:23 at at process._tickCallback (internal/process/next_tick.js:182:7) status: 500, statusText: 'Internal Server Error' } { Error: {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}} at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:102:23 at at process._tickCallback (internal/process/next_tick.js:182:7) status: 500, statusText: 'Internal Server Error' } [push_transaction error] '{"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}', transaction '4bdbf85a0000d6208b7373ed00000000010000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed32327c0000000000ea3055000000012103b89a01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000100000000010000000000ea305500000000a8ed32320100' {"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"eosio","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}} 3090003

yepp4you avatar May 14 '18 01:05 yepp4you

Received same kind of error when invoking contract action (even after merging pending pull request)

{"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{"actor":"chmbifyslhqs","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}

ai-personas avatar May 14 '18 01:05 ai-personas

Same issue here

randytorres avatar May 14 '18 02:05 randytorres

So right now eosjs is still on dawn3, but there is a dawn4 ( slim ) branch which is being worked on. I've run some tests on it yesterday and it seems to be working as expected, I think we might just be waiting for it to be merged.

nsjames avatar May 14 '18 11:05 nsjames

Received above error in slim branch only. For example, tried below transaction

            eos.transaction({
                actions: [
                    {
                        account: 'hello',
                        name: 'hi',
                        authorization: [{
                            actor: 'nrisxgbvijwz',
                            permission: 'active'
                        }],
                        data: {
                            user: 'test'
                        }
                    }
                ]
            })

ai-personas avatar May 14 '18 16:05 ai-personas

I just merged slim into master .. It is getting a lot better but there are still errors..

jcalfee avatar May 14 '18 17:05 jcalfee

eosjs master depends on fcbuffer [master], and eosjs-api [master] .. There is still an error with the asset. Once I fix that I can update npmjs..

jcalfee avatar May 14 '18 18:05 jcalfee

overwrite the newly changed code in 10.0.0, delete the deposit, and test it, the account created.

In case of eos.newaccount, the following error occurs. Error: Abi 'eosio.token' is not cached, call abiAsync('eosio.token') action.data transaction.actions at Object.abi (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/abi-cache.js:38:13) at structLookup (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/structs.js:36:31) at actionDataFromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/structs.js:560:52) at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/struct.js:148:15) at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/types.js:239:26) at Object.fromObject (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/fcbuffer/lib/struct.js:151:34) at rawTx (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/write-api.js:392:36) at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs/lib/write-api.js:551:5 at api.getBlock.block (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/exported-helpers.js:60:7) at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/exported-helpers.js:69:5 at callback (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/process-args.js:70:9) at callback (/Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:86:9) at /Users/yepp4you/Work/blockchain/portal/portal_server/node_modules/eosjs-api/lib/apigen.js:113:9 at at process._tickCallback (internal/process/next_tick.js:182:7)

but my newAccount function is ok function newAccount(account, endpoint) { if (_.isEmpty(endpoint)) { endpoint = http://${eosNodeConfig.host}:${eosNodeConfig.httpPort}; } const options = getConfig(endpoint); const eos = api.Localnet(options); return eos.contract('eosio') .then((contract) => { return contract.newaccount(account, {authorization: ${eosNodeConfig.systemAccount}}); }) .catch(function(err) { console.log(err); if (typeof err === 'string') { throw JSON.parse(err); } throw err; }); }

// eosio_contract_abi.cpp "newaccount": { "base": "", "type": "action", "fields": { "creator": "account_name", "name": "account_name", "owner": "authority", "active": "authority", "recovery": "authority" } },

https://github.com/EOSIO/eosjs/blob/a0b29aff1feda39ed862a2e2cacd5baff498d72b/src/schema/chain_types.json#L134

yepp4you avatar May 15 '18 01:05 yepp4you

I published npm eosjs@dawn4 (version 11) .. This version is compatible with eosio/eos:dawn-v4.0.0 .. There are many changes. Please let me know if you have questions or find other bugs..

jcalfee avatar May 16 '18 01:05 jcalfee

@jcalfee When I create new account

const eos = eosjs.Localnet({
      keyProvider: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'],
      binaryen
    });
    
    return eos.newaccount({
      creator: 'eosio',
      name,
      owner: 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV',
      active: 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV',
    });

It is still error same above !

I use "eosjs": "^11.0.0", 🙇

navcsdev avatar May 18 '18 05:05 navcsdev

Maybe you have another eosjs-* package installed in your package.json? Or the nodeosd your using is not the version you think it is. Your example works for me.

jcalfee avatar May 18 '18 15:05 jcalfee

@jcalfee Sorry, this is my confusion! It works. Thank you very much.

navcsdev avatar May 21 '18 07:05 navcsdev

The most common issue is the chainId .. Look at the chainId in get_info under http://193.93.219.219:8888/v1/chain/get_info then include that hex string in config.chainId ..

jcalfee avatar Jun 01 '18 23:06 jcalfee