Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Harsheet
@harsheet

info: Starting app...

verbo: Using locally-installed Sails.
: (which is located at C:\Dev\reviewcrew-backend\node_modules\sails)
verbo: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •
verbo: • Loading Sails with "verbose" logging enabled... •
verbo: • (For even more details, try "silly".) •
: • Actually, looks like you're already using "silly"! •
verbo: • •
verbo: • http://sailsjs.com/config/log
verbo: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •
verbo: moduleloader hook loaded successfully. (0ms)
: Loading app config...
verbo: userconfig hook loaded successfully. (131ms)
verbo: Exposing global variables... (you can customize/disable this by modifying the properties in sails.config.globals. Set it to false to disable all globals.)
: Loading user hooks...
verbo: userhooks hook loaded successfully. (1257ms)
: Loading hook: logger
{"level":"warn","message":"---------------------------------------------------------------------------"}
{"level":"warn","message":"Files in the controllers directory may be traditional controllers or \naction files. Traditional controllers are dictionaries of actions, with \npascal-cased filenames ending in \"Controller\" (e.g. MyGreatController.js).\nAction files are kebab-cased (e.g. do-stuff.js) and contain a single action.\nThe following file was ignored for not meeting those criteria:"}
{"level":"warn","message":"- mixins/crudMethods.js"}
{"level":"warn","message":"----------------------------------------------------------------------------\n"}
{"level":"info","message":""}
{"level":"info","message":" .-..-."}
{"level":"info","message":""}
{"level":"info","message":" Sails <| .-..-."}
{"level":"info","message":" v1.5.0 |\"}
{"level":"info","message":" /|.\"}
{"level":"info","message":" / || \"}
{"level":"info","message":" ,' |' \"}
{"level":"info","message":" .-'.-==|/--'"}
{"level":"info","message":" `--'-------' "}
{"level":"info","message":" ---
------------_"}
{"level":"info","message":" __
----------------__"}
{"level":"info","message":""}
{"level":"info","message":"Server lifted in C:\\Dev\\reviewcrew-backend"}
{"level":"info","message":"To shut down Sails, press <CTRL> + C at any time."}
{"level":"info","message":"Read more at \u001b[4mhttps://sailsjs.com/support\u001b[24m."}

my app is not running properly...can anyine help...

I don't see this message above

info: To see your app, visit http://localhost:1337

also if I do
sails lift

I do not see anything

Mike
@_mikeusa_twitter
@harsheet what version of Windows and what version of Node? You should use WSL or a Linux VM, if you can.
8 replies
Harsheet
@harsheet
This message was deleted
serion-sdb
@serion-sdb

Hi,

I'm new to Sails and currently migrating over an application built in Laravel. There's one API route that handles realtime data monitoring and do 2 things:
1) log to MySQL
2) display to the Vue via Websockets

In Laravel, we setup a queue to handle them so the server can quickly process the requests that come in every second (at best).

Myh question is, do I need to set a queue in Sails, or can I just simply use Promise to asynchronously handle the data logging and display?

Thanks

kinalg20
@kinalg20

error: A hook (orm) failed to load!
error:
error: Invalid configuration for datastore adapter:
'sails-mysql'

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)

can you please tell what is missing here because getting this error while connecting sql database
vrajasekhar1
@vrajasekhar1
Hi, is there a way to do a case insensitive search on a model data? Also, how to filter model data based on associate attributes?
5 replies
Humberto0312
@Humberto0312
Hello everyone, could someone help me? I need the id attribute in the models to be UUID or GUID, but in the sails the id attribute is set in the Models setting as autoincrement, how can I convert this id to UUID? Thanks for your help!
1 reply
Daniel Bersuch
@Bersuch

Hello Guys, can someone help me with my Update function?
It says 'TypeError: Cannot read property 'Vorname' of undefined'

My editAdmin.ejs looks like this:

<h1 class="display-4">Edit Admin</h1>

<form method="get" action="<%= admin.AdminNr %>/update">
<div class="form-group">
<label for="Adminnr">ID</label>
<input type="number" name="Adminnr" class="form-control" value="<%= admin.AdminNr %>" readonly>
</div>
<div class="form-group">
<label for="Vorname">Vorname</label>
<input type="text" name="Vorname" class="form-control" >
</div>
<div class="form-group">
<label for="Name">Name</label>
<input type="text" name="Name" class="form-control">
</div>
<input type="submit" value="Submit" class="btn btn-primary">
</form>

My update function in AdminController looks like this:
update: function(req, res) {
Admin.update({AdminNr:req.params.AdminNr}).set({AdminNr:req.params.AdminNr, Vorname:req.body.Vorname, Name:req.body.Name}).exec(function(err) {
if(err) {
res.send(500, {error: 'Database Error'});
}
return res.redirect('/admin/show');
});
//return false;
}

and my calls like this:
'GET /admin/show' : 'AdminController.read',
'GET /admin/add' : 'AdminController.add',
'GET /admin/:AdminNr' : 'AdminController.edit',
'POST /admin/create' : 'AdminController.create',
'GET /admin/:AdminNr/delete ' : 'AdminController.delete',
'GET /admin/:AdminNr/update' : 'AdminController.update',


Every other function works except the one with the update

Greg-J
@Greg-J
What is the best syntax to use to output a variable passed to .ejs only if it exists?
Rahul Pandey
@prahul:matrix.org
[m]
Sails v1.x stores empty properties in database mongoDb, when POST api call is made with request having few properties only from actual model defined in sails model, such properties which are not available in request is saved with empty values in database collection which was not the case in sails v0.12 Since I have migrated project from sails v0.12 to sails v1.x, I am facing this issue which is leading to code breakage on api response.
1 reply

I am using JOI library to validate the request properties and below is the data that is being sent to <ModelName>.create(topic).fetch()

topic = {
published: false,
closed: false,
name: 'Topic G -01',
communityId: '57d640b3-cda6-4703-8080-2ef604de2086',
activityId: '23ef04f4-699d-47c7-94ad-3fb5b1c18889',
createdByUserId: '3cc6dddd-9425-42b8-83fc-4ba3f068128d',
board: '5f7cc128c2380d00172225ee'
}
Data getting saved in database collection as below:

{
_id: ObjectId("61c9d4ec5ceca05c4b0016cb"),
published: false,
closed: false,
name: 'Topic G -01',
communityId: '57d640b3-cda6-4703-8080-2ef604de2086',
activityId: '23ef04f4-699d-47c7-94ad-3fb5b1c18889',
createdByUserId: '3cc6dddd-9425-42b8-83fc-4ba3f068128d',
board: '5f7cc128c2380d00172225ee',
createdAt: '2021-12-28T16:11:07.229Z',
updatedAt: '2021-12-28T16:11:07.229Z',
description: '',
content: null,
official: false,
locked: false,
singleResponses: false,
responseTierLimit: 0,
deleteOwnResponses: false,
showQuantResults: false,
probeQuantResponse: false,
ratingSystem: '',
responseVisibility: '',
allowParticipantQuestions: false,
qIndexVisibility: false,
disablePostReplies: false,
publishedAt: null,
questionIds: null,
updatedByUserId: '',
includedRoles: null,
}
However in sails v0.12, on the contrary it used to store as below:

{
_id: ObjectId("61c9d4ec5ceca05c4b0016cb"),
published: false,
closed: false,
name: 'Topic G -01',
communityId: '57d640b3-cda6-4703-8080-2ef604de2086',
activityId: '23ef04f4-699d-47c7-94ad-3fb5b1c18889',
createdByUserId: '3cc6dddd-9425-42b8-83fc-4ba3f068128d',
board: '5f7cc128c2380d00172225ee',
createdAt: '2021-12-28T16:11:07.229Z',
updatedAt: '2021-12-28T16:11:07.229Z',
}

Hi All, i am facing this problem, please do take a look and let me know if it can be resolved?
Paulo Brás
@PABCon

Hi Guys! I built a website using sails and performance-wise the desktop version is doing really well, but the mobile version, after testing with lighthouse is a bit poor

Hi guys! anyone, able to help?

Please, this would be really important for me
lpmtts
@lpmtts
hello, please can someone help me to configure sails to send emails? didnt find any doc on the site
1 reply
Janagar
@Janagar8
This message was deleted
3 replies
StephenS
@S-Stephen
Using blueprints is it possible to return the id of the associations rather than the entire association? if so what option do I provide in the URL?
Paulo Brás
@PABCon
Hello guys! Anyone knows how i can insert scripts when using vueJS in your sails? I want to add social media follow scripts or sharing, but I am having a hard time to add it to ejs. How should I add this to a vueJS page?
Adi Widodo
@abadiwidodo

Hi, so I disable session hook via .sailsrc file & also delete session.js but when lift the app I still got this error

error: Failed to lift app: Error: Session secret should be manually specified in production!
To set up a session secret, add or update it in config/session.js:
module.exports.session = { secret: 'extremely-secure-keyboard-cat' }
(Or if you don't need sessions enabled, disable the hook.)

is there anything I miss?

Greg-J
@Greg-J
Have used Sails successfully a number of times using mysql, but I'm running into an issue using mongo (first time using it). I get the following error: https://pastebin.com/raw/yU7xJ5Em
However, I can use MongoDB Compass and connect just fine using the exact same connection string from the same computer. Connection string is mongodb://<user>:<password>@192.168.100.101:27017/<db>
Harsheet
@harsheet
Hi guys, I recently upgraded my app to Sails 1.5.0. The API calls stopped working. I changed the model attributes according to the new version. Any idea what could be wrong?
Harsheet
@harsheet
How can i use req.options (outdated in Sails 1.5)?
2 replies
const controller = sails.controllers[req.options.controller];
Paulo Brás
@PABCon
Hello All, my questions are net getting any support :S is it because no one knows the answers or because Im doing something wrong? Please let me know so i can adjust
StephenS
@S-Stephen
@PABCon I don't utilize vue in my apps but how are you trying to include your vue scripts? what does this mean have you got an code snippet of what's not working?
Paulo Brás
@PABCon
@S-Stephen I am using vue-router and vue-pages from Sails. basically, you have the Vue instance JS. if you want to add a script to your HTML, it will prompt an error that you cannot use that script within your vue instance
2 replies
the code script i want to add is a Linkedin follow button (2 script tags from Linkedin itself)
@S-Stephen i also had another question about HTTP 2.0, because my mobile performance could be improved that way, but i cant find anything with regards about improving from HTTP 1.0 to HTTP 2.0
3 replies
Ryan Emberling
@itsalaidbacklife

Has anyone combined a sails app with an SPA into a monorepo before? I'm trying to combine my sails backend with my view frontend into a monorepo that looks like

projectName (root)
  apps
    client (vue spa)
    server (sails app)

I'm able to boot both server and client without errors, but I'm unable to connect a websocket. When I run my non-monorepo backend on the same port (1337), the monorepo's client is able to connect the socket, so it appears to be something wrong with my monorepo version of the back end. I'm trying to identify what the plausible causes of a failure to connect are and so far I think I've ruled out allowOnlyOrigins as the culprit because 1) both versions of my backend have the same allowOnlyOrigins config and 2) The monorepo version of the server doesn't log any warnings about rejecting connections when the client fails to connect.

But otherwise I'm running out of ideas. The error appears clientside and is very vague:

sockjs.js:3002 WebSocket connection to 'ws://192.168.1.131:8080/sockjs-node/095/j1i1gdji/websocket' failed: WebSocket is closed before the connection is established.
WebSocket connection to 'ws://localhost:1337/socket.io/?__sails_io_sdk_version=1.2.1&__sails_io_sdk_platform=node&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed:

Has anyone seen a similar error? Anyone got any ideas?

I have no errors in the terminal console
8 replies
Harsheet
@harsheet
Hi, what is the alternate for req.options in Sails 1.5. I need access to controller and model. The docs suggest to use parseBlueprintOptions but how to access the same from here
NICOLÁS FELIPE OPAZO GANA
@nicolas.opazo_gitlab
Hi, has anyone managed to integrate Keycloack + sails.js? I'm trying with the native libraries for nodejs but it's giving me some errors.
abdul4majeed
@abdul4majeed
Hey everyone.................
I have a problem in development environment of the sails project.
I installed the project and every thing is working fine in development then I start the server in production mode and configure the sails.socket allowedOrigin array in production file.Now the issue is I cannot be able to use the sockets in development mode.
Here is the error shown on the console in browser. There is no error on terminal
sails.io.js:17 WebSocket connection to 'ws://localhost:1337/socket.io/?__sails_io_sdk_version=1.2.1&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=websocket' failed: d.doOpen @ sails.io.js:17 d.open @ sails.io.js:17 d.open @ sails.io.js:16 d @ sails.io.js:16 d @ sails.io.js:16 d.open.d.connect @ sails.io.js:16 d @ sails.io.js:16 d @ sails.io.js:16 d @ sails.io.js:16 goAheadAndActuallyConnect @ sails.io.js:903 selfInvoking @ sails.io.js:880 SailsIOClient.SailsSocket._connect @ sails.io.js:899 (anonymous) @ sails.io.js:1689 sails.io.js:441 ==================================== sails.io.js:441 The socket was unable to connect. sails.io.js:441 The server may be offline, or the sails.io.js:441 socket may have failed authorization sails.io.js:441 based on its origin or other factors. sails.io.js:441 You may want to check the values of sails.io.js:441sails.config.sockets.onlyAllowOriginssails.io.js:441 or (more rarely)sails.config.sockets.beforeConnectsails.io.js:441 in your app. sails.io.js:441 More info: https://sailsjs.com/config/sockets sails.io.js:441 For help: https://sailsjs.com/support sails.io.js:441 sails.io.js:441 Technical details: sails.io.js:441 Error: websocket error at d.onError (sails.io.js:17:7401) at WebSocket.ws.onerror (sails.io.js:17:22312) sails.io.js:441 ====================================
Now i have no idea why this is occur because in development mode sails socket should be connected without any modification like before starting the server in production mode but now it is not connecting in development mode what should I do?
1 reply
Mohan prabhu
@mohanprabhu2000.acumen_gitlab
hi
can anyone help me here

WARNING: A function that was initially called over 15 seconds
ago has still not actually been executed. Any chance the
source code is missing an "await"?

[?] For more help, visit https://sailsjs.com/support


I used both callbacks and async await in one controller file in saisls v1
I get this error
2 replies
Harsheet
@harsheet

Hi guys, what is the type /columntype to declare date attribute in model
I have this
dob: { type: "string", columnType: "date" },
But when running, it is throwing a warning

'Warning: After transforming columnNames back to attribute names for model crew,
a record in the result has a value with an unexpected data type for property lastEmailSent.
The corresponding attribute declares type: 'number' but instead
of that, the actual value is:

2021-06-29T14:00:15.000Z

'

4 replies
Mohan prabhu
@mohanprabhu2000.acumen_gitlab
@harsheet don't worry brother I got a solution change type to 'ref'and column type to 'datetime'. Hope you got the solution
Mohan prabhu
@mohanprabhu2000.acumen_gitlab
Swaroop Jayanthi
@swaroopjayanthi9_gitlab
Does Sails 1.x supports gRPC protocol ? Any limitations or issues please through some light
WTTSoftwareSolutions
@WTTSoftwareSolutions
Did something change in sails or sails-mongo, or waterline today?? Our API server has been running w/o problems deployed to DigitalOcean. This afternoon it stopped working with any actions (action2) that calls the .findOne({criteria}).populate('attributeName').
The following is the stacktrace from the DigitalOcean console:
AdapterError: Unexpected error from database adapter: Consistency violation: `where` clause modifier `_bsontype` is not valid!  This should never happen-- a stage 3 query should have already been normalized in Waterline core.
    at Object.fn (/workspace/api/controllers/users/find.js:45:31)
    at wrapper (/workspace/node_modules/@sailshq/lodash/lib/index.js:3282:19)
    at Deferred.parley.retry [as _handleExec] (/workspace/node_modules/machine/lib/private/help-build-machine.js:1014:29)
    at Deferred.exec (/workspace/node_modules/parley/lib/private/Deferred.js:286:10)
    at Deferred.switch (/workspace/node_modules/machine/lib/private/help-build-machine.js:1469:16)
    at Object._requestHandler [as users/find] (/workspace/node_modules/machine-as-action/lib/machine-as-action.js:1153:27)
    at /workspace/node_modules/sails/lib/router/bind.js:248:46
    at routeTargetFnWrapper (/workspace/node_modules/sails/lib/router/bind.js:395:9)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at next (/workspace/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at /workspace/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/workspace/node_modules/express/lib/router/index.js:335:12)
    at next (/workspace/node_modules/express/lib/router/index.js:275:10)
    at next (/workspace/node_modules/express/lib/router/route.js:127:14)
    at module.exports (/workspace/api/policies/is-logged-in.js:19:12)
    at routeTargetFnWrapper (/workspace/node_modules/sails/lib/router/bind.js:375:23)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
    at next (/workspace/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
Mike
@_mikeusa_twitter
@WTTSoftwareSolutions what is your criteria? Did you stringify/parse it? It looks like the database is choking on a _bsontype, which is a binary serialization.
Most likely of a BSON time stamp.