Hello Folks: I am having problem in starting sails app in nodejs. can anyone put forth their insights on that? - node.js

I tried running the latest version of node and postgresql, but was having problem i deprecated node to 13.12.0 and sails-postgresql to 1.0.2 as mentioned in one of the blog. still the error is coming. Stack trace is as below:
sails lift
info: Starting app...
(node:10460) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
info: Initializing apianalytics hook... (requests to monitored routes will be logged!)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error:
error: Error: Sails is taking too long to load.
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more quickly.)
-• Do you have a lot of stuff in assets/? Grunt might still be running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. sails lift --hookTimeout=80000)
-• Is blueprints a custom or 3rd party hook?
(If initialize() is using a callback, make sure it's being called.)
at Timeout.tooLong [as _onTimeout] (C:\Users\dearm\OneDrive\Desktop\my work\sails-logrocket\myapp\node_modules\sails\lib\app\private\loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
error: Could not load Sails app.
error:
error: Tips:
error: • First, take a look at the error message above.
error: • Make sure you've installed dependencies with npm install.
error: • Check that this app was built for a compatible version of Sails.
error: • Have a question or need help? (http://sailsjs.com/support)
complete code is here https://github.com/mannawar/sails_app

Try using Node version 10 and sails-postgresql version 2.0.0

Related

How to resolve nodejs deprecation warning - RFC 6066

I am trying to create a sample nodejs app for kafkajs producer and consumer. When I start the app, I get the deprecation error. So, I tried with --trace-deprecation flag and get this stack trace. How can I fix it? I tried using different versions of kafkajs, but still keep getting this error
(node:61452) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
at Object.connect (node:_tls_wrap:1670:15)
at /BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/network/socketFactory.js:12:13
at module.exports (/BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/network/socket.js:24:18)
at /BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/network/connection.js:240:23
at new Promise (<anonymous>)
at Connection.connect (/BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/network/connection.js:167:12)
at ConnectionPool.getConnection (/BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/network/connectionPool.js:56:24)
at Broker.connect (/BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/broker/index.js:86:52)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /BitBucketRepos/node-js/SimpleProducerConsumer/node_modules/kafkajs/src/cluster/brokerPool.js:319:9
I have tried with using ksfkajs version 1.15.0, 1.16.0, 2.1.0 in package.json - but keep getting the same error.
How can I eliminate this warning?
Thank you
Upgrade your NodeJS version should resolve this
https://techiedan.com/nodejs-ip-address-is-not-permitted-by-rfc-6066/
Upgrade your NodeJS version into the newest stable release. At time of writing, this is at version 15 which should resolve this issue as I believe the IP address is now ignored in future version.

**ERROR! Callback called multiple times** JHipster version 7.3.1 (latest) having Error in Node

I have used other versions of JHipster but that one in my mac is not working fine, I am trying to generate a simple gateway (no entities yet), and after executing:
$jhipster
Filling the application metadata, I just got:
ERROR! Callback called multiple times
Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
at NodeError (node:internal/errors:371:5)
at onFinish (node:internal/streams/writable:667:37)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7) {
code: 'ERR_MULTIPLE_CALLBACK'
So, according to #MattRaible and #GaelMariou, when having the ERROR! Callback called multiple times when generating JHipter applications or entities, you should verify the Node JS version. That version is provided in pom.xml or build.gradle, however, I never found a reference of node version in pom.xml (I use maven).
It is not clear where to get the exact version, nevertheless there is this article that states the same problem using node.js version bigger than 14: https://github.com/jhipster/generator-jhipster/issues/16744.
Meaning you should keep your node.js in version 14 until they solve that issue. I changed to v14.18.1, and now it is working sharp.

Sailsjs: Server crash after using create blueprint with mongodb

I configured the connections.js file in config. I used shortcut route to check whether data is getting stored in the database.
I put the url localhost:1337/test/create?name=hello
It creates an entry in the database but server crashes with this log
process.nextTick(function() { throw err; });
^
TypeError: Right-hand side of 'instanceof' is not callable
at _hasBinary (/usr/local/lib/node_modules/sails/node_modules/has-binary/index.js:31:30)
at hasBinary (/usr/local/lib/node_modules/sails/node_modules/has-binary/index.js:58:10)
at Namespace.emit (/usr/local/lib/node_modules/sails/node_modules/socket.io/lib/namespace.js:214:9)
at Object.broadcastToRoom [as broadcast] (/usr/local/lib/node_modules/sails/node_modules/sails-hook-sockets/lib/sails.sockets/broadcast-to-room.js:74:13)
at child.broadcast (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:139:23)
at child.publishCreateSingle (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1218:14)
at /usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1069:16
at arrayEach (/usr/local/lib/node_modules/sails/node_modules/#sailshq/lodash/lib/index.js:1439:13)
at Function.<anonymous> (/usr/local/lib/node_modules/sails/node_modules/#sailshq/lodash/lib/index.js:3500:13)
at child.publishCreate (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1068:11)
at child.wrapper [as publishCreate] (/usr/local/lib/node_modules/sails/node_modules/#sailshq/lodash/lib/index.js:3250:19)
at created (/usr/local/lib/node_modules/sails/lib/hooks/blueprints/actions/create.js:48:19)
at wrapper (/usr/local/lib/node_modules/sails/node_modules/lodash/index.js:3592:19)
at applyInOriginalCtx (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:421:80)
at wrappedCallback (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:324:18)
at success (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
at _switch (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:58:28)
at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/dql/create.js:248:9
at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:52:16
at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:269:32
at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:44:16
at child.<anonymous> (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:152:44)
Update:20-Dec-2017..
This is what i had gotten when in installed the >sails-mongo adapter...What exactly is the version 2.1.20 of..?
Faizaans-MacBook-Pro:foobar faiz$ npm install sails-mongo --save
npm WARN deprecated mongodb#2.1.20: Please upgrade to 2.2.19 or higher
+ sails-mongo#0.12.2
added 14 packages in 7.967s
I couldn't figure out the exact issue here. I tried to connect my project to mysql and the same issue came up. The problem got solved when I created a new project and tried connecting it to the database.

Error: The hook `orm` is taking too long to load

whenever trying to lifting sails it gives me the hookTimeout error every time.
While for the same configuration settings it's perfectly running on other systems.
using Ubuntu 16.0.4 and Manjaro
nodejs version 7.4.0
sails version 0.12.11
Mongodb version 3.4.1
the complete error report is like this.
info: Starting app...
error: Grunt :: /usr/local/lib/ruby/gems/2.4.0/gems/sass-3.4.23/lib/sass/util.rb:1109: warning: constant ::Fixnum is deprecated
error: Grunt :: /usr/local/lib/ruby/gems/2.4.0/gems/sass-3.4.23/lib/sass/util.rb:1109: warning: constant ::Fixnum is deprecated
error: Error: The hook orm is taking too long to load.
Make sure it is triggering its initialize() callback, or else set `sails.config.orm._hookTimeout to a higher value (currently 60000)
at Timeout.tooLong [as _onTimeout] (/home/navalk/PV/provakil/sails/node_modules/sails/lib/app/private/loadHooks.js:92:21)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
Try do cut your last created/changed model.
If won't help, try to cut one by one and move to another folder.
You will then find if it is issue with some of your models or really with sails.
Try increasing hook timeout in local.js
hookTimeout : 30000,

trouble in sails lift on AWS server

when I am running the project with sails lift then it shows -
Aborted due to warnings.
Running "sails-linker:devTpl" (sails-linker) task
padding length 4
Warning: Unable to write "views/layout.ejs" file (Error code: EACCES).
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/var/myproj/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 1000 /var/myproj/.tmp
I have tried all the given steps like provide access to .tmp and npm install
and when I am debugging the code by sails debus is shows :
Grunt :: Error: listen EADDRINUSE :::5858
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at Agent.Server._listen2 (net.js:1234:14)
at listen (net.js:1270:10)
at Agent.Server.listen (net.js:1366:5)
at Object.start (_debug_agent.js:21:9)
at startup (node.js:72:9)
at node.js:972:3
Strange part is its running on my local system and on normal(other) server very fine and correctly working.
You'll need to chmod the views directory

Resources