I created a mock json server and trying to open in browser ,landing in the following error:
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EACCES 127.0.0.1:8000
at Server.setupListenHandle [as _listen2] (net.js:1313:19)
at listenInCluster (net.js:1378:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1491:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:55:10)
Emitted 'error' event at:
at emitErrorNT (net.js:1357:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
Please help.
Related
i have installed mongodb and i am able to connect via shell, now i am trying to install mongo-express, the installation was successful, i copied config.default.js file in config.js but it can't connect to mongo. As can be seen from the error it cannot retrieve the hostname
(node:3085) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use `node --trace-deprecation ...` to show where the warning was created)
Could not connect to database at index "0"
(node:3085) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [undefined:27017] on first connect [Error: getaddrinfo ENOTFOUND undefined
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) {
name: 'MongoNetworkError'
}]
at Pool.<anonymous> (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/topologies/server.js:438:11)
at Pool.emit (events.js:315:20)
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/pool.js:562:14
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/pool.js:995:11
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:32:7
at callback (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:280:5)
at Socket.<anonymous> (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:310:7)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:3085) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3085) [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 had the same error.
Forcing the connection URL fixed it for me :
mongo-express --url "mongodb://localhost:27017" --admin
(--admin option allows to list all databases)
I'm working on a web application with node.js and using Mongodb for database. everything is cool when I run my app in localhost. but when I run it in a shared host it gives an error which looks like its Mongoose connection problem.
here is my code:
const uri = 'mongodb://****:****#iranroboticacademy-bdziw.mongodb.net/test';
mongoose.connect(uri,{ useNewUrlParser: true });
mongoose.connection.once('open', function(){
console.log('DataBase is connected. ');
}).on('error', function(error){
console.log('Connection error:', error);
});
and here is the erro that I get when I run the app in host:
Connection error: { MongoNetworkError: failed to connect to server [iranroboticacademy-shard-00-00-bdziw.mongodb.net:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 3.226.212.92:27017]
at Pool.<anonymous> (/home/iranrob1/public_html/node_modules/mongodb/lib/core/topologies/server.js:433:11)
at Pool.emit (events.js:182:13)
at createConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:577:14)
at connect (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:1021:9)
at makeConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:31:7)
at callback (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:247:5)
at TLSSocket.err (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:276:7)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoNetworkError',
[Symbol(mongoErrorContextSymbol)]: {} }
(node:6409) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [iranroboticacademy-shard-00-00-bdziw.mongodb.net:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 3.226.212.92:27017]
at Pool.<anonymous> (/home/iranrob1/public_html/node_modules/mongodb/lib/core/topologies/server.js:433:11)
at Pool.emit (events.js:182:13)
at createConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:577:14)
at connect (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:1021:9)
at makeConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:31:7)
at callback (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:247:5)
at TLSSocket.err (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:276:7)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:6409) 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:6409) [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.
Sure you can use the free tier of MongoDB Cloud.
It’s actually much easier to mantain than the hosted version as you have visually all under control, automatic backups etc.
https://mongodb.com
I have asked my host provider in a ticket and they said it doesn’t support mongodb. I have written everything with mongodb database in my application and I really can’t change it into other things. I need to use it in this host. Is there anyone who has a solution for this?!
try to use 'connect to your aplication', copy the then change the
Error: connection refused: localtunnel.me:37244 (check your firewall settings)
your url is: https://pretty-skun-91.localtunnel.me
/usr/lib/node_modules/localtunnel/bin/client:65
throw err;
^
Error: connection refused: localtunnel.me:37244 (check your firewall settings)
at Socket.<anonymous> (/usr/lib/node_modules/localtunnel/lib/TunnelCluster.js:47:32)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
To solve this question I think I need to generate a client sdk for my api.
I have installed Autorest and am trying the command
AutoRest -mynamespace mytrack.Client -CodeGenerator CSharp -Modeler
Swagger -Input swagger.json -PackageName mytrack.client -AddCredentials true
The results are
AutoRest code generation utility [version: 2.0.4262; node: v10.1.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
(node:9764) ExperimentalWarning: The fs.promises API is experimental
ERROR: Schema violation: Object didn't pass validation for format email:
- file:///C:/dev/autoresttest/swagger.json:1:156 ($.info.contact.email)
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 7)
(node:9764) [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.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 8)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 9)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 10)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 11)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 12)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 13)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 14)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 15)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 16)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 17)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 18)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 19)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 20)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 21)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 22)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 23)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 24)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 25)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 26)
(node:9764) UnhandledPromiseRejectionWarning: TypeError: volume[member].bind is not a function
at patchFilesystem (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:277:43)
at C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:281:18
at Object.global.staticloader.undo (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:163:7)
at process.exit.n [as exit] (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:170:27)
at main (C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\app.js:514:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) 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: 27)
Shutting Down
I had left the email out of the Swagger Contact information set in SwaggerDoc
I need to know about the Mongo DB Remote Server Connection using in Meteor.As i did something shown below :
database = new MongoInternals.RemoteCollectionDriver("mongodb://x.x.x.x:3001/dbname");
I got the below error :
I20150121-11:51:14.066(5.5)? Exception in callback of async function: Error: failed to connect to [x.x.x.x:3001]
I20150121-11:51:14.066(5.5)? at null.<anonymous> (/home/abc/.meteor/packages/mongo/.1.0.8.hj5n7c++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/server.js:536:74)
I20150121-11:51:14.066(5.5)? at emit (events.js:106:17)
I20150121-11:51:14.066(5.5)? at null.<anonymous> (/home/abc/.meteor/packages/mongo/.1.0.8.hj5n7c++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
I20150121-11:51:14.066(5.5)? at emit (events.js:98:17)
I20150121-11:51:14.066(5.5)? at Socket.<anonymous> (/home/abc/.meteor/packages/mongo/.1.0.8.hj5n7c++os+web.browser+web.cordova/npm/node_modules/mongodb/lib/mongodb/connection/connection.js:516:10)
I20150121-11:51:14.067(5.5)? at Socket.emit (events.js:95:17)
I20150121-11:51:14.067(5.5)? at net.js:440:14
I20150121-11:51:14.067(5.5)? at process._tickCallback (node.js:419:13)
How to solve the above error using Meteor.So please suggest me what to do for this.