appy-one / acebase-server

A fast, low memory, transactional, index & query enabled NoSQL database server for node.js that easily syncs with browser and node.js clients and servers
MIT License
32 stars 14 forks source link

TypeError: Unknown chunk type 50 #97

Closed kodejuice closed 1 year ago

kodejuice commented 1 year ago
0|index  | [astrava_database] DEBUG THIS: getNode error: TypeError: Unknown chunk type 50 while reading record at "/users/0x2F0d78366BB5fa8b8963B5535Cc332C35A808eD5" @9,906
0|index  |     at NodeReader.readHeader (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:3093:23)
0|index  |     at async NodeReader.getValue (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:2312:13)
0|index  |     at async loadChildValue (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:2423:37)
0|index  |     at async Promise.all (index 0)
0|index  |     at async NodeReader.getValue (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:2467:21)
0|index  |     at async AceBaseStorage.getNode (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:1710:25)
0|index  |     at async AceBaseStorage._writeNodeWithTracking (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/index.js:655:26)
0|index  |     at async AceBaseStorage._updateNode (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:1957:26)
0|index  |     at async AceBaseStorage.setNode (/root/astrava_db_server/node_modules/acebase/dist/cjs/storage/binary/index.js:1868:27)
0|index  |     at async LocalApi.set (/root/astrava_db_server/node_modules/acebase/dist/cjs/api-local.js:59:24)

The whole users/ object is unreachable because of this error, i cant retrieve /users/0x2F0d78366BB5fa8b8963B5535Cc332C35A808eD5 or even delete it, what could be the cause here?

kodejuice commented 1 year ago

i cant even delete users

appy-one commented 1 year ago

Hi @kodejuice this looks like database corruption caused by multiple processes writing to the same file without (correctly) using IPC. Are you running multiple server instances?

kodejuice commented 1 year ago

I was trying to import from firebase, it was too large so i was doing it chunk by chunk So I think this was caused by an incomplete write, i fixed it by deleting the .db file and doing it again, works fine now

appy-one commented 1 year ago

Awesome, thanks for the update! πŸ‘πŸΌ

Do you like AceBase? πŸ‘‡πŸΌ

Sponsor AceBase Spread the word contribute