[GH-ISSUE #168] DEBUG THIS: getNodeInfo error #84

Closed
opened 2026-05-23 08:29:50 -06:00 by gitea-mirror · 9 comments
Owner

Originally created by @donl on GitHub (Oct 26, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/168

I just ran into this error. I'll see if I can get you something reproducible. This is from an acebase-server that was having dummy data (2k small objects) added from a remote client.

[default] DEBUG THIS: getNodeInfo error DetailedError: Set tree.id property to something unique for locking purposes
    at BinaryBPlusTree._threadSafe (/app/node_modules/acebase/src/btree/binary-tree.js:853:19)
    at BinaryBPlusTree.findAll (/app/node_modules/acebase/src/btree/binary-tree.js:1539:21)
    at createStreamFromBinaryTree (/app/node_modules/acebase/src/storage/binary/index.js:2589:44)
    at start (/app/node_modules/acebase/src/storage/binary/index.js:2551:24)
    at async NodeReader.getChildInfo (/app/node_modules/acebase/src/storage/binary/index.js:2872:9)
    at async AceBaseStorage.getNodeInfo (/app/node_modules/acebase/src/storage/binary/index.js:1763:33)
    at async LocalApi.reflect (/app/node_modules/acebase/src/api-local.js:213:34)
    at async file:///app/node_modules/acebase-server/dist/esm/routes/data-reflect.js:47:28 {
  code: 'tree-id-not-set',
  originalError: null
}

Originally created by @donl on GitHub (Oct 26, 2022). Original GitHub issue: https://github.com/appy-one/acebase/issues/168 I just ran into this error. I'll see if I can get you something reproducible. This is from an `acebase-server` that was having dummy data (2k small objects) added from a remote client. ``` [default] DEBUG THIS: getNodeInfo error DetailedError: Set tree.id property to something unique for locking purposes at BinaryBPlusTree._threadSafe (/app/node_modules/acebase/src/btree/binary-tree.js:853:19) at BinaryBPlusTree.findAll (/app/node_modules/acebase/src/btree/binary-tree.js:1539:21) at createStreamFromBinaryTree (/app/node_modules/acebase/src/storage/binary/index.js:2589:44) at start (/app/node_modules/acebase/src/storage/binary/index.js:2551:24) at async NodeReader.getChildInfo (/app/node_modules/acebase/src/storage/binary/index.js:2872:9) at async AceBaseStorage.getNodeInfo (/app/node_modules/acebase/src/storage/binary/index.js:1763:33) at async LocalApi.reflect (/app/node_modules/acebase/src/api-local.js:213:34) at async file:///app/node_modules/acebase-server/dist/esm/routes/data-reflect.js:47:28 { code: 'tree-id-not-set', originalError: null } ```
gitea-mirror 2026-05-23 08:29:50 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@appy-one commented on GitHub (Oct 26, 2022):

If I follow the stack trace it looks like you are adding those objects to the root node of the db, is that right?

This line sets the tree.id:
74a2c54f8a/src/storage/binary/index.js (L2568)

If path === '', so will tree.id be and fail the assertion with given error.

Can you try changing the line above to tree.id = 'path:' + this.address.path; and let me know if that fixes it?

<!-- gh-comment-id:1292438590 --> @appy-one commented on GitHub (Oct 26, 2022): If I follow the stack trace it looks like you are adding those objects to the root node of the db, is that right? This line sets the `tree.id`: https://github.com/appy-one/acebase/blob/74a2c54f8ace839dfda0cd19b05184ef3566bf91/src/storage/binary/index.js#L2568 If `path === ''`, so will `tree.id` be and fail the assertion with given error. Can you try changing the line above to `tree.id = 'path:' + this.address.path;` and let me know if that fixes it?
Author
Owner

@donl commented on GitHub (Oct 26, 2022):

Correct, these objects were being added to the root node.

I patched the code on the server. I replaced my server's /node_modules/acebase with your repo, made the change and built acebase. The error still occurred. Do I need to try and update my acebase-client app as well?

<!-- gh-comment-id:1292626339 --> @donl commented on GitHub (Oct 26, 2022): Correct, these objects were being added to the root node. I patched the code on the `server`. I replaced my `server`'s /node_modules/acebase with your repo, made the change and built `acebase`. The error still occurred. Do I need to try and update my `acebase-client` app as well?
Author
Owner

@donl commented on GitHub (Oct 26, 2022):

Starting with a fresh db, this is what I'm seeing upon database creation...

[mydb] DEBUG THIS: getNodeInfo error DetailedError: Set tree.id property to something unique for locking purposes
    at BinaryBPlusTree._threadSafe (/ace-server-test/node_modules/acebase/src/btree/binary-tree.js:853:19)
    at BinaryBPlusTree.findAll (/ace-server-test/node_modules/acebase/src/btree/binary-tree.js:1539:21)
    at createStreamFromBinaryTree (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2589:44)
    at start (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2551:24)
    at async NodeReader.getChildInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2872:9)
    at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1763:33)
    at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1739:36)
    at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1739:36)
    at async AceBaseStorage.getNode (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1629:30)
    at async AceBaseStorage.transactNode (/ace-server-test/node_modules/acebase/src/storage/index.js:1119:26) {
  code: 'tree-id-not-set',
  originalError: null
}
<!-- gh-comment-id:1292638785 --> @donl commented on GitHub (Oct 26, 2022): Starting with a fresh db, this is what I'm seeing upon database creation... ``` [mydb] DEBUG THIS: getNodeInfo error DetailedError: Set tree.id property to something unique for locking purposes at BinaryBPlusTree._threadSafe (/ace-server-test/node_modules/acebase/src/btree/binary-tree.js:853:19) at BinaryBPlusTree.findAll (/ace-server-test/node_modules/acebase/src/btree/binary-tree.js:1539:21) at createStreamFromBinaryTree (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2589:44) at start (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2551:24) at async NodeReader.getChildInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:2872:9) at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1763:33) at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1739:36) at async AceBaseStorage.getNodeInfo (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1739:36) at async AceBaseStorage.getNode (/ace-server-test/node_modules/acebase/src/storage/binary/index.js:1629:30) at async AceBaseStorage.transactNode (/ace-server-test/node_modules/acebase/src/storage/index.js:1119:26) { code: 'tree-id-not-set', originalError: null } ```
Author
Owner

@donl commented on GitHub (Oct 26, 2022):

I must be missing a step. It looks like after running npm run build in the acebase directory, my modification to acebase/src/storage/binary/index.js is being reverted.

<!-- gh-comment-id:1292641802 --> @donl commented on GitHub (Oct 26, 2022): I must be missing a step. It looks like after running `npm run build` in the `acebase` directory, my modification to `acebase/src/storage/binary/index.js` is being reverted.
Author
Owner

@donl commented on GitHub (Oct 27, 2022):

When I only edit the .js file (without additional building) I am seeing these types of messages when attempting to log in and being stuck waiting for the server to respond.

storage.getNode "/__auth__/accounts/admin") is taking a long time to complete

<!-- gh-comment-id:1292793114 --> @donl commented on GitHub (Oct 27, 2022): When I only edit the .js file (without additional building) I am seeing these types of messages when attempting to log in and being stuck waiting for the server to respond. `storage.getNode "/__auth__/accounts/admin") is taking a long time to complete`
Author
Owner

@appy-one commented on GitHub (Oct 27, 2022):

I must be missing a step. It looks like after running npm run build in the acebase directory, my modification to acebase/src/storage/binary/index.js is being reverted.

Yes, that's why I asked to change the .js file, that would have been the only needed change. If you'd change the .ts file you would have needed to rebuild, I wanted to save you the hassle ;-)

I am seeing these types of messages when attempting to log in and being stuck waiting for the server to respond.
storage.getNode "/auth/accounts/admin") is taking a long time to complete

Are you logging in while your bulk adds are being processed?

<!-- gh-comment-id:1293913944 --> @appy-one commented on GitHub (Oct 27, 2022): > I must be missing a step. It looks like after running `npm run build` in the `acebase` directory, my modification to `acebase/src/storage/binary/index.js` is being reverted. Yes, that's why I asked to change the .js file, that would have been the only needed change. If you'd change the .ts file you would have needed to rebuild, I wanted to save you the hassle ;-) > I am seeing these types of messages when attempting to log in and being stuck waiting for the server to respond. > storage.getNode "/__auth__/accounts/admin") is taking a long time to complete Are you logging in while your bulk adds are being processed?
Author
Owner

@donl commented on GitHub (Oct 28, 2022):

The login was on a fresh server / database file. I wasn't able to proceed any further. I'll try another fresh server setup with no authentication.

The npm installed acebase package didn't have the .js files you referenced. Going off your git repo, I was more out of my element -- but a good lesson for me none the less. :)

<!-- gh-comment-id:1295081539 --> @donl commented on GitHub (Oct 28, 2022): The login was on a fresh server / database file. I wasn't able to proceed any further. I'll try another fresh server setup with no authentication. The npm installed `acebase` package didn't have the `.js` files you referenced. Going off your git repo, I was more out of my element -- but a good lesson for me none the less. :)
Author
Owner

@appy-one commented on GitHub (Oct 28, 2022):

Did you update acebase-server after I fixed https://github.com/appy-one/acebase-server/issues/40 ?
Because if you didn't, you are now using a newer acebase version than your old acebase-server package expects - that might cause issues.

<!-- gh-comment-id:1295354786 --> @appy-one commented on GitHub (Oct 28, 2022): Did you update `acebase-server` after I fixed https://github.com/appy-one/acebase-server/issues/40 ? Because if you didn't, you are now using a newer `acebase` version than your old `acebase-server` package expects - that might cause issues.
Author
Owner

@appy-one commented on GitHub (Oct 30, 2022):

Hi Don, I published the fix in acebase v1.25.2
Let me know if you still see that last error you reported after updating acebase-server to the latest version

<!-- gh-comment-id:1296231473 --> @appy-one commented on GitHub (Oct 30, 2022): Hi Don, I published the fix in `acebase` v1.25.2 Let me know if you still see that last error you reported after updating `acebase-server` to the latest version
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#84
No description provided.