deepstreamIO / deepstream.io

deepstream.io server
https://deepstreamio.github.io
MIT License
7.13k stars 382 forks source link

Incoming connection is undefined, hearbeat missing on websocket #1104

Closed erickgtzh closed 3 years ago

erickgtzh commented 3 years ago

Sorry but the options that I found on the other issues don't fit with mine I've downloaded and run the tar gz file on a digitalocean vps, I want to connect from api on node js but the problem is the following:

image

It appears that wants to connect but after some time is declined, I downloaded the server and it's running, I added my ip to config.yml file on httpServer -> origins also changed serverName on the same file

On users.yml I've added my username as follows:

Screen Shot 2021-07-14 at 15 41 57

and finally, I'm trying to use my deepstream client as following:

const client = ds.login({ username: 'admin', password: 'password' })

but the heartbeat missing WebSocket error is showed... Big thanks in advance!

jaime-ez commented 3 years ago

Hi,

When using file based authentication the password is the hash of the actual password.

Please refer to the documentation here https://deepstream.io/tutorials/core/auth/file/

Feel free to reopen if problem persists.

Best

erickgtzh commented 3 years ago

@jaime-ez thank you so much for your response, I think that I'm not configuring well my server I just downloaded it and started running but I want to connect it with the client that is on an API in node js and mongodb database, could you please share with me a resource about how to connect it?

jaime-ez commented 3 years ago

Hi, here's the list of tutorials:

https://deepstream.io/tutorials/

The best you can do is start reading from the beginning in order to grasp the core concepts, then the install section (depending on how you pretend to use it) and how to configure the server. Then take a look at connectors in order to connect to the database.

Voy a asumir que hablas español Erick. Lee la documentación, sigue los tutoriales, y si algun tutorial falla o tienes dudas concretas donde me compartes un código que no te funciona veré como ayudarte y mejorar la documentación. El tiempo es escaso pero la voluntad de ayudar está. Deepstream a mi me funciona muy bien y me ha servido mucho para avanzar en mis proyectos, saludos!

erickgtzh commented 3 years ago

Qué tal @jaime-ez, muchas gracias por tu ayuda! Actualmente en el que me encuentro es que pareciera que se conecta bien con el connectionString, pero el problema surge al querer hacer conectarse desde el cliente me aparece la segunda imagen y en ese transcurso, en el servidor donde corro deepstream la tercera imagen, agregué mi ip en conf.yml, en origins pero sigue apareciendo como undefined, agradecería si me pudieran orientar un poco, muchas gracias!


Hey @jaime-ez, thank you very much for your help! Currently, the problem I've is that it seems that it connects well with the connectionString, but the issue arises when I want to connect from the client (second image), on the server where I run deepstream I got the result that is displayed on the third image, I added my ip in conf.yml, in origins but it still appears as undefined, I would appreciate if someone could guide me a bit, thank you very much!

image

image

image

jaime-ez commented 3 years ago

Eric please share you config files, the first line on your screenshot says the options [credentials] is not supported.. must be something related to that

jaime-ez commented 3 years ago

No idea unless you share your code.

And please do it by copy pasting the code on github comments, or linking to a gist where I can make comments, don't share files through drive.

Best

El vie, 13 ago 2021 a las 13:38, Erick Gutiérrez. @.***>) escribió:

Eric please share you config files, the first line on your screenshot says the options [credentials] is not supported.. must be something related to that

Thank you, Jaime, I was able to fix the past issues, was because I was using an old version of deepstream but already I'm getting the following issue, it's connected but an error on subscribing:

[Fri Aug 13 2021 12:31:28.170] DEBUG subscribing to channel: message/60b446d27753f40487e81cd3,60b447be7753f40487e81cdd [Fri Aug 13 2021 12:31:28.172] WARN Warning: EVENT (NOT_SUBSCRIBED)

Is there an idea that is causing it? Big thanks in advance!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io/issues/1104#issuecomment-898617907, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF6ROGSE6CSZ6WFLLKAPPLT4VKAJANCNFSM5AMGHNEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

-- Jaime Echegaray Zipper +56-9-94519781

erickgtzh commented 3 years ago

No idea unless you share your code. And please do it by copy pasting the code on github comments, or linking to a gist where I can make comments, don't share files through drive. Best El vie, 13 ago 2021 a las 13:38, Erick Gutiérrez. @.***>) escribió: Eric please share you config files, the first line on your screenshot says the options [credentials] is not supported.. must be something related to that Thank you, Jaime, I was able to fix the past issues, was because I was using an old version of deepstream but already I'm getting the following issue, it's connected but an error on subscribing: [Fri Aug 13 2021 12:31:28.170] DEBUG subscribing to channel: message/60b446d27753f40487e81cd3,60b447be7753f40487e81cdd [Fri Aug 13 2021 12:31:28.172] WARN Warning: EVENT (NOT_SUBSCRIBED) Is there an idea that is causing it? Big thanks in advance!! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1104 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF6ROGSE6CSZ6WFLLKAPPLT4VKAJANCNFSM5AMGHNEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email . -- Jaime Echegaray Zipper +56-9-94519781

Now it's running Jaime, muchas gracias por tu ayuda amigo!!

erickgtzh commented 3 years ago

@jaime-ez sorry man, now I get another error, I saw that there's a similar issue: https://github.com/deepstreamIO/deepstream.io-client-js/issues/534

But I couldn't fix it, I've modified my package.json as following:

{ "name": "chirpcase_api", "version": "1.0.0", "description": "", "main": "dist/src/deepstream.js", "types": "dist/src/deepstream-client.d.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "./deepstream start & nodemon index.js --exec babel-node", "postinstall": "node scripts/postinstall.js" }, "author": "", "license": "ISC", "devDependencies": { "@babel/core": "^7.12.9", "@babel/node": "^7.12.6", "@babel/preset-env": "^7.12.7", "autoprefixer": "^6.4.1", "babel": "^4.0.2", "babel-cli": "^6.9.0", "babel-core": "^6.4.5", "babel-eslint": "^6.1.0", "babel-loader": "^6.2.4", "babel-plugin-transform-runtime": "^6.15.0", "babel-preset-es2015": "^6.9.0", "babel-preset-stage-0": "^6.5.0", "babel-register": "6.11.6", "chai": "^3.5.0", "jshint": "^2.9.2", "mailcomposer": "^4.0.1", "mailgun-js": "^0.8.1", "mocha": "^3.0.2", "nodemon": "^1.10.2", "sass-loader": "^3.2.0", "shipit": "^1.0.2", "shipit-cli": "^1.4.1", "shipit-deploy": "^2.5.1", "shipit-npm": "^0.2.0", "shipit-pm2": "0.0.4", "shipit-shared": "^4.4.2", "shipit-yarn": "^0.2.0" }, "dependencies": { "@deepstream/client": "^5.1.1", "@sendgrid/mail": "^7.2.3", "aws-sdk": "^2.15.0", "bcrypt": "^5.0.1", "body-parser": "^1.15.0", "connect-mongo": "^1.3.2", "cors": "^2.7.1", "crypto": "0.0.3", "deepstream.io-client-js": "^2.3.0", "dotenv": "^0.4.0", }

so I modified: main, types and postinstall

and also ran:

export DEEPSTREAM_ENV='react-native npm install @deepstream/client --save'

My error says:

webpack://DeepstreamClient/./src/connection/socket-factory.ts?:23 : new (__webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'ws'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())))(url, options); ^

Error: Cannot find module 'ws' at webpackMissingModule (webpack://DeepstreamClient/./src/connection/socket-factory.ts?:23:80) at Object.socketFactory (webpack://DeepstreamClient/./src/connection/socket-factory.ts?:23:157) at Connection.createEndpoint (webpack://DeepstreamClient/./src/connection/connection.ts?:207:39) at new Connection (webpack://DeepstreamClient/./src/connection/connection.ts?:90:18) at new DeepstreamClient (webpack://DeepstreamClient/./src/deepstream-client.ts?:61:31) at Object. (/root/scapade-api/services/deepstream/index.js:2:16) at Module._compile (internal/modules/cjs/loader.js:778:30) at loader (/root/scapade-api/node_modules/babel-cli/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/root/scapade-api/node_modules/babel-cli/node_modules/babel-register/lib/node.js:154:7) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/root/scapade-api/services/index.js:3:15) at Module._compile (internal/modules/cjs/loader.js:778:30) [nodemon] app crashed - waiting for file changes before starting...

Big thanks in advance!!

jaime-ez commented 2 years ago

Erick, sorry for the late reply.

Are you installing the client on a react-native project?

jaime-ez commented 2 years ago

Erick, read the error log you just pasted here. It literally tells you where the problem is, and it's not deepstream it's your mongodb url. I don't mean to be rude, but you have to dig deeper before asking on an issue thread, otherwise questions won't be answered. AND Don't share files, if you do it one more time I'll assume you're a bad actor and will ignore all your questions in the future.

Paste your code here formatted for markdown or link to a gist. Good luck

erickgtzh commented 2 years ago

Erick, read the error log you just pasted here. It literally tells you where the problem is, and it's not deepstream it's your mongodb url. I don't mean to be rude, but you have to dig deeper before asking on an issue thread, otherwise questions won't be answered. AND Don't share files, if you do it one more time I'll assume you're a bad actor and will ignore all your questions in the future.

Paste your code here formatted for markdown or link to a gist. Good luck

Gracias, sí sé leer, era un problema con las dependencias de mi repositorio, no te preocupes, ya borré el comentario y agradezco la ayuda, ya está funcionando.