Active
Project:
DrupalChat
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2012 at 01:45 UTC
Updated:
1 Aug 2023 at 13:06 UTC
Jump to comment: Most recent
Hello,
If I change long polling to node.js (with or without drupalchat nodejs sub-module enabled), then all chat users disappear from the chat list, including the public chatroom itself. Nodejs has been working on my site for some time now, integrated with another module, so I know that it works. I have however changed the default port that Nodejs listens on, could that be the reason? In that case, could I suggest making the nodejs port configurable in drupalchat?
Thank you.
Best regards,
Ao
Comments
Comment #1
Routh commentedI can confirm the exact same behaviour on mine. Recent update did not fix the issue. I'm beginning to wonder if this was due to an update in nodejs, or if nodejs is going to become of this regrettable 'paid' module.
Comment #2
darklrd commentedHi Routh,
The option to use nodejs as a backend for DrupalChat is still under development. Thanks.
Comment #3
Routh commentedWhen did this change? I had node.js working on my site with your server for months?
Comment #4
darklrd commentedWith the addition of new features - anonymous chat and public chatroom, some changes need to be made to the code. Also, I am not sure whether nodejs module itself has been updated. Will look into this when I get some time. Thanks.
Comment #5
Aonoa commentedI hope this is not forgotten, since it has been a long time since there was some activity here. Are you working on this, or do you have any estimate as to when nodejs support is available? :-)
Thank you for your time and effort on this module.
Best regards,
Ao
Comment #6
tnewhook commented@darklrd - thanks for all your work. I'm also very anxious to get node.js up and running with drupalchat.
Comment #7
darklrd commentedHi,
Yes, I haven't forgotten this issue but I have been busy with the development of our demo site. It will take me sometime before I will be able to fix it.
Thanks!
Comment #8
inventlogic commentedIs this still a problem?
I have node.js setup and working on other modules.
I added the Drupal Chat extension to the nodejs config file for the server.
When I check the nodejs server logs the drupalchat channel is added and the clients are added to the channel and the update messages are sent to the clients but in the 3 client browsers nothing. nada. zilch.
so is this the same issue as above? Has it been fixed?
Comment #9
fabianx commentedYes, still a bug :-(.
This code can't work ...
As drupalchat_names is never defined ...
Comment #10
plessas commentedI doubt this is ever going to get fixed by the module developers, since it will be against the paid version (iflychat). Not to be misunderstood, this is not a blame. If anyone else gets to fix it, it would be great.
Comment #11
fraweg commentedHello,
I am also interested to make this module work with nodejs integration.
One question.. What is "3 client browsers" ? Does it mean the module works only for two users?
Thats right but I think this is a open source project. So the main development should be against the free nodejs server ... IMHO
Best regards
Frank
Comment #12
inventlogic commentedIf you open 3 different browsers Chrome Firefox Opera each browser is considered a different client and is registered via the DrupalChat module in node.js. OK you could open up 2 and do the test that way as well but I thought maybe the problem was the browsers so i tried 3 and i think even a 4th to be sure.
The messages sent from each browser client via DrupalChat show up in node.js and are sent out to the correct client by node.js but they are never shown by DrupalChat in the receiving browser client.
So the function that snags the outgoing messages from node.js and displays them in DrupalChat is broken.
Comment #13
sazcurrain commentedHi,
I used to have the same issue (users not showing in drupalchat), but i solved it by adjusting the nodejs.config.js file.
The key is in the "publishUrl" variable. I used to have "publishUrl": "/nodejs/publish", but the correct configuration is to use the "baseAuthPath" variable to fix the base of every url. If you don't especify this variable, the default value will be "baseAuthPath": "/nodejs/". Then, with the value that i used to have in "publishUrl" the resulting publish url was "/nodejs//nodejs/publish".
So the correct config is: "baseAuthPath": "/nodejs/", "publishUrl": "publish",
With only this little change (i'm using the dev version of drupalchat), i been able to see the users in the chat window and to send messages between them.
This is my nodejs.config.js file:
I've found another problem, but only using Chorme as browser. When the user logs out in Chrome, the 'client-disconnect' event is never fired, so the user remains as logged in to drupalchat.
Any ideas why this can be happening?
Comment #14
fraweg commentedHello,
thanks for your detailed answer!
I have the same issue. Have you solve this issue?
Best regards
Frank
Comment #15
sazcurrain commentedNo, i haven't :(
Here is a thread in the nodejs issues http://drupal.org/node/1823254, but the solution suggested there have not worked for me.
Hope you got better luck!
Comment #16
fraweg commentedOk..
Thanks a lot for your post.. I will test it..
Best regards
Frank
Edit: For me this patch "http://drupal.org/node/1823254" also didn't change the problem :-(
Comment #17
fraweg commentedHello,
I am not fit with nodejs. But have we to configure socket.io?
https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO
Can someone answer who have knowledge in that?
Best regards
Frank
Comment #18
fabianx commentedOkay, it works for me now as well without the patch.
I had two problems:
* wrong "publish" path
* a module blocking access to nodejs/message and giving 403 instead.
Thanks!
Comment #19
socialnicheguru commented#18- which module was it and how did you determine it?
Comment #20
fraweg commentedHello Fabianx,
did you have also the problem with the "logout" with opera and chrome?
Best regards
Frank
Edit: @Fabianx maybe you can post your nodejs config and tell us which module makes problems with nodejs?
Comment #21
fabianx commented#19: It was a custom module that was enabled on that site. I did check it by running:
#20: I did so far not have problems with logout on opera or Chrome. I use a configuration generated by newest nodejs configuration utility.
Comment #22
fraweg commentedThanks Fabianx for your infos!
That let us hope ;-)
Can you tell us which version of the node-server and what system you use?
Best regards
Frank
Comment #23
Aonoa commentedIs nodejs actually working with drupalchat now?
Best regards,
Ao
Comment #24
fabianx commented#23: Yes, it does. But it is very hard to configure.
I suggest getting nodeJS to work in itself before first. (Try the broadcast module)
And just then adding the DrupalChat NodeJS extension and activating it.
Comment #25
sahithya06 commentedHi can I know where I can find the nodejs.config.js file?
Comment #26
fraweg commentedHello sahithya06 ,
this should be in the directory of the nodejs-integratio module.
Best regards
Frank
Comment #27
fraweg commentedHello Fabianx,
It was really great when you can tell me wich version of nodejs you use. Do you use this on a windows or linux mashine?
Best regrads
Frank
Comment #28
fabianx commentedHi Frank,
I don't know the version. I just updated via:
npm install node
I use this on linux.
Best,
Fabian
Comment #29
sahithya06 commentedHi sazcurrain
I am facing the same issue and have double checked my settings with yours and they appear to be the same. However, I am still unable to view the users and the public chatroom. When debug is set to false, I get the message "Backend Authentication failed" and when it is set to true I can see "body: '{"error":"Invalid service key."}' }" . Would you happen to know why this issue is caused?
I guess there is some problem with the service key. I maintained the service key mentioned in config file by adding this line to settings.php :
$conf['nodejs_service_key'] = 'myservicekey';
Would really appreciate it if you could suggest what might have gone wrong!
Best,
Sahithya
Comment #30
fraweg commentedHello Fabian,
thanks for your answer. It is possibe to type in a console on your linux-server:
and tell us the result?
Best regards
Frank
Comment #31
sazcurrain commentedHi Sahithya,
Unfortunately, I don't have an answer for you. That configuration seems to be right. I tried to find an answer in the node.js issues, but i only find the question you asked over this particular problem.
Anyway, I'm not longer been working with drupalchat, because I'm configuring a bigger, more scalable solution based in XMPP.
I'm using Openfire, Jappix mini and LDAP to configure a service independent of Drupal.
Best of lucks to solve your issue!
Comment #32
fraweg commentedHello Sahithya,
This sound really interesting. Can you tell us a little bit more? Do you use the drupal xmpp integration? And how do combine this with drupal?
Best regards
Frank
Comment #33
fraweg commentedHello sazcurrain,
here is my working nodejs-config...I hope this helps!
Best regards
Frank
Comment #34
sazcurrain commentedHi Frank,
No, i'm not using the Drupal-XMPP integration, because this aims to replicate de users database of Drupal to the one of XMPP. So, when a user logs in to Drupal, if he's not present in the XMPP database, he's signed up to that service automaticly.
But i'm aiming to use a LDAP service to control authentication (both to Drupal and XMPP), so that behaviour is of no use to me.
So I decided to use a simpler way to integrate a chat widget to the site, using Jappix Mini.
Jappix Mini is a simple, JQuery based interface (similar to the Facebook chat) that displays the friends list and allows to one on one and multi-user chats. You just have to configure a XMPP service with BOSH connections enabled (a very simple thing to achieve whith Openfire) and tell Jappix the service URL.
Then, you can embbed the interface in your site by adding a short javascript snippet in the header (or in a custom block). All the configuration of the interface (including the XMPP service URL) can be configured in this snippet.
Anyway, this "solution" has its own problems, because you must send the user an password to XMPP in plain text, right on the snippet. This is a serious security issue because any person who sees the code of your site (remeber, it's a javascript snippet, so its executed in the client side) can see your LDAP user and password!!!
Right now i'm searching for a workaround to this issue.
If you are interested in configuring an enviroment to test this kind of solution, here is a very usefull article describing how to set it up: http://groups.drupal.org/node/59163
Hope it helps!
Comment #35
fraweg commentedHello,
thanks a lot for your infos! I will have a look into it...
Best regards
Frank
Comment #36
fabianx commented#30
I did use the drupal generated configuration, beware that I also had the bug that I used a prefix within the nodeJS config for the nodejs internal path.
Note: The key needs to be the same within the nodejs.config and the drupal node js configuration "generator".
Comment #37
bazzly commentedCan some one help me with this...? I have nodejs working, but cant get it to work with drupal chat... When I do the system wide I get back Msg - Undefined But I do get the message in the browser window.
I have tried many configurations, but cant seem to get my users to show up...
I'm using a vanilla instal... so no special configs..Any ideas?
Found the problem.. the port is blocked... How can I change the port? If I change it in the nodejs.config.js and run the sever I get "warn - error raised: ERROR : listen EACCES
Comment #38
socialnicheguru commentedshut down your server and restart
changing the nodejs server config does not stop nodejs from listening on the old port.
Comment #39
bazzly commentedDont suppose you could tell me what file to edit..? Feel like a goof asking, but I'm at my wits end... I did an edit to the server.js ports rebooted and same error. I had the nodejs.config.js with the same port setup. I have been at this all day, so its been an uphill struggle.
Comment #40
bazzly commentedCan anyone give me an idea what I should try?
Thanks :)
Comment #41
fraweg commentedHello bazzly,
I think you should exactly tell us what you have done until now.
Best regards
Frank
Comment #42
bazzly commentedFair... So the current environment is, a VBox Lubuntu machine. The host OS is XP. (Bad set up I know, but its all I have to currently work with.) The host machine is forwarding port 80 to the Vbox machine. (I also tired with 8080.
For the most part I copied the example above for my config.
So when I do a system wide broadcast from nodejs I can get it from the host machine to the VBox machine, and the VBox machine to the host machine, but not out on the network. So my guess is ports, because I know they have a lot of things locked down.
I have tried to change the port in the server.js, and nodejs.config.js, but when I do that I get an error "warn - error raised: ERROR : listen EACCES"
I have changed the server.js, and nodejs.config.js to reflect the ports I wanted it to listen to.(I have also tried doing just one and not the other, then reversed it.)
So in summary.. Nodejs works on VBox machine and host,(As long as I dont change ports) but not outside of that.
I have tried to forward ports from the host machine to the VBox machine, 80, 8080, (and I even tried 81) but before I try to figure out what port to use, I need to get nodejs to listen to the port I want to test.
Thanks!! :)
Comment #43
bazzly commentedAnything?
Thanks
Comment #44
fraweg commentedHello bazzly,
Sorry that I did write for a long time. I am really busy. In my opinion the ports are the problem. I think the node js client must have a direct conection to the ports of the nodejs server to talk.
I hope this helps a little bit!
Best regards
Frank
Comment #45
fraweg commentedHere is a nice link for all who want set up the node.js server with the drupalchat.
http://drupal.arxic.com/node/30
Best regards
Frank
Comment #46
bazzly commentedfraweg; Thanks. My problem is the ports. I cant figure out how to change the listening port for node
Comment #47
bazzly commentedOkay, so I stared to play with this a bit again, and I now get this (I had 2 users logged in when I started the server so I logged them out, then logged them in and this happens.)
Started http server.
info - socket.io started
Logging out http session 911ac1aef3bac37efca758239bf48e33
Logging out http session b9618441851f850a42bef5965f2ead23
Auth - 0
Out - 0
Auth - 0
Out - 0
Auth - 0
Out - 0
Auth - 0
Out - 0
Auth - 1
TypeError: undefined is not a function
at process. (/var/www/intranet/sites/all/modules/nodejs/drupalchat_nodejs.server.extension.js:26:7)
at process.EventEmitter.emit (events.js:98:17)
at setupClientConnection (/var/www/intranet/sites/all/modules/nodejs/server.js:1087:11)
at Request.authenticateClientCallback [as _callback] (/var/www/intranet/sites/all/modules/nodejs/server.js:245:5)
at Request.self.callback (/var/www/intranet/sites/all/modules/nodejs/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request. (/var/www/intranet/sites/all/modules/nodejs/node_modules/request/index.js:873:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage. (/var/www/intranet/sites/all/modules/nodejs/node_modules/request/index.js:824:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
Any ideas?
Thanks
Comment #48
fraweg commentedHello bazzly,
I have the same issue with the nodejs integration 1.1 and 1.2 as you can read here:
http://drupal.org/node/1979348
I think here is no support for the non comercial version (nodejs integration) of drupalchat. I think we are all beta tester to make the comercial version better ;-)
You can use the version 1.0 of nodejs integration. Then the module should work.
Best regards
Frank
Comment #49
bazzly commentedThanks Frank... Guess I'm dead in the water then... I'm using now trying 1.0 of Node.js integration and it's like it doesnt even see whats going on... but it does run.
Well I get feed back, but the users cant see each other...sigh...not sure where to go from here..
If I go to http://localhost:80/nodejs/message I get {"error":"Invalid service key."}
Here is what I get:
node server.jsExtension loaded: drupalchat_nodejs.server.extension.js
Started http server.
info - socket.io started
Authenticating client with key "7dd1e394117911f0f1a4d65ec4f1bda2"
Sending message to backend { authToken: '7dd1e394117911f0f1a4d65ec4f1bda2',
messageType: 'authenticate',
clientId: 'UEUTG4PbJ50umnMnKnpu' } { uri: 'http://localhost:80/nodejs/message',
body: 'messageJson=%7B%22authToken%22%3A%227dd1e394117911f0f1a4d65ec4f1bda2%22%2C%22messageType%22%3A%22authenticate%22%2C%22clientId%22%3A%22UEUTG4PbJ50umnMnKnpu%22%7D&serviceKey=Key',
headers:
{ 'Content-Length': 183,
'Content-Type': 'application/x-www-form-urlencoded' } }
Valid login for uid " 0 "
Auth - 0
Added channels for uid 0:
setupClientConnection {}
Any other ideas?
Thanks
Comment #50
fraweg commentedmaybe you can test with my configuration from #42 and change the hostname...
Best regards
Frank
Comment #51
darklrd commentedAs per above discussion, DrupalChat seems to work with node.js 1.0 (if not please re-open this). At the moment, it doesn't seem to work with node.js 1.2 and we have a separate thread for it, so marking this as fixed. Thanks.
Comment #53
socialnicheguru commentedMy issue is that while I could reach my server url on my local dev setup in my browser I could not ping or curl it from the command line
1. Test that you can reach your server https/http at the port specified
- ping server
- curl server
2. Then go back and test install
Detail:
I have a local dev environment
I also had a multisite install created via aegir
I had ssl enabled
from the command line ping your url
in my case:
ping myurl (it was not my local ip address)
sudo emacs /etc/hosts
add the ssl IP address and path to your /etc/hosts file
redo ping. voila you can find your url
test curl:
curl -kI https:mysite:443/nodejs/message
config file:
443 is the backend server port you specified
"nodejs/message" = messagePath
Comment #54
Syntapse commentedDrupalchat is not working version 1.04 of node.js. Reopening in accord with https://www.drupal.org/node/1546212#comment-7403944.
Comment #55
logicp commentedGreetings! What is the current status of this issue?
Comment #56
Syntapse commentedhi has there been any progress with drupachat and nodejs integration?
Comment #57
Saoirse1916 commentedNo, I can confirm it doesn't work with anything current. I'm using Node.js 6.11 and no luck, despite a working Node install.
UPDATE: Well, that may not be true. I set up a working Node.js server and can send broadcast test messages through it successfully. When I select Node.js as my option in DrupalChat, nothing works. Both the users and the public chat room (if enabled) disappear. If you select Normal AJAX, everything works.
But here's the weird part - I had debugging enabled on my Node.js server (or technically, the node app.js Drupal connector) and when I sent chat messages through DrupalChat, Node.js picked them up. So it's possible that even though I've set Normal AJAX as the polling method, it still routes everything through Node.js, asssuming you've got a working Node.js server and Drupal connector.
Comment #58
mibfire commentedhttp://cgit.drupalcode.org/drupalchat/tree/drupalchat_nodejs/README.txt
Is it still necessary? because when i copy this over i get the follwoing error when i want to start drupal-node.js.
Comment #59
avpadernoThe 7.x-1.x branch is now not supported. Any bug will be fixed in the 7.x-2.x branch, until Drupal 7.x is not supported. It is probably better to focus on resolving bugs in the Drupal 8 branch and make it compatible with Drupal 9 or Drupal 10.