4

Recently, every time I tried to interact with a contract function, using MetaMask (version 3.9.4) and Remix - Solidity IDE, I get this error

callback contain no result Error: Error: [ethjs-query] while formatting outputs from RPC '{...}' for method 'getBlockByNumber' Error: [ethjs-format] hex string '0x00' must be an alphanumeric 42 utf8 byte hex (chars: a-fA-F) string, is 4 bytes

I use testrpc.

To reproduce the error, I used the Ballot example contract loaded when you open the Remix - Solidity IDE. I simply called the function vote. Here is a screenshot:

enter image description here

In your opinion, what could be the problem?

I don't know if this could be interested, but I recently update both Chrome (my current version is 60.0.3112.90) and MetaMask (version 3.9.4).

I've also noticed that when I try to deploy the same contract for the second time, the same error occurs.

EDIT
Here is the MetaMask log enter image description here

callback contain no result Error: Error: [ethjs-query] while formatting outputs from RPC '{"number":"0x01","hash":"0x202130c6cf3da71ef4ecd825756026ca7ae8778c1351f84afb0fe33f2d700dd8","parentHash":"0x4ab8c5feac60b61978fea09f5d85b6948dfb05145a80a697da301829cd1399df","nonce":"0x0","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","stateRoot":"0x48c03fd8d78b45ef04c24d22e5e90342f488604b7c88d92804699f2eaf433328","receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","miner":"0x0000000000000000000000000000000000000000","difficulty":"0x0","totalDifficulty":"0x0","extraData":"0x0","size":"0x03e8","gasLimit":"0x47e7c4","gasUsed":"0x096017","timestamp":"0x59857e81","transactions":[{"hash":"0x8b0eb39901c9f73cf8155acba32a165ab5adf29d7f2503f267e9b8279b26ca74","nonce":"0x0","blockHash":"0x202130c6cf3da71ef4ecd825756026ca7ae8778c1351f84afb0fe33f2d700dd8","blockNumber":"0x01","transactionIndex":"0x00","from":"0x78de6e90d3ac971e4924b34a397d5d3afd91801a","to":"0x0","value":"0x0","gas":"0x096017","gasPrice":"0x04a817c800","input":"0x6060604052341561000f57600080fd5b604051602080610864833981016040528080519060200190919050505b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508060ff166002816100e591906100ed565b505b50610140565b815481835581811511610114578183600052602060002091820191016101139190610119565b5b505050565b61013d91905b80821115610139576000808201600090555060010161011f565b5090565b90565b6107158061014f6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635c19a95c1461005f578063609ff1bd146100985780639e7b8d61146100c7578063b3f98adc14610100575b600080fd5b341561006a57600080fd5b610096600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610126565b005b34156100a357600080fd5b6100ab61047d565b604051808260ff1660ff16815260200191505060405180910390f35b34156100d257600080fd5b6100fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610505565b005b341561010b57600080fd5b610124600480803560ff16906020019091905050610602565b005b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160010160009054906101000a900460ff161561018657610478565b5b600073ffffffffffffffffffffffffffffffffffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580156102b457503373ffffffffffffffffffffffffffffffffffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561032357600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250610187565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561035c57610478565b60018260010160006101000a81548160ff021916908315150217905550828260010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff161561046057816000015460028260010160019054906101000a900460ff1660ff1681548110151561043c57fe5b906000526020600020900160005b5060000160008282540192505081905550610477565b816000015481600001600082825401925050819055505b5b505050565b6000806000809150600090505b6002805490508160ff1610156104ff578160028260ff168154811015156104ad57fe5b906000526020600020900160005b506000015411156104f15760028160ff168154811015156104d857fe5b906000526020600020900160005b506000015491508092505b5b808060010191505061048a565b5b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415806105ad5750600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff165b156105b7576105ff565b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b50565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff168061066a57506002805490508260ff1610155b15610674576106e5565b60018160010160006101000a81548160ff021916908315150217905550818160010160016101000a81548160ff021916908360ff160217905550806000015460028360ff168154811015156106c557fe5b906000526020600020900160005b50600001600082825401925050819055505b50505600a165627a7a72305820b1f3a8079ba1019f7627b877660dd8cba1bcc422f6c4b3fa77ee8dec1ad01ce800290000000000000000000000000000000000000000000000000000000000000004"}],"uncles":[]}' for method 'getBlockByNumber' Error: [ethjs-format] hex string '0x00' must be an alphanumeric 42 utf8 byte hex (chars: a-fA-F) string, is 4 bytes at cb (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:43819:31) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:43910:12 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64308:9 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10069:16 at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9949:25) at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9939:17) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10085:16 at resultObj.id (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64288:9) at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10160:16 at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9954:17)

  • I managed to solve this problem for myself by enabling automatic mining via testrpc --blocktime 5 – Leon Grapenthin Aug 8 '17 at 14:16
  • @LeonGrapenthin Great. It works like a charm. – d3llafr33 Aug 8 '17 at 20:22
2
+50

I managed to solve this problem for myself by enabling automatic mining via testrpc --blocktime 5, where 5 is the amount of seconds it takes testrpc to mine a new block.

2

Based on the error stack trace, I can see this error is happening from within MetaMask, and that it seems to be that MetaMask is receiving an unexpected response from its RPC provider.

To investigate in more detail, I would need to look at the MetaMask background logs when this error is thrown, so I could isolate the response that is triggering this error.

Instructions on opening MetaMask's background logs are here: https://github.com/MetaMask/faq/blob/master/LOGS.md#background-logs-chrome

Since it seems to be some kind of unhandled response error, this is a good bug to open with MetaMask itself, here: https://github.com/MetaMask/metamask-plugin/issues/new

  • thank you for your answer. I edited the question, adding the MetaMask background log. – d3llafr33 Aug 7 '17 at 19:20
  • Could you add the text of that red log? Specifically, the body of the bad response should be helpful here, so it can be run through ethjs-query, to see which value has an invalid format. – DanF Aug 7 '17 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.