Code Monkey home page Code Monkey logo

Comments (10)

tarlepp avatar tarlepp commented on August 21, 2024

Weird. Haven't seen that before. I need to take better look for that. Could you provide more information (logs + etc.) about this problem?

from angular-sailsjs-boilerplate.

spaiter avatar spaiter commented on August 21, 2024

Yes, here is the log:

error: Could not load session for socket #0HvhW7TMHXBuPcLwVKvV
error: The socket's cookie could not be parsed into a sessionID.
error: Unless you're overriding the authorization function, make sure you pass in a valid sails.sid cookie
error: (or omit the cookie altogether to have a new session created and an encrypted cookie sent in the response header to your socket.io upgrade request)
error: TypeError: Cannot read property 'indexOf' of undefined
at exports.parseSignedCookie (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\express\node_modules\connect\lib\utils.js:199:18)
at Object.Session.fromSocket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\session\index.js:339:38)
at SocketNamespace.onConnect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\sockets\lib\connection.js:45:18)
at SocketNamespace.EventEmitter.emit as $emit
at connect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:292:10)
at C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:308:13
at SocketNamespace.authorize (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:252:5)
at SocketNamespace.handlePacket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:302:14)
at Manager.handleClient (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:721:32)
at Manager.handleUpgrade (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:641:8) { [TypeError: Cannot read property 'indexOf' of undefined]
stack: 'TypeError: Cannot read property 'indexOf' of undefined\n at exports.parseSignedCookie (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\express\node_modules\connect\lib\utils.js:199:18)\n at Object.Session.fro
mSocket (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\session\index.js:339:38)\n at SocketNamespace.onConnect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\lib\hooks\sockets\lib\connection.js:45:18)\n
at SocketNamespace.EventEmitter.emit as $emit\n at connect (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:292:10)\n at C:\Winginx\home\angular-sailsjs\backend\node
_modules\sails\node_modules\socket.io\lib\namespace.js:308:13\n at SocketNamespace.authorize (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:252:5)\n at SocketNamespace.handlePacket (C:\Wi
nginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\namespace.js:302:14)\n at Manager.handleClient (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:721:32)\n a
t Manager.handleUpgrade (C:\Winginx\home\angular-sailsjs\backend\node_modules\sails\node_modules\socket.io\lib\manager.js:641:8)' }

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

Aaah, some session id problem. This is something that I haven't yet figured out. This was working with previous versions of sails 0.10.x branch but not anymore.

You can avoid this, just click logout and do that login again.

from angular-sailsjs-boilerplate.

spaiter avatar spaiter commented on August 21, 2024

Even I clear cache, this happens again after logout, and trying to login. I faced with this problem then try to connect to server from 2 different browsers, but with different accounts (admin and demo).

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

Hmm, try also to hit one of backend endpoints eg. GET /book with your browser.

from angular-sailsjs-boilerplate.

spaiter avatar spaiter commented on August 21, 2024

It's happening (error log) on every request to server. End I can't see no books or authors, coz server respond me with no data

from angular-sailsjs-boilerplate.

spaiter avatar spaiter commented on August 21, 2024

In the browser console no errors, in the browser websockets events:
5:12+::{"name":"get","args":[{"method":"get","data":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.NTQzZTAyYTY1ZjgzYjJiNDEyMGZiZTJi.mJlstpX5cLZCfcK93sTc4UM28LAIgBx8UyikdFzQOhM"},"url":"http://localhost:1337/book?limit=10&populate=author&skip=0&sort=releaseDate+DESC","headers":{}}]}

in browser websockets cookies request I can see some key m with value 34e2:|47ba:t|4a01:t|77cb:t, and nothing in response

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

I updated dome session specified stuff to repo. It seems like there is some cookie collision which causes this. In sails.js repo there are couple of issues like this https://github.com/balderdashy/sails/search?q=Could+not+load+session+for+socket+&type=Issues&utf8=%E2%9C%93

You can try to clear your cookies and try again, this trick work for me.

from angular-sailsjs-boilerplate.

vburghelea avatar vburghelea commented on August 21, 2024

@tarlepp - This should be fixed by my merge request, #44 - sorry, I forgot to mention it in the commit.

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

@vburghelea that has been already merged. Closing this now, because no actual updates for original issue. Feel free to open this again if necessary.

from angular-sailsjs-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.