✓ Connecting to your database
Analyzing the database
Cannot generate your project.
An unexpected error occurred. Please reach out for help in our Developers community (https://community.forestadmin.com/) or create a Github issue with following error: MongoError: Unsupported BSON : type JavaScript
(node:15) UnhandledPromiseRejectionWarning: MongoError: Unsupported BSON : type JavaScript
at Connection. (/usr/local/lib/node_modules/lumber-cli/node_modules/mongodb/lib/core/connection/pool.js:466:61)
at Connection.emit (events.js:198:13)
at processMessage (/usr/local/lib/node_modules/lumber-cli/node_modules/mongodb/lib/core/connection/connection.js:364:10)
at TLSSocket. (/usr/local/lib/node_modules/lumber-cli/node_modules/mongodb/lib/core/connection/connection.js:533:15)
at TLSSocket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at TLSSocket.Readable.push (_stream_readable.js:224:10)
at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I’m not sure of the support of BSON Javascript type using lumber. I’ll do a quick test on my end and update this post with a more complete answer once I’ve got everything setup
The environment variable you have seems good to me - and the stack trace of your first message seems to indicate an issue during the database introspection.
Do you know if any specific data in your database that have such a type? Could you (If that’s possible on you end of course) share a dump or an example of data that would lead to this type issue?
I’m currently digging in the lumber generate code to see if I can locate any incompatibilities with BSON Javascript, since I’m not sure that this is something we currently support.
I did a quick local test to check if I was able to reproduce this issue with a local mongodb database, and I’m not able to.
I’ll try using directly an AWS DocumentDB just in case the introspection issue comes from there, and I’ll keep you updated.
Just to be sure, the command you provided on the first post mention host.docker.internal as your database URL - are you using SSH tunneling or port forwarding to connect to your DocumentDB instance ?
I’m totally able to reproduce this issue without any specific configuration using AWS DocumentDB and a SSH tunnel, so it seems, indeed, an issue related to the lumber/documentDB link.
I’m pushing this to our product board, for a complete DocumentDB support. In the meantime, I would suggest to dump this database and run it locally if that’s possible.
We have the same problem We’re using AWS DocumentDB. As mentioned here, the problem causes because of type support of DocumentDB. I wonder if there is an estimated date for DocumentDB (AWS’s MongoDB) compatibility?
The team did some further tests on DocumentDB in order to find an “easy” solution to this issue.
We can’t still provide an ETA on the full onboarding using DocumentDB, but some interesting discoveries were made.
If you are able to pass the model generation (Eg. Using lumber generate on a locally running dump of the DocumentDB cluster), you should be able to then switch to the cluster URL in DATABASE_URL of your .env file (This will still require the SSH tunnel to be running).
The issue with DocumentDB is located on our model introspection algorithm, and does not seems to cause any issue once this step is done.
This is not a perfect solution, but should at least allow you to run your lumber project using DocumentDB.