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
Sometimes ensureIndexes fails #610
Comments
I am also using the latest couchbase docker image with these tests on my Windows Machine: [System Summary]
Item Value
OS Name Microsoft Windows 10 Home
Version 10.0.19042 Build 19042
System Manufacturer Eluktronics Inc.
System Model MAX-15
System Type x64-based PC
System SKU MAX-15 G1
Processor Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz, 2304 Mhz, 8 Core(s), 16 Logical Processor(s)
Installed Physical Memory (RAM) 64.0 GB |
Hello @zachlankton thanks for reaching out. Now having said that we introduced a configuration called Coming to the Indexes, its a similar behavior, just that you are not seeing it because you are not using Indexes immediately, had you been running a query that uses the Indexes you would have noticed a failure if the Indexes are not created. To overcome Indexes concerns you can turnoff creation of Indexes by passing in Once again we strongly recommend creation of scopes/collections/indexes offline in production environments in away that calling ottoman.start doesn't create anything and the process is quick. Hope this helps ! |
Hello @AV25242 Thanks for the response! I completely understand that for production we would have the db and indexes already setup and we would not use start() or But for testing purposes and development this is exactly what I want! The documentation leads me to believe that calling start() will guarantee that my collections and my indexes will be ready so that I can run queries on them without errors. Here it seems the index creation is failing because the collection does not exist (or is not ready) yet? If this is truly intended behavior then the documentation is not very clear here. As it stands right now I notice the If this seems reasonable, I can work on a fix to contribute this solution. |
hello @zachlankton I agree with you that there is a lot of scope to improve the documentation in this regard. With respect to contribution, we would love to see contributions from you in any space i.e documentation or code PR. Also if may I take the liberty to ask, what is that you are building using Ottoman, curious to learn your usecase. |
Thanks @AV25242 ... I believe there was some misunderstanding here. The error I cloned the repo and ran the test suite on the couchbase/server-sandbox database image and all tests pass wonderfully in legacy tests! I see that the non legacy tests fail for this same error that I am reporting (as well as query I modified the I reviewed the code and found that the "if" block for Now all Legacy and non Legacy Tests pass perfectly! I will have a pull request prepared shortly. |
@AV25242 To answer your other question... I am actually just learning about couchbase and ottoman currently. I have used it in some small projects for the company that I work for, nothing heavy, but I really love the developer experience that I have had so far with couchbase and ottoman, its awesome!! The way I stumbled on this issue was when trying to build a database connector for next-auth using ottoman. So I was trying to leverage the |
Hey @zachlankton! Wanted to update you that this has been added in the latest release of Ottoman (v2.1.0), available now on NPM. Thanks for the support! |
Awesome! Thank you! |
Closing this issue, hoping its resolved @zachlankton if not please open a follow-up ticket |
UPDATE (TL;DR)
For those searching this issue and looking for a quick fix: a forked and patched version of ottoman is available at https://github.com/zachlankton/node-ottoman/tree/610-ensure-fix.
This will only be maintained until the patch is published in the official repo. ( Currently pending PR: #611 )
It can also be installed with NPM:
Alternatively, you can update your package.json dependencies with:
Original Post:
Hello, I am experiencing an intermittent error.
This only happens sometimes when calling the
await start()
stand alone function. However, this error never occurs when I do the following:I've written a test script that reproduces the problem pretty reliably ( strange for an intermittent problem 😊 )
It also runs a separate set of tests using the above solution as well as using the couchbase node.js SDK directly with no pause and also with a pause between creating the collection and creating the index.
It appears the main issue is needing a delay between creating collection and creating indexes, regardless if done through ottoman or couchbase node sdk?
You can get the test script here https://gist.github.com/zachlankton/aaaa7d6d1cc1ee34e0974bc1ee05b191
Here is a snapshot of the results I'm getting from this script on my machine:
The text was updated successfully, but these errors were encountered: