acebase: Error: Attempt to read non-existing records

Encountering a strange issue — there’s a specific set of what I believe to be 5 consecutive records in my database that I’m calling “ghost records”. Trying to read, write, or delete them is throwing the error Attempt to read non-existing records. Even setting their parent record to null causes an unending read lock on the record before eventually causing the same error.

I apologize for the vague issue without a repro, at the moment I’d just appreciate any advice on how to get rid of them! Trying to export the database, manually remove them, then import it back isn’t working either; the export process seems to freeze upon reaching those records.

Attempt to read non-existing records
at NodeReader._treeDataReader (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/storage/binary/index.js:2933:19)
at BinaryReader.more (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/btree/binary-reader.js:110:38)
at BinaryReader.assert (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/btree/binary-reader.js:139:24)
at BinaryReader.get (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/btree/binary-reader.js:78:20)
at BinaryBPlusTree._readChild (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/btree/binary-tree.js:205:36)
at async leaf.getNext (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/btree/binary-tree.js:675:35)
at async createStreamFromBinaryTree (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/storage/binary/index.js:2629:56)
at async NodeReader.getAllocation (/project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/storage/binary/index.js:2179:9)
at async /project-name/node_modules/.pnpm/acebase@1.26.2/node_modules/acebase/dist/cjs/storage/binary/index.js:2187:45
at async Promise.all (index 0)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Awesome, closing the issue!

Spread the word contribute Sponsor AceBase

A crash is entirely possible. The application is run with pm2 so I wouldn’t have noticed it.

There was also a short period of time when writes were failing because the server was out of available storage space; now that I think about it, I only noticed these ghost records after that incident.

Ok, the issue seems to be that the B+Tree that stores all child properties has not been assigned sufficient amount of records to store its data, causing the leaf stored at the very end to have been cut off. I’m now investigating how that might have happened.

Email sent!