I have a local, strapi app (that I have in a git repo) that I want to migrate from using sqlite3 to using mongodb
I have done the following:
created a 2nd, temporary, strapi app that is successfully using mongodb from the start (so I have a good mongo instance running locally)
copied the database.json content from the temp, working-mongodb, strapi app to my existing one. (made sure was in development and ran development version)
From my existing app (from which I want to use mongodb), I
uninstalled:
strapi-hook-bookshelf
strapi-hook-knex
knex
sqlite3
installed strapi-hook-mongoose
NOTES:
the existing app (from which i want to use mongodb) runs successfully if I keep just keep using sqlite3.
i created the existing app using the quickstart option
But, I still get this error...terminal output, snippet below 👇
Terminal Output Snippet:
(node:37499) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:37499) UnhandledPromiseRejectionWarning: TypeError: orm.load(...).buildQuery is not a function
at buildQuery (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-utils/lib/buildQuery.js:122:21)
at Object.count (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/queries/mongoose.js:18:12)
at Object.initialize (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/services/UsersPermissions.js:502:8)
at module.exports (/Users/monico_a_moreno/source/.../folder-strapi-poc/node_modules/strapi-plugin-users-permissions/config/functions/bootstrap.js:156:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:37499) 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:37499) [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.
[2019-07-03T18:27:15.985Z] warn The bootstrap function is taking unusually long to execute (3500 miliseconds).
[2019-07-03T18:27:15.986Z] warn Make sure you call it?
What am I doing wrong? 🤔
This is cool! I can answer my own question! 😜
Seriously though, I am answering my own question for the benefit of others that might run into the same issue.
Bottom line: I had the wrong version of strapi-hook-mongoose installed.
Details: When I installed strapi-hook-mongoose, I didn't specify a version, and so, npm installed ^3.0.0-alpha.13, and due to the fact that my existing, strapi project is on the (then) latest v3.0.0-beta.7, it failed to run (gave the error described in the above description).
Solution: Uninstall the package and re-install, explicitly specifying the version 👇
npm i strapi-hook-mongoose#3.0.0-beta.7 🙌
Related
I tried connectiong to Mongo on Azure and while working on local host everything went fine, here I got this problem
Exception in thread "cluster-ClusterId{value='63d3d50e34b36c0f2a6720cb', description='my corp'}-mongo.cosmos.azure.com:PORT" com.mongodb.MongoInterruptedException: Interrupted waiting for lock
java.base/java.util.concurrent.locks.ReentrantLock$Sync.lockInterruptibly(ReentrantLock.java:159)
at java.base/java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:372)
at com.mongodb.internal.Locks.checkedWithLock(Locks.java:41)
I tried updating pom to latest versions of dependencies etc. but nothing seems to work
As per error stated "mongodb.MongoInterruptedException: Interrupted waiting for lock". Issue may caused due to
some other thread called
MongoClient.close()
same error appear when you open multiple mongodb instances. Make sure that are closing the mongo clients before open a new instance.
MongoClient mongo = new MongoClient ("localhost", 27017);
mongo.close();
I have found sample application tutorial
I'm getting this error in flutter project when trying to integrate `Realtime Database in flutter.
Firebase Database connection was forcefully killed by the server. Will not attempt reconnect. Reason: Database lives in a different region. Please change your database URL to https://xxx-xxx-xxxx-default-rtdb.asia-southeast1.firebasedatabase.app
Options that I have already tried
Invalidate caches/ restart
Updating my google-services.json file through flutterfire configure
Directly referencing to the database url
Try Instancing the Firebase object with specifying URL.
val mDatabase = FirebaseDatabase.getInstance("https://firebase-appname.southeast1.firebasedatabase.app").reference
FirebaseDatabase.getInstance("firebase-url").reference
I'm trying to connect next.js app to mongodb via mongoose in _middeware file(./pages/_middleware.ts )
But I get this error on incoming requests:
error - (middleware)\node_modules\mongoose\dist\browser.umd.js (1242:0) #
ReferenceError: regeneratorRuntime is not defined
How can I fix it?
+1 I have the same issue when trying to use in the middleware the instance created for mongoose so I don't have to connect it every time I make a request... but it seems this might not be supported yet.
It appears that it is not possible to use node api calls inside of NextJS middleware as this middleware is executed in the Edge runtime. Mongoose is a Node.js api, hence why is doesn't work.
Edge and Node.js Runtimes
When i use the CallClient of #azure/communication-calling SDK to create a CallAgent, i'm getting 'No CommunicationTokenCredential provided' error even though i'm passing a valid CommunicationTokenCredential
Ex: this.callAgent = await this.callClient.createCallAgent(tokenCredential);
I'm able to successfully deploy a standalone react app & run the following sample application and make a web call as suggested in Microsoft docs. https://github.com/Azure-Samples/communication-services-web-calling-tutorial
But, when I integrate this into my existing React App, I start having issues in creating a CallAgent with the following error:
'azure:ACS:error 27/10/2021, 18:13:48:96 CallClient1:CallAgent1 op:Initialize failed, message=No CommunicationTokenCredential provided,'
I am passing the CommunicationTokenCredential properly while calling the createCallAgent(token) (verified by printing the token as well).
But still, I get this error. Has anyone else faced this issue?
We have been developing blockchain-app using Fabric-Nodejs SDK (1.1.0) and trying to make it work with Fabric (1.1.0) on kubernetes. Have referred and following links - https://hackernoon.com/how-to-deploy-hyperledger-fabric-on-kubernetes-1-a2ceb3ada078, https://github.com/IBM/blockchain-network-on-kubernetes.
So far we could deploy two org solution and each having two peers on kubernetes. Now, using Fabric CLI we could run create channel, join channel, install and instantiate chaincodes and other chaincodes functionalities work as expected perfectly fine.
But when we try all similar functionalities with Fabric-Nodejs SDK, we could create the channel successfully and then during join-channel we are stuck with error. Error is not giving any clue and saying "err" object itself undefined into joinchannel.js file -
"(node:1832) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): TypeError: Cannot read property 'stack'
of undefined (node:1832) [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."
We have checked logs of peers, orderer and CAs and none of them giving ERROR and all gives DEBUG details.
Using Nodejs code to create/join/install/invoke chaincode from Fabric sample - https://github.com/hyperledger/fabric-samples/tree/release-1.1/balance-transfer/app
Any particular reason for following slightly older examples even though you are using release 1.1 .
You have setup of Kubernetes in release 1.1 # https://github.com/hyperledger/fabric/blob/release-1.1/examples/e2e_cli/end-to-end.rst
Hyperledger fabric seems to be evolving towards use of Cello for complex networks - http://hyperledger-cello.readthedocs.io/