[Chat] Installation problems - solved

[Chat] Installation problems - solved

  
Forge Component
(29)
Published on 2015-11-24 by Hélio Dolores
29 votes
Published on 2015-11-24 by Hélio Dolores
Hello everybody. I did install Chat Module, configured the backoffice settings and enabled it to all apps and all users. After that what i expected was to see the chat windows in any app i had deployed in my environment... but I am not seeing anything.

The only thing i am seeing when I open any app is a trace in the javascript console like the following one:



I guess this means comunication with chat server is succesfull and a session has been created, but i can see anything else. Do i need to include any widget in each app? Do i need to grant any role to users?

Thanks in advance for any help with this issue. 
Hi Johannes,

If you are using a personal environment please make sure you are via HTTP and not HTTPS.

Can you show me the errors on your console? 

Thanks!
Hi Hélio. Thanks for your answer.

I am not using a personal environment, i am using a development onpremise one. I am using HTTPS and i had some issues because i failed to setup HTTPS on nodeserver, but it seems communication is working fine. Every page i open produces the message i attached in the original post. The console log of Node.js starts this way:

###############################################################################
 
# HTTPS ALERT: PLEASE CONFIGURE THE HTTPS CERTIFICATE AND CONFIGURE BACKOFFICE
 
# Search for this message in the code to configure it
 
# Chat Backoffice: http://<your_server>/chat
 
###############################################################################
 
 
   info  - socket.io started
 
{ [Error: unable to verify the first certificate] code: 'UNABLE_TO_VERIFY_LEAF_
IGNATURE' }
   debug - client authorized
   info  - handshake authorized fP3GYtt41eeXrH48JkIB
   debug - client authorized
   info  - handshake authorized 65FL8XXqYALuSFbkJkIC
   debug - client authorized
   info  - handshake authorized xYa527ypJdLo146AJkID
   debug - setting request GET /socket.io/1/websocket/fP3GYtt41eeXrH48JkIB
   debug - set heartbeat interval for client fP3GYtt41eeXrH48JkIB
   debug - client authorized for
   debug - websocket writing 1::
   debug - setting request GET /socket.io/1/websocket/65FL8XXqYALuSFbkJkIC
   debug - set heartbeat interval for client 65FL8XXqYALuSFbkJkIC
   debug - client authorized for
   debug - websocket writing 1::
   debug - setting request GET /socket.io/1/websocket/xYa527ypJdLo146AJkID
   debug - set heartbeat interval for client xYa527ypJdLo146AJkID
   debug - client authorized for
   debug - websocket writing 1::


Do i need to set up anything else?
I've tested the HTTPS with a self signed certificate on my windows machine.
I just had it on the same folder as Nodejs.exe and changed de server.js file to have the correct certificate name and it worked fine.

I've searched for the error you're having, and found this answer:
http://stackoverflow.com/questions/20082893/unable-to-verify-leaf-signature

The image you've posted just has the chat login messages (I can see an error bellow but is cut).
Do you have any error related with the chat on the console?

From your browser, can you access:

https://<your_nodejs_server>/
> you should see a message "done!"

https://<your_nodejs_server>/socket.io/
> you should see a message "Welcome to socket.io."

thanks


Hi Helio. I am getting those messages ("done" and "welcome to...") when i test the connection,even when invoking them using the "public" address, not the name of the server inside my network. Any idea?

PD: The error message you can see cut is about a missing favico, so i think is not related with chat ;)


This means that the page is communicating with nodejs with no problems. 
The problem should be with the ContactsInfo message processing.

Can I help you on de the debug? (do you have a blank page with chat and Login for me?)

or ...

can you set a breakpoint and follow the flow until it breaks?
Something like this:
http://screencast.com/t/i4qDrcMz

Let me know if you find something,
Hélio


I will try and let you know.

May i ask something: do i need to add any widget to the apps or just applying the backoficce setup to enable chat in all apps should be enough?
The effect is the same.
The webblock exists because you may want the chat to appear just in a particular screen.


I am debugging on a blank page and i think i am having and issue with the visibility of the chatserver. If i work calling the app inside my workplace network the message i get in the javascripte console is the one i showed early. But... when using the app with a mobile network, this is the message i get



I am guessing i have to work i little more in chatserver setup, althougt i would like to see it working at least just inside of my network, because this is still a development trial with this component :(
Some internal networks may not like "weird" ports.

You may try to use the regular http ports 80/443 if you don't have an application server (IIS/Jboss ... ) on the same machine. You can always use a different server for node.js without any other application server.

You can try the following request (I saw the port you're using):
https://<your_nodejs_server>:9085/socket.io/

:)

Actually, Outsystems server and node server are located in same machine, and both behind a IIS server. 

If I call the https://<internal_network_servername>:9085/socket.io/ i get a success message. ("Welcome to socket.io")

If I connect to my mobile network and call https://<internet_name_server>:9085/socket.io/, i get a timeout. That is why i say i need to work more on the setup, but i would like to see it working when connected to my internal network ;)
Ok, let me know when you have these communication issues solved if everything else is working. :)
Hello Helio. Here I am again with this issue.

I decided to configure chatserver on a cloud server. I am using it on a trial account of bluemix, and its working fine. I reconfigured chat app to communicate with that server and the test links work ok.

Now I am having a different error:



It looks like there is a problem with the socket.io library. 

This is how i configured server:

ar port = process.env.PORT;
var host = process.env.VCAP_APP_HOST;
var myserver = new Chat.ChatServer(port, false, "myserver.com", host, true, "mykey", "aspx");

Thanks for any idea...
Hi Johannes,

Can you show me the /Chat/Setup.aspx configuration also?

here's mine:



On /Chat/backoffice.asp:



and my server.js:



I would advise you to try using https first and then configure the http certificate (if possible)

Hélio
Hi Hellio. I configured Chat and Social Network to work in my personal environment but i am having still issues with the enterprise environment :P Let me to something and i will send you the information you are asking about
This was a really silly mistake... i was including https with the url ;) I solved it some minutes ago but i am still facing some issues :P

Johannes Correa wrote:
Hello Helio. Here I am again with this issue.

I decided to configure chatserver on a cloud server. I am using it on a trial account of bluemix, and its working fine. I reconfigured chat app to communicate with that server and the test links work ok.

Now I am having a different error:



It looks like there is a problem with the socket.io library. 

This is how i configured server:

ar port = process.env.PORT;
var host = process.env.VCAP_APP_HOST;
var myserver = new Chat.ChatServer(port, false, "myserver.com", host, true, "mykey", "aspx");

Thanks for any idea...
 
 
Hi,

Good to know that your personal environment installation is working.
On the enterprise I would make it work on HTTP first, then jump to the HTTPs because it's easier to find the root problem.

Let me know the issues you're facing.

H
Hello Helio. This is my enterprise scenario:

1. Outsystems platform is using HTTPS. If I try to connect using HTTP, sites are not found.
2. NodeJS Chatserver is installed in Bluemix. I am starting server with the following command line:

var myserver = new Chat.ChatServer(port, false, "myserver.com", host, true, "mykey*", "aspx");

As far as I understand, this way chatserver is starting without https. However, Bluemix always offer the app as a secure one. You can try at https://chatserverig.mybluemix.net 

I have configured Chat app to connect to https. This way the log i see in the server is like the following one:
2015-07-03T15:24:12.81-0500 [App/0]      OUT debug: emitting heartbeat for client 242yTUeJXK0IddxAfRDc
2015-07-03T15:24:12.81-0500 [App/0]      OUT debug: websocket writing 2::
2015-07-03T15:24:12.81-0500 [App/0]      OUT debug: set heartbeat timeout for client 242yTUeJXK0IddxAfRDc
2015-07-03T15:24:12.89-0500 [App/0]      OUT debug: got heartbeat packet
2015-07-03T15:24:12.89-0500 [App/0]      OUT debug: cleared heartbeat timeout for client 242yTUeJXK0IddxAfRDc
2015-07-03T15:24:12.89-0500 [App/0]      OUT debug: set heartbeat interval for client 242yTUeJXK0IddxAfRDc
2015-07-03T15:24:24.58-0500 [App/0]      OUT debug: emitting heartbeat for client yGcC_If6W4EihHeTfRDd
2015-07-03T15:24:24.58-0500 [App/0]      OUT debug: websocket writing 2::
2015-07-03T15:24:24.58-0500 [App/0]      OUT debug: set heartbeat timeout for client yGcC_If6W4EihHeTfRDd
2015-07-03T15:24:25.25-0500 [App/0]      OUT debug: got heartbeat packet
2015-07-03T15:24:25.25-0500 [App/0]      OUT debug: cleared heartbeat timeout for client yGcC_If6W4EihHeTfRDd
2015-07-03T15:24:25.25-0500 [App/0]      OUT debug: set heartbeat interval for client yGcC_If6W4EihHeTfRDd
2015-07-03T15:24:31.73-0500 [App/0]      OUT debug: emitting heartbeat for client qU0jS5jtdBotAxspfRDb
2015-07-03T15:24:31.73-0500 [App/0]      OUT debug: websocket writing 2::
2015-07-03T15:24:31.73-0500 [App/0]      OUT debug: set heartbeat timeout for client qU0jS5jtdBotAxspfRDb
2015-07-03T15:24:31.82-0500 [App/0]      OUT debug: got heartbeat packet
2015-07-03T15:24:31.82-0500 [App/0]      OUT debug: cleared heartbeat timeout for client qU0jS5jtdBotAxspfRDb
2015-07-03T15:24:31.82-0500 [App/0]      OUT debug: set heartbeat interval for client qU0jS5jtdBotAxspfRDb
2015-07-03T15:24:35.65-0500 [App/0]      OUT debug: emitting heartbeat for client HrCY4a8SfSD9DJOIfRDe
2015-07-03T15:24:35.65-0500 [App/0]      OUT debug: websocket writing 2::
2015-07-03T15:24:35.65-0500 [App/0]      OUT debug: set heartbeat timeout for client HrCY4a8SfSD9DJOIfRDe
2015-07-03T15:24:35.73-0500 [App/0]      OUT debug: got heartbeat packet
2015-07-03T15:24:35.73-0500 [App/0]      OUT debug: cleared heartbeat timeout for client HrCY4a8SfSD9DJOIfRDe
2015-07-03T15:24:35.73-0500 [App/0]      OUT debug: set heartbeat interval for client HrCY4a8SfSD9DJOIfRDe

This looks like connection is tried but not succesfully established. I am thinking that because a comparisson with the logs produced by the node server used with my personal environment are quite different:
2015-07-03T15:27:59.53-0500 [App/0]      OUT registering user: 427A3629DE7B6323062778C44B8C1250
2015-07-03T15:27:59.54-0500 [RTR/2]      OUT chatserver.mybluemix.net - [03/07/2015:20:27:59 +0000] "GET /?method=sessio
27A3629DE7B6323062778C44B8C1250&sessionKey=d37cd55a-4865-4a31-e3c7-f342fce93f39 HTTP/1.1" 200 0 6 "-" "-" 75.126.70.42:6
:"-" vcap_request_id:cf288366-60d9-41c1-591e-bdf457717ba7 response_time:0.004109526 app_id:d675ac52-0d63-42a0-9ed3-5bc0c
2015-07-03T15:27:59.57-0500 [App/0]      OUT registering user: ef3172a5-9312-c1c5-360d-f137dadb98c9
2015-07-03T15:27:59.59-0500 [RTR/1]      OUT chatserver.mybluemix.net - [03/07/2015:20:27:59 +0000] "GET /?method=sessio
f3172a5-9312-c1c5-360d-f137dadb98c9&sessionKey=d37cd55a-4865-4a31-e3c7-f342fce93f39 HTTP/1.1" 200 0 6 "-" "-" 75.126.70.
_for:"-" vcap_request_id:6577b8ba-67ff-446d-601c-5969b7eaca97 response_time:0.004536071 app_id:d675ac52-0d63-42a0-9ed3-5
2015-07-03T15:27:59.90-0500 [App/0]      OUT debug: client authorized
2015-07-03T15:27:59.90-0500 [App/0]      OUT info: handshake authorized zmMlPf3P-sa5S9RrmZPP
2015-07-03T15:27:59.91-0500 [RTR/2]      OUT chatserver.mybluemix.net - [03/07/2015:20:27:59 +0000] "GET /socket.io/1/?t
1.1" 200 0 71 "http://johannescorrea.outsystemscloud.com/Social/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.3
) Chrome/43.0.2357.130 Safari/537.36" 75.126.70.43:40843 x_forwarded_for:"-" vcap_request_id:dc129cfd-ef0e-4c34-628d-003
ime:0.004702498 app_id:d675ac52-0d63-42a0-9ed3-5bc0cc41e537
2015-07-03T15:28:00.10-0500 [App/0]      OUT debug: setting request GET /socket.io/1/websocket/zmMlPf3P-sa5S9RrmZPP
2015-07-03T15:28:00.10-0500 [App/0]      OUT debug: set heartbeat interval for client zmMlPf3P-sa5S9RrmZPP
2015-07-03T15:28:00.10-0500 [App/0]      OUT debug: client authorized for
2015-07-03T15:28:00.11-0500 [App/0]      OUT debug: websocket writing 1::
2015-07-03T15:28:00.24-0500 [App/0]      OUT ef3172a5-9312-c1c5-360d-f137dadb98c9 is logged in!
2015-07-03T15:28:00.36-0500 [App/0]      OUT jsonresponse:  {"API_Contacts":[{"UserId":"A038314B5D26EE6B0B405520C2498201
orrea","PictureHash":"1AF14A6731B888B878F937C5578E9AA9","Disabled":false,"Blocked":[]}],"My_Info":{"UserId":"427A3629DE7
0","Name":"Mauricio Ferrer","PictureHash":"1AF14A6731B888B878F937C5578E9AA9","Disabled":false,"Blocked":[]}}
2015-07-03T15:28:00.36-0500 [App/0]      OUT debug: websocket writing 5:::{"name":"NewStatus","args":[{"userKey":"427A36
8C1250","statusId":0}]}
2015-07-03T15:28:00.36-0500 [App/0]      OUT debug: websocket writing 5:::{"name":"ContactsInfo","args":[{"MyInfo":{"nam
,"id":"427A3629DE7B6323062778C44B8C1250","picHash":"1AF14A6731B888B878F937C5578E9AA9","status":0,"disabled":false,"block
6EE6B0B405520C2498201":{"name":"Johannes Correa","status":3,"picHash":"1AF14A6731B888B878F937C5578E9AA9"}}]}
2015-07-03T15:28:00.46-0500 [App/0]      OUT jsonresponse:  []
2015-07-03T15:28:00.47-0500 [App/0]      OUT jsonresponse:  []
2015-07-03T15:28:00.47-0500 [App/0]      OUT debug: websocket writing 5:::{"name":"PreviewInfo","args":[[]]}

 If i configure Chat to connect to HTTP, I have an error on Browser because connections from a secure page to an unsecure one are not allowed. Would you suggest that I should enable HTTP in my server as the only solution? 

Thanks a lot for your help and your patience.
Hi again,

Your node.js server seems running fine under https.
To make it work under HTTPS:

var myserver = new Chat.ChatServer(port, TRUE, "myserver.com", host, TRUE, "mykey*", "aspx");

and then (on backoffice):



Let me know if this configuration works.

Have a nice weekend!

HD

Hi Helio. Last update with this issue. Everything was working fine. Looks like i am having some issue when working inside my workplace network and contact list and chat are not working. When connecting from outside it works perfectly fine. Thanks a lot for your help.
Hi Johannes, 

Thanks for the feedback!

regards,
Hélio