Closed davidbehler closed 3 years ago
This seems to be that the client cdn isn’t updated, and also that your not running the latest version.
https://github.com/deepstreamIO/deepstream.io/commit/347621d0bcc1302d8b9133c2cf8a148db2b0b9e2
5.1.1 was released shortly after 5.1 and has that fix.
Like I said in the other issue, I'm trying to use deepstream in the browser and the cdn is the only way to access the .js file. The release does only contain TypeScript files and I don't know how to compile them myself.
So I'll have to wait for the cdn to be updated?
And how can the client crash the server?
The comment I made contained the commit with the issue, mentioned the fact it was fixed in 5.1.1
Please note that 5.1.1 is the server and not the client.
The client cdn is actually correct, since it’s sending down the new messages in the protocol.
The reason it’s crashing is because there are some new fields in the protocol and a guard wasn’t in place to support both cases.
2.0 was years ago, but we never bundled js files into the git release. Normally people would instead use npm and then reference ‘node_modules/@deepstream/client/dist/Client.min.js’ or something similar. Depends greatly on your client side development environment (script tags, bower, npm, etc).
Please confirm your on 5.1.1 on the server.
I used 5.10 because it's the top release on the list of releases:
I didn't even check the release below as I expected the first entry in the list to be the latest release.
I'll give 5.11 a try and get back to you.
I've updated the server to 5.11 while still using the client from the cdn and now I'm getting a different error:
INCOMING_CONNECTION | from undefined (95.222.240.129)
AUTH_SUCCESSFUL | peer-1685-103236
/usr/local/bin/dist/src/services/permission/valve/rule-application.js:109
this.params.recordHandler.removeRecordRequest(this.params.name);
^
TypeError: Cannot read property 'removeRecordRequest' of undefined
at RuleApplication.destroy (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:109:35)
at RuleApplication.run (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:66:18)
at new RuleApplication (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:33:14)
at ConfigPermission.canPerformAction (/usr/local/bin/dist/src/services/permission/valve/config-permission.js:86:9)
at MessageProcessor.process (/usr/local/bin/dist/src/utils/message-processor.js:53:46)
at WSBinarySocketWrapper.unauthenticatedSocketWrapper.onMessage (/usr/local/bin/dist/src/connection-endpoint/base/connection-endpoint.js:238:18)
at WebSocket.<anonymous> (/usr/local/bin/dist/src/services/http/node/node-http.js:109:35)
at WebSocket.emit (events.js:223:5)
at Receiver.receiverOnMessage (/usr/local/bin/node_modules/ws/lib/websocket.js:800:20)
at Receiver.emit (events.js:223:5)
This happens right after I call client.event.subscribe()
. Here's what my code looks like:
var client = new DeepstreamClient('example.com:6020');
client.on('connectionStateChanged', StateChangedCallbackFunction);
client.on('error', errorCallbackFunction);
client.login({username: 'some-user'});
client.event.subscribe('some-event', eventCallbackFunction);
This is code that worked fine with the v4 version.
Should'nt you wait for login success to subscribe to events?
On Tue, Jun 2, 2020 at 7:38 AM David Behler notifications@github.com wrote:
I've updated the server to 5.11 while still using the client from the cdn and now I'm getting a different error:
INCOMING_CONNECTION | from undefined (95.222.240.129) AUTH_SUCCESSFUL | peer-1685-103236
/usr/local/bin/dist/src/services/permission/valve/rule-application.js:109 this.params.recordHandler.removeRecordRequest(this.params.name); ^ TypeError: Cannot read property 'removeRecordRequest' of undefined at RuleApplication.destroy (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:109:35) at RuleApplication.run (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:66:18) at new RuleApplication (/usr/local/bin/dist/src/services/permission/valve/rule-application.js:33:14) at ConfigPermission.canPerformAction (/usr/local/bin/dist/src/services/permission/valve/config-permission.js:86:9) at MessageProcessor.process (/usr/local/bin/dist/src/utils/message-processor.js:53:46) at WSBinarySocketWrapper.unauthenticatedSocketWrapper.onMessage (/usr/local/bin/dist/src/connection-endpoint/base/connection-endpoint.js:238:18) at WebSocket.
(/usr/local/bin/dist/src/services/http/node/node-http.js:109:35) at WebSocket.emit (events.js:223:5) at Receiver.receiverOnMessage (/usr/local/bin/node_modules/ws/lib/websocket.js:800:20) at Receiver.emit (events.js:223:5) This happens right after I call client.event.subscribe(). Here's my full code:
var client = new DeepstreamClient('example.com:6020'); client.on('connectionStateChanged', callbackFunction); client.on('error', errorCallbackFunction); client.login({username: 'some-user'}); client.event.subscribe('some-event', eventCallback);
This is code that worked fine with the v4 version.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io/issues/1073#issuecomment-637311059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKH2V7MGRJKFK6XWPYLQTRUSM7ZANCNFSM4NN6BHTA .
-- Slah Lachtar Tel. (+216) 98 221 575
You are correct and that's actually what the code does but my above example skipped that, because I did not think it was revelant. Foolish me 🙈
The subscribe method is actually called in the login callback:
client.login({username: 'some-user'}, function() {
client.event.subscribe('some-event', eventCallbackFunction);
});
Any news on this?
hey @davidbehler
Sorry for the delay.
Are you using custom permissions? Looks like it's a cross referencing bug
What do you mean by "custom permissions"?
as in are you using the default valve permissions or did u modify it?
I've posted my config.yml in my initial post. Does that help?
unfortunately not no. The config in permissions: fileLoad(permissions.yml)
is what matters. If changed
I have not touched the permissions.yml, but here it is:
presence:
"*":
allow: true
record:
"*":
create: true
write: true
read: true
delete: true
listen: true
notify: true
event:
"*":
publish: true
subscribe: true
listen: true
rpc:
"*":
provide: true
request: true
Hmm. Honestly I have no idea what can be causing this. Subscribing to an event is something I used to do on a daily basis, there are a bunch of tests and it feels like something that would have been raised by other users.
If you create a small reproducible repo I can took a look into it. The code you pasted doesn't replicate the issue for me. Thanks!
Closing this for now. Please reopen if problemm persist and share some reproducible code to test the issue.
Might be related to deepstreamIO/deepstream.io-client-js/issues/528, but not sure.
What I did:
sudo deepstream start --config /etc/deepstream/config.yml
new DeepstreamClient('example.com:6020');
INCOMING_CONNECTION | from undefined (95.222.240.129)
immediatly followed by this error:My config.yml:
Any idea what might be causing this and what can be done about it?