Rocket.Chat.Android icon indicating copy to clipboard operation
Rocket.Chat.Android copied to clipboard

Channels don't show up after login

Open henryfok opened this issue 7 years ago • 11 comments

Describe the bug

After logging in, none of the channels show up. Tapping the search icon and going into the directory, the general channel appears in the list, but when you go into the channel, the messages don't show up and you can't send anything. However, using Rocket.Chat on the Chrome browser on the same device has no issues.

To Reproduce

The Rocket.Chat server is reversed proxied by Apache. I followed the instruction here

  1. Login to RocketChat server on the Android app
  2. Notice that none of the channels appear
  3. Click on the search icon in the top right, tap on "Directory"
  4. Select the general channel
  5. None of the messages appear and can't send messages

Expected behavior

Expected to have the same behavior as using RocketChat in the web browser. (Able to see all joined channels, receive/send messages, etc)

Logs

In /var/log/httpd/ssl_access_log, I noticed that websocket is running in http 400 errors [16/Jul/2019:15:14:21 -0700] "GET /websocket HTTP/1.1" 400 29

Screenshots

Devices and Versions

Your Rocket.Chat.Android version: 3.4.2 (2070) Your Rocket.Chat Server version: 1.2.1

Additional context

Apache ssl.conf file

Listen 443 https

SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog

SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout  300

SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
#SSLRandomSeed startup file:/dev/random  512
#SSLRandomSeed connect file:/dev/random  512
#SSLRandomSeed connect file:/dev/urandom 512

SSLCryptoDevice builtin
#SSLCryptoDevice ubsec

<VirtualHost *:80>
  #ServerName is in the format of rocketchat.domain.ca
  ServerName <ServerName>
  ServerAlias www.<ServerName>
  Redirect / https://<ServerName>
</VirtualHost>

<VirtualHost *:443>
  ServerName <ServerName>
  ServerAlias www.<ServerName>
  ServerAdmin <our email>

  ErrorLog logs/ssl_error_log
  TransferLog logs/ssl_access_log
  LogLevel warn

  SSLEngine on

  SSLProtocol ALL -SSLv2 -SSLv3
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

  SSLCertificateFile <.cer filepath>
  SSLCertificateKeyFile <.key.u filepath>
  SSLCACertificateFile <.cert filepath>

  <Location />
    Order allow,deny
    Allow from all
  </Location>

  RewriteEngine On
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /(.*)           ws://<ServerName>:8080/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule /(.*)           http://<ServerName>:8080/$1 [P,L]

  ProxyRequests Off
  ProxyPreserveHost On
  
  ProxyPass / http://<ServerName>:8080/
  ProxyPassReverse / http://<ServerName>:8080/
  
  RewriteRule ^/ - [l,pt]
</VirtualHost>

henryfok avatar Jul 16 '19 22:07 henryfok

I have this same issue.

Rocket.Chat.Android version: 3.4.2

sgostelow avatar Jul 23 '19 12:07 sgostelow

Looking at the growing list of bad reviews on Google Play store it seems this is quite widespread.

sgostelow avatar Jul 23 '19 12:07 sgostelow

I had the same problem, but with a nginx reverse proxy. I found a solution here: https://github.com/RocketChat/Rocket.Chat/issues/12786#issuecomment-443485738

jakobbraun avatar Jul 29 '19 21:07 jakobbraun

But even so this seems to be a problem in the server configuration an appropriate message in the app would help to find the problem. For example "could not connect to websocket"

jakobbraun avatar Jul 30 '19 06:07 jakobbraun

@henryfok and @sgostelow Could you please let us know if it is happening on our latest app release 3.5.0 (2074)?

philipbrito avatar Jul 31 '19 16:07 philipbrito

Getting the same symptoms in the app (blank channel list). Looks like the update added a status message which says "Connecting" indefinitely. Apache logs also report HTTP 400 for https:///websocket

However, the issue might be due to my Squid web caching server as it seems to not support WebSocket connections. I guess the mobile app doesn't have a fail over for when WebSockets aren't avaliable? Accessing the web version on mobile Chrome seems fine. I've started testing with Apache Traffic Server and the results look promising.

henryfok avatar Jul 31 '19 20:07 henryfok

Getting the same symptoms in the app (blank channel list). Looks like the update added a status message which says "Connecting" indefinitely. Apache logs also report HTTP 400 for https:///websocket

However, the issue might be due to my Squid web caching server as it seems to not support WebSocket connections. I guess the mobile app doesn't have a fail over for when WebSockets aren't avaliable? Accessing the web version on mobile Chrome seems fine. I've started testing with Apache Traffic Server and the results look promising.

No websocket and a browser will usually fall back to XHR. Android apps will fallback too. But it will be painfully slow on both, and may not even load the channel list. iOS will not connect at all.

Squid will likely play havoc so try disabling it to test.

Chrome/ium Right click, Inspect, Network, F5 to refresh, Look for XHR and WS. Should see a websocket under WS. Click 'websocket' and on the right you can see how it was negotiated.

Test on open.rocket.chat then your own to compare.

reetp avatar Aug 01 '19 14:08 reetp

Yeah, when I use Apache Traffic Server instead of Squid, WebSocket connections are getting upgraded properly (HTTP 101). I can see WebSocket messages sent in the Chrome network tab.

henryfok avatar Aug 02 '19 00:08 henryfok

@henryfok and @sgostelow Could you please let us know if it is happening on our latest app release 3.5.0 (2074)?

I've upgraded to 3.5.0 (2074) by accepting beta versions on Google Play and all is now working fine. Thank you!

sgostelow avatar Aug 02 '19 08:08 sgostelow

@sgostelow Thanks for enrolling in the beta channel! The 3.5.0 (2074) was released to production channel (last week to be more precise) as well.

philipbrito avatar Aug 02 '19 13:08 philipbrito

I am going to close this issue as it looks like the issue is resolved for @sgostelow and I have found a solution. Let me know if you want any further information.

henryfok avatar Aug 02 '19 17:08 henryfok