Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'then') in return writeTxn.childResults.then(...) #265

Open
dskvr opened this issue Nov 23, 2023 · 1 comment

Comments

@dskvr
Copy link

dskvr commented Nov 23, 2023

I have a crawler that leverages lmdb-js and it periodically hits an error.

Error:

07:17:19.848 [ERROR crawler] error crawling [redacted] Cannot read properties of null (reading 'childResults')
07:17:19.848 [ERROR crawler] error crawling [redacted] Cannot read properties of null (reading 'childResults')
07:17:19.848 [ERROR crawler] error crawling [redacted] Cannot read properties of null (reading 'childResults')
07:17:20.189 [ERROR crawler] error crawling [redacted] Cannot read properties of undefined (reading 'then')
07:17:20.190 [ERROR crawler] error crawling [redacted] Cannot read properties of null (reading 'childResults')
file:///[redacted]/node_modules/lmdb/write.js:741
                                                        return writeTxn.childResults.then(() => finishTxn(result));

Browsing through the source, I cannot think of a reason this would be happening.

Any ideas what would cause this?

@kriszyp
Copy link
Owner

kriszyp commented Nov 23, 2023

I am also not sure what would lead to this condition, but I would guess that it may be due to using nested transactions that with asynchronously callback execution that are allowed to overlap (not awaiting the result of one before the next starts or finishes). Certainly if you are able to figure out more specifically how to reproduce, I can try to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants