MEAN: Unhandled rejection MongoError: not authorized on mean-dev to execute command - node.js

I installed meanjs in my OpenSUSE distro, however when I run npm start, here's what I get:
+ Important warning: config.domain is empty. It should be set to the fully qualified domain of the app.
Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/connection/pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:121:18)
at MongoStore (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:96:26)
at Object.module.exports.initSession (/home/tasher/Projects/meanjs_test/config/lib/express.js:120:12)
at Object.module.exports.init (/home/tasher/Projects/meanjs_test/config/lib/express.js:243:8)
at /home/tasher/Projects/meanjs_test/config/lib/app.js:25:23
at /home/tasher/Projects/meanjs_test/config/lib/mongoose.js:35:21
at process._tickCallback (internal/process/next_tick.js:109:7)
Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/tasher/Projects/meanjs_test/node_modules/mongodb-core/lib/connection/pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:121:18)
at MongoStore (/home/tasher/Projects/meanjs_test/node_modules/connect-mongo/src/index.js:96:26)
at module.exports (/home/tasher/Projects/meanjs_test/config/lib/socket.io.js:73:20)
at Object.module.exports.configureSocketIO (/home/tasher/Projects/meanjs_test/config/lib/express.js:214:38)
at Object.module.exports.init (/home/tasher/Projects/meanjs_test/config/lib/express.js:258:14)
at /home/tasher/Projects/meanjs_test/config/lib/app.js:25:23
at /home/tasher/Projects/meanjs_test/config/lib/mongoose.js:35:21
at process._tickCallback (internal/process/next_tick.js:109:7)
error: uncaughtException: getaddrinfo ENOTFOUND linux-hcjz.suse date=Mon Aug 28 2017 22:46:50 GMT+0100 (WEST), pid=4497, uid=1000, gid=100, cwd=/home/tasher/Projects/meanjs_test, execPath=/usr/bin/node6, version=v6.11.1, argv=[/usr/bin/node6, /home/tasher/Projects/meanjs_test/server.js], rss=97284096, heapTotal=69029888, heapUsed=48863040, external=20182576, loadavg=[0.6513671875, 0.61669921875, 0.43505859375], uptime=3056
Error: getaddrinfo ENOTFOUND linux-hcjz.suse
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
I have re-installed meanjs twice but in vain. Mongo is also running. By the way:
tasher#linux-hcjz:~/Projects/meanjs_test> node -v
v6.11.1
tasher#linux-hcjz:~/Projects/meanjs_test> npm6 -v
3.10.10
Any thoughts?

try adding execution permission to your mean-dev
chmod 755 path_for_package/mean-dev
replace path path_for_package with your path

Related

Not able to connect my service with Redis

My server is located on client premise.
I'm facing an issue, in that my service(node js) is not able to connect with redis.
If I'm checking the status of redis it's running fine.
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-15 14:16:34 EAT; 18h ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Main PID: 3085148 (redis-server)
Status: "Ready to accept connections"
Tasks: 5 (limit: 19104)
Memory: 8.2M
CGroup: /system.slice/redis-server.service
I'm able to connect with the service manually from one server providing host and port.
But the issue is when my service is trying to connect so it's failing.
So can anyone help me in suggesting what could be a possible reason for the same?
Error:
[ioredis] Unhandled error event: Error: connect ETIMEDOUT
16|pdsl_pa | at Socket.<anonymous> (/var/www/stage_env/pdsl_parking_service/node_modules/ioredis/built/redis/index.js:318:37)
16|pdsl_pa | at Object.onceWrapper (node:events:645:28)
16|pdsl_pa | at Socket.emit (node:events:526:28)
16|pdsl_pa | at Socket.emit (node:domain:475:12)
16|pdsl_pa | at Socket._onTimeout (node:net:501:8)
16|pdsl_pa | at listOnTimeout (node:internal/timers:559:17)
16|pdsl_pa | at processTimers (node:internal/timers:502:7)
16|pdsl_pa | [ioredis] Unhandled error event: Error: connect EHOSTUNREACH 172.**.***.***:6379
16|pdsl_pa | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
16|pdsl_pa | [ioredis] Unhandled error event: Error: connect EHOSTUNREACH 172.**.***.***:6379
16|pdsl_pa | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
16|pdsl_pa | [ioredis] Unhandled error event: Error: connect EHOSTUNREACH 172.**.***.***:6379

Getting Error In ImageMagick of Invalid Parameter - 150?

Hi all I am using ImageMagick to convert image. But while running the server I am getting the following Error. Anyone have the answer for this? The error is below>
Invalid Parameter - 150
ImageMagick Error:
Error: write EOF
events.js:377
throw er; // Unhandled 'error' event
^
Error: write EOF
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
Emitted 'error' event on ImageMagick instance at:
at onwriteError (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:449:12)
at onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:470:11)
at WritableState.onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:180:5)
at ImageMagick.Duplexify._destroy
(E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:190:18)
at E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:182:10
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: -4095,
code: 'EOF',
syscall: 'write'

Intermittent redis connection error: 'UNCERTAIN STATE'

Time and time again, we get this error:
{ Error: Redis connection to some-redis-server:6379 failed - read ETIMEDOUT
at TCP.onStreamRead (internal/stream_base_commons.js:171:27) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
{ AbortError: Redis connection lost and command aborted. It might have been processed.
at RedisClient.flush_and_error (/usr/src/app/node_modules/redis/index.js:362:23)
at RedisClient.connection_gone (/usr/src/app/node_modules/redis/index.js:664:14)
at Socket.<anonymous> (/usr/src/app/node_modules/redis/index.js:289:14)
at Object.onceWrapper (events.js:281:20)
at Socket.emit (events.js:193:13)
at TCP._handle.close (net.js:614:12)
code: 'UNCERTAIN_STATE',
command: 'GET'
args: [ 'some-key' ] }
We are using https://www.npmjs.com/package/redis to access redis.
Some details of the setup:
Currently 25GB of data stored in Redis
Writes = a rate of approximately 2MB/sec.
Max number of concurrent clients connected: 400
I don't know where to really start looking, so any help would be appreciated.

MongoError: Unknown modifier: $pushAll

MongoError: Unknown modifier: $pushAll
at Function.MongoError.create (E:\ecom\node_modules\mongodb-core\lib\error.js:31:11)
at toError (E:\ecom\node_modules\mongodb\lib\utils.js:139:22)
at E:\ecom\node_modules\mongodb\lib\collection.js:1059:67
at E:\ecom\node_modules\mongodb-core\lib\connection\pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
POST /product/572a35ce194328dc20bfb7c7 500 3099.572 ms - 665

Node.js, ws-tcp-relay with nats: connection error

Please help solve the problem:
When I start the nats server listening 4222 port:
./gnatsd --addr localhost --port 4222, then
./ws-tcp-relay localhost:4222 -p 4223 and try to connect through websockets using websocket-nats like this (in service.js for example):
'use strict';
const nats = require('websocket-nats').connect('ws://localhost:4223');
I get this error:
node server.js
events.js:188
throw err;
^
Error: Unhandled "error" event. (Could not connect to server: Error: getaddrinfo ENOTFOUND localhost:4223 localhost:4223:4223)
at Client.emit (events.js:186:19)
at Socket.<anonymous> (/home/dev/projects/node-pub/node_modules/websocket-nats/lib/nats.js:404:14)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
But, if I try to connect to nats directly using tcp client port 4222, the connection establishes succesfull:
const nats = require('nats').connect('nats://localhost:4222');

Resources