This the replication of the same question Could not connect to MongoDb : openidconnect strategy requires an issuer option.
In local its working fine by using local MongoDB. Used Mongo URI for server setup, in server the following error received while start the meanJS project.
Could not connect to MongoDB!
TypeError: OpenIDConnectStrategy requires an issuer option
at Strategy (/project_dir/node_modules/passport-openidconnect/lib/strategy.js:31:32)
at new Strategy (/project_dir/node_modules/passport-paypal-openidconnect/lib/passport-paypal-openidconnect/strategy.js:60:25)
at module.exports (/project_dir/modules/users/server/config/strategies/paypal.js:11:16)
at /project_dir/modules/users/server/config/users.server.config.js:31:36
at Array.forEach (<anonymous>)
at module.exports (/project_dir/modules/users/server/config/users.server.config.js:30:78)
at /project_dir/config/lib/express.js:139:38
at Array.forEach (<anonymous>)
at Object.module.exports.initModulesConfiguration (/project_dir/config/lib/express.js:138:31)
at Object.module.exports.init (/project_dir/config/lib/express.js:250:8)
at /project_dir/config/lib/app.js:26:23
at /project_dir/config/lib/mongoose.js:35:21
at process._tickCallback (internal/process/next_tick.js:68:7)
There is no proper solution for this issue, kindly provide a way to get out of this issue. Thanks in advance
I have reactjs + nodejs - kind of CRUD app on mongodb.
While perfroming "save" via mongoose - it works fine in local laptop (Ubuntu) but same code (save method) does not return error but not even creating database when I try on VPS.
Any links.. no clue - I could get in pm2 logs(as it says MongoDB connection is fine)
Br
D
While working on some new (very simple) server code, I connected and inserted MongoDB URL code in order to "deploy" it on MongoDB Atlas.
However, I get the following warning:
(node:3396) DeprecationWarning: current URL string parser is
deprecated, and will be removed in a future version. To use the new
parser, pass option { useNewUrlParser: true } to MongoClient.connect.
This doesn't prevent my code from deploying to the server, and still allows me to send requests with a local testing tool (Postman). However, after my requests are sent, I get the following message in VS Code:
{ MongoError: user is not allowed to do action [insert] on [agenda.contacts]
at Connection.<anonymous> (C:\Users\mymachine\agenda\node_modules\mongodb-core\lib\connection\pool.js:443:61)
at Connection.emit (events.js:198:13)
at processMessage (C:\Users\mymachine\agenda\node_modules\mongodb-core\lib\connection\connection.js:364:10)
at TLSSocket.<anonymous> (C:\Users\mymachine\agenda\node_modules\mongodb-core\lib\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)
ok: 0,
I suspect this is probably a version error, however this is out of my area of expertise.
My setup is very simple and has only the Atlas cluster connected on MongoDB website.
MongoDB still provides all the analytics I need, so it doesn't seem to have a problem there.
I've already tried changing mongoClient.connect code from useMongoClient: true to useNewUrlParser: true, but it only changes the warning message code from (node:3396) to (node:1092).
mongoose.connect(
'*inserted mongodb url code, copied from CONNECTION STRING ONLY");
{
useNewUrlParser: true
}
Since I have never used MongoDB, I believe my issue is on that software.
I copied the CONNECTION STRING ONLY instead of FULL DRIVER EXAMPLE (both provide a code to insert into my code in VS Code.
As to the (node(1234)) issue solved above, it was in regards to a Warning about a newer version, as to call useNewUrlParser: trueinstead of useMongoClient: true.
As to the "MongoError", I was, instead of hardcoding my password, calling a + process.env.MONGO_ATLAS_PW +and sending my password to file ./nodemon.json.
After changing both errors, code ran smoothly. I, however, will have to find a new way to send password, instead of hardcoding it.
Thank you all who has helped.
so i work at a startup building a backend web app using the nestJs framework (is slightly based on express) and typeorm for our Db . So we recently ran into an issue where the app literally crashes every time an error is thrown i.e an incorrect password
.the error below :
TypeError: layer.match is not a function
at matchLayer (/home/imuchene/apps/DocuflowApi/node_modules/express/lib/router/index.js:574:18)
at next (/home/imuchene/apps/DocuflowApi/node_modules/express/lib/router/index.js:220:15)
at Function.handle (/home/imuchene/apps/DocuflowApi/node_modules/express/lib/router/index.js:174:3)
at Function.handle (/home/imuchene/apps/DocuflowApi/node_modules/express/lib/application.js:174:10)
at Server.app (/home/imuchene/apps/DocuflowApi/node_modules/express/lib/express.js:39:9)
at Server.emit (events.js:187:15)
at Server.EventEmitter.emit (domain.js:441:20)
at parserOnIncoming (_http_server.js:672:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
now for context we're using the Error class on javascript, even though we think that this is not the issue and rather the routing mechanism of expressjs crashes after the error is thrown , also its worth noting that our application runs fine locally but once deployed on the vm it causes the issue.
I am trying to store node.js express sessions on Azure caching.
We already set up a dedicated caching on a worker role following this article http://blogs.msdn.com/b/silverlining/archive/2013/01/03/november-updates-to-windows-azure-powershell-cmdlets.aspx
Add-AzureCacheWorkerRole mycacherole
Enable-AzureMemcacheRole mywebrole mycacherole
In the sample, they use mc module
Can you help me on how to stored express session on azure cache using that module?
I also tried connect-memcached https://github.com/balor/connect-memcached as AzureCache:
MemcachedStore = require('connect-memcached')(express);
app.use(express.session({
secret: 'CatOnTheKeyboard',
store: new MemcachedStore
}));
We got error with this trace. Is it possible to get express to store it sessions on azureCache? Thank for your help.
TypeError: Cannot call method 'reverse' of null
at Client.connect
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:129:42)
at Client.memcachedCommand [as command]
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:299:10)
at Client.get
(E:\approot\node_modules\connect-memcached\node_modules\memcached\lib\memcached.js:794:10)
at MemcachedStore.get
(E:\approot\node_modules\connect-memcached\lib\connect-memcached.js:82:19)
at Object.session [as handle]
(E:\approot\node_modules\connect\lib\middleware\session.js:309:11)
at next (E:\approot\node_modules\connect\lib\proto.js:190:15)
at Object.cookieParser [as handle]
(E:\approot\node_modules\connect\lib\middleware\cookieParser.js:60:5)
at next (E:\approot\node_modules\connect\lib\proto.js:190:15)
at Object.handle
(E:\approot\node_modules\express-validator\lib\express_validator.js:148:10)
at next (E:\approot\node_modules\connect\lib\proto.js:190:15)