core-js icon indicating copy to clipboard operation
core-js copied to clipboard

MDB_BAD_TXN error

Open dawk0 opened this issue 6 years ago • 15 comments

image

dawk0 avatar May 01 '18 22:05 dawk0

having a i7-3770k and having the same issue with the skypool and sushipool miners....

dawk0 avatar May 01 '18 22:05 dawk0

Does this problem still occur in the lastest core version?

styppo avatar Jun 23 '18 22:06 styppo

Yes

vikneshvijayakumar avatar Jun 28 '18 04:06 vikneshvijayakumar

Can you confirm that it only happens with Windows 10 after update 1803 using WSL?

paberr avatar Jun 28 '18 15:06 paberr

I can confirm the same

LTD-Dev avatar Jun 28 '18 15:06 LTD-Dev

Yes it is happening of all of my devices on Windows WSL updated with 1803.

vikneshvijayakumar avatar Jun 28 '18 17:06 vikneshvijayakumar

Apparently, Microsoft has broken cache coherency between read/write and mmap operations in its recent update.

Later today, I will release a temporary workaround that you can use when compiling Nimiq on WSL.

paberr avatar Jul 02 '18 15:07 paberr

Please try using the code published on the branch paberr/wsl-workaround. Tell me if further issues exist.

paberr avatar Jul 02 '18 16:07 paberr

{ Error: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
    at LMDBBackend._get (/home/iteonix/core/node_modules/@nimiq/jungle-db/dist/lmdb.js:7166:42)
    at LMDBBackend.getSync (/home/iteonix/core/node_modules/@nimiq/jungle-db/dist/lmdb.js:7368:28)
    at LMDBBackend.get (/home/iteonix/core/node_modules/@nimiq/jungle-db/dist/lmdb.js:7392:21)
    at ObjectStore.get (/home/iteonix/core/node_modules/@nimiq/jungle-db/dist/lmdb.js:3716:35)
    at PeerKeyStore.get (/home/iteonix/core/dist/node.js:34689:28)
    at DumbNetworkConfig._init (/home/iteonix/core/dist/node.js:33517:29)
    at DumbNetworkConfig.initPersistent (/home/iteonix/core/dist/node.js:33495:20)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:684:11) code: -30782 }```

LTD-Dev avatar Jul 02 '18 17:07 LTD-Dev

capture I'm getting mdb corruption error, on master branch and branch paberr/wsl-workaround as well, trying to run core nodejs client under wsl.

sOm2y avatar Jul 05 '18 05:07 sOm2y

change node_modules/@nimiq/jungle-db/package.json line 4 to "main": "dist/leveldb.js", That will do temp fix

sOm2y avatar Jul 06 '18 00:07 sOm2y

It works!

vikneshvijayakumar avatar Jul 06 '18 06:07 vikneshvijayakumar

Note that using levelDB instead can only be a temporary workaround, as it might result in "This method does not work reliably using LevelDB" errors when trying to retrieve transactions.

paberr avatar Jul 24 '18 11:07 paberr

For completeness' sake, I did the work to diagnose this bug and notified Microsoft about it https://twitter.com/hyc_symas/status/1013800256088215552

hyc avatar Oct 11 '18 15:10 hyc

Seems like this bug goes deep, its origin is in the Windows kernel: https://github.com/Microsoft/WSL/issues/3451#issuecomment-415251320

It's probably best to disable LMDB on WSL

riptl avatar Feb 07 '19 13:02 riptl

Closing this stale issue.

For anyone experiencing this in the future, the fix is to update your system to WSL2, see https://github.com/Venemo/node-lmdb/issues/161#issuecomment-1118480146.

jeffesquivels avatar Sep 28 '22 19:09 jeffesquivels