-
Notifications
You must be signed in to change notification settings - Fork 697
Error: LevelUpArrayAdapter named 'blockLogs' index out of range #346
Comments
Have the same issue.
I happens after truffle test goes to the next test, on testrpc |
Same issue here between tests. Individual tests are fine. |
I thought it was because of the snapshotting at first, but I tried it without and it still seemed to be happening. But maybe I was mistaken. Has anyone experienced this without snapshotting? |
Version:
Confirmed on 4.0.0 and 3.9.2. Tried to go back further, but... npm. Perhaps an upgraded dependency? Snippet from debug logs:
|
errr... scratch that. Once I removed EDIT: Nope, got it again with 3.9.2... odd |
Im using TestRPC v4.0.1. I also see the error log when I run test. But I restart TestRPC when I see the error log every time and then it will work fine... |
Restarting does not help with me. I am also seeing this error in the docker container, so it's not just my local system. It appears as though it's being thrown during an RPC Though the error does seem intermittent, since 1 out of every 50 seems to work in my case. The error seems to be thrown every time after a call to |
once-synchronous data reads/writes asynchronous, and debugging issues that came out of bad refactoring. One thing to note here is that the data structure changed a bit: `data.blockHashes` points to the *block index*, which is the array index of the block. This index doesn’t necessarily match up with the block number.
I'm also getting this on Reproduce:
|
Started getting a weird issue today when I ran a clean install and not sure if it’s a known issue from the popup logs.
truffle / testrpc on initial load on Node 8.1.3, Testrpc, Mac OSX Chrome Latest. |
Same issue. |
I fixed it for now... Here is how I did it. I was using Metamask w/ truffle. I was able to resolve the issue but first: $ Go to chrome -> Right click on metamask -> Manage Extension -> scroll to metamask -> click "Bakcground Image" blue link -> refresh the inspector that is opened (cmd+r on mac). I was logged out of Metamask. I logged back in and the problem was resolved. See: https://github.com/MetaMask/faq/blob/master/LOGS.md#background-logs-chrome Background Logs in chrome -> Refresh the inspector |
I also get the same problem when I use testrpc and MetaMask. When I try to send transactions, the popup hangs and I see the error in the console. But sometimes, the popup hangs and I won't see any error in the console. Not sure how I should proceed--I can't even reliably get the same error message... |
Every time the error occurs, this is what I'm getting from some debug statements. For me, it always seems to happen during the RPC call
I'll continue to dig further but maybe someone more familiar with the codebase would recognize a bug faster than I. EDIT: If I had to guess, this is probably a problem in web3-provider-engine. |
@ghanshaw did you try my solution? I was having the exact same problem... |
I had the same problem. @Pvader 's steps helped me to get Metamask working, thanks |
Tried uninstalling and reinstalling, but it still happens. |
I'm having the same issue as well with TestRPC v4.0.1. It just started all of a sudden. Been running it without issues for a month. Not sure what might have triggered this. I've tried uninstall and reinstalling but that didn't help. I don't have metamask installed so that seems unrelated. Here's my trace.
|
@arpankotecha did you try my solution above? I fixed that same issue as stated above. |
@jttemback try my steps above. It should work. |
Hi @Pvader I tried the first half of the solution (kill testrpc, uninstall testrpc, install testrpc, start testrpc). The second part did not apply as I don't have metamask. Unfortunately the problem still persisted. I also upgraded both testrpc and truffle to the latest version. No luck. |
@Pvader Also not using metamask, also reinstalled testrpc, still not working. |
Looks like a line in my truffle test is corrupting the db. I've gotten around it by supplying a path to the db on the command line: When i encounter the error, I Not sure why that would corrupt the db. But my tests pass now and allows me to proceed with the project. |
@arpankotecha wow, nice find. For me, creating a new db directory allows my tests to go through just fine. Deleting and recreating that directory does not prevent all of my subsequent tests from failing with this error. So if I just create a new directory in How odd. EDIT: That appears to have only worked temporarily. |
I had this issue when I forgot to return promises in my test cases. Haven't run into the issue again after that. |
No matter how bad you screw up your tests, this is still throwing an internal testrpc error that appears to be caused during Right before the error on
The Though in the DB on disk, it appears okay.
I tried updating I wonder if |
I was getting this bug, but I think I figured out how to fix it. The printing of the transaction receipt after sendTransaction appeared to be happening after an evm_revert when a javascript contract test finished and another one started. My proposed fix is to add evm_revert, evm_snapshot and eth_getLogs (which is fired from printTransactionReceipt) to the set of sequenced operations on a blockchain instance. Anyone interested in testing this? https://github.com/prozacchiwawa/ganache-core/tree/20170812-truffle-test-sequence |
@prozacchiwawa Most of the "Forking" tests are failing with this:
I was not able to run any of my contract tests against it, because it appears the test accounts were not created with funds(probably related to the above). |
I think the tests are broken in master in general (same failures from master clone, npm install && npm test). I'll rebranch from a release tag, to get a clearer picture. I hot patched this into my tree, and it seemed to solve my problem, but admittedly didn't need to generate accounts as I have a set of pregenerated ones I was using in my tests. Thanks for trying it out. |
@prozacchiwawa Yeah, sorry. It appears all of those errors are not related to your changes. I get those same errors from a clean master branch of ganache-core from a week or two ago. Let me see if I can get a working branch and then I'll test your changes. |
Remade my branch against release: https://github.com/prozacchiwawa/ganache-core/tree/20170812-truffle-test-sequence-release . All tests seem to be passing in this branch. |
That find path is easy enough to fix but I'm still not getting account balances when I start it. How are you building that, anyway? I'll try your branch in a minute. |
I'm not an npm power user really, so there might be a more convenient way,
but
I cloned ganache-core and did npm link in there.
I cloned testrpc and did
npm install
npm link ganache-core
npm run build
npm link
Then did npm link testrpc in my main repo.
I'm running testrpc like this:
#!/bin/sh
exec ./node_modules/.bin/testrpc \
--account=0x3a1076bf45ab87712ad64ccb3b10217737f7faacbf2872e88fdd9a537d8fe266,20000000000000000000
\
--account=0x9fd05d15f4e1a20307928e6371ffc2d075fc008afb891c3b0fcbebd04f58d9bc,20000000000000000000
\
--account=0xd212c54b88131ec213cd4f8bf4c2990bba5b4cd7469991a4d6537e3f7fb1a330,20000000000000000000
\
"${@}"
^-- the above are not real accounts :-)
…On Sat, Aug 12, 2017 at 11:36 AM, Mike Shultz ***@***.***> wrote:
That find path is easy enough to fix
<mikeshultz/ganache-core@dbc5379>
but I'm still not getting account balances when I start it. How are you
building that, anyway?
I'll try your branch in a minute.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#346 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOEENXVrzQWkVvxMf7T9ebhi-aeqbGaks5sXfC3gaJpZM4OU5_O>
.
|
This has got to be the most frustrating codebase I've stuck my nose into but I'm getting nowhere. I can't get this to build because of some failing dependency, and I'm still having an account balance issue. In the state manager, accounts show a balance:
But not through
It's a fresh source tree, so maybe this is a separate bug in master, or my system is a mess. I wasn't seeing this the other day when I was testing. I'll try again tomorrow with a fresh node install. |
This bug is real stopper, @tcoulter could you please fix it ASAP. |
We're taking a look at this. Will add more info when we've locked it down. |
This has been fixed in Thanks all for the reports! |
I am still seeing this on |
I just got the error on the new version too :
|
Make sure that you wait for your promises. |
@Meekohi & @jackcasey if you are still seeing this issue after employing @tomericco's advice, please post here with repro steps and we may reopen the issue. |
@benjamincburns Easy repro: Run this
Then in another shell, run
|
If you'd like a repo to compare with Geth: $ curl https://mainnet.infura.io:8545 -X POST -d '{"method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000000", "0x1111111111111111"], "id": 0}'
{"jsonrpc":"2.0","id":0,"result":"\u003cnil\u003e"} ganache-cli $ curl localhost:8545 -X POST -d '{"method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000000", "0x1111111111111111"], "id": 0}'
{"id":0,"error":{"message":"LevelUpArrayAdapter named 'blocks' index out of range: index 1; length: 1","code":-32000,"data":{"stack":"Error: LevelUpArrayAdapter named 'blocks' index out of range: index 1; length: 1\n at <>/node_modules/ganache-cli/build/cli.node.js:2:778143\n at <>/node_modules/ganache-cli/build/cli.node.js:2:777808\n
at <>/node_modules/ganache-cli/build/cli.node.js:2:774000\n at <>/node_modules/ganache-cli/build/cli.node.js:2:776505\n at <>/node_modules/ganache-cli/build/cli.node.js:2:748516\n at process._tickCallback (internal/process/next_tick.js:112:11)","name":"Error"}}} |
had the issue because I was calling the right method on the wrong contract...realised after 2 hours of not knowing what's going on |
I get this error when running tests. It goes away for a little while after restarting testrpc.
I am on a MacBook with node 8.1.3, with testrpc 4.0.1
If you want to reproduce this, clone https://github.com/jtremback/guac and run
npm run test
a few times.The text was updated successfully, but these errors were encountered: