RocketChat / RocketChat/Rocket.Chat

Federation test runs ok but invite users fails

Open
#17,314 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

I am testing federation in a lab.
I have two rocket servers running rocket 3.1.1
I've added the two records for each domain (SRV and TXT).
Federation test works but when I invite a users from the federated domain It fails.

Steps to reproduce:
  1. Install Centos 7 and rocket using manual installation.
  2. Create two zones domain1.com and domain2.com internal for test purposes.
  3. Federate both servers.
Expected behavior:

When I invite a user from the federated domain It should work but fails.

Actual behavior:

Test working:
Screenshot from 2020-04-15 16-59-51
Adding federated user:
Screenshot from 2020-04-15 17-00-39
Doing double clic on the federated user:
Screenshot from 2020-04-15 17-00-47

Server Setup Information:

Both rocket chat servers are in the same network, using the same dns
rocket1 -> 192.168.122.110
rocket2 -> 192.168.122.120
dns -> 192.168.122.1

Record examples using bind9:
Domain1:

rocket1.domain1.com.	IN	A	192.168.122.110
_rocketchat._http.domain1.com. 3600 IN SRV 1 1 3000 rocket1.domain1.com.
rocketchat-public-key.domain1.com. IN TXT '-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1S597MBanxGChpFGBGlb3MVOxRhObtMdVWocJWlnstkkFVRuPtEKIEu1Y5TV6+HKgL8hAOH8g46St4+Lbi0KGlNTVMdT4clbFyQos+BWgVpyS/aEy6cpQv5LuH1+WBBk3tpm6rNXUYaa9PiU/7MkskFwZw+a/1Ua'
rocketchat-public-key.domain1.com. IN TXT 'HYKFaZ87terVCQhydFbBPOvL8wDUAc0c5ZzjFrH9wntbr+zp+Kpq63/jawJk8pWy2xPWCC61eFpRBaRXch6M89xW2AilyZ4gjtNw/D4YNOciMffS9WlNIE64+DsHwV/9dJel8rTgKVzHovJvMs64FgZu5lM1OmK6HnuTGrF0GMzhSZPA9rdU/wIDAQAB-----END PUBLIC KEY-----'

Domain2:

rocket2.domain2.com.	IN	A	192.168.122.120
_rocketchat._http.domain2.com. 3600 IN SRV 1 1 3000 rocket2.domain2.com.
rocketchat-public-key.domain2.com. IN TXT '-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiUiEAj/Up8LG9cFWk8qXz+bQFtW+B9Eb4Mp3OSe40bwz1X8wSvXOab5xgH9RtAdGIjtifi63VD4MsiNUTBrCA6XvGwl9c1vWhJFudRLhMmYBJK4WXMzhYl+/F3c3my9bHfzbtWykDXUe6JGJZJ9RSsGdhoxAdTu/h'
rocketchat-public-key.domain2.com. IN TXT '8nFQRqwk8bglDrL5msxyR5LqCOztRt/ewA2kOoLLCI8At6hTQ6OuMfUcQOdb/hlM6EajWN8gRR7y3Y/aF4CC+sDPnMN5CtrqWq8ZFvtDSTZ6xWOI5+NMaEGhcPfo1sBKMjliic1TWAdEx1rPemS54niS/Vps9xj5XjySl8nDEYROj0HsP2UNwIDAQAB-----END PUBLIC KEY-----'
Client Setup Information
  • Browser Chrome: 80.0.3987.163
  • Operating System: Centos 8.1
Relevant logs:

When the error happens server side:

Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: server.js:204 Federation ➔ http.error Error Error: failed [400] {"success":false,"error":"Cannot read property '0' of undefined"}
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: Exception while invoking method 'createDirectMessage' Error: failed [400] {"success":false,"error":"Cannot read property '0' of undefined"}
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Object.exports.makeErrorByStatus (packages/http.js:176:10)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request._callback (packages/http.js:140:24)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.self.callback (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:185:22)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.emit (events.js:210:5)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.EventEmitter.emit (domain.js:475:20)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:1161:10)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.emit (events.js:210:5)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Request.EventEmitter.emit (domain.js:475:20)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at IncomingMessage.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:1083:12)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at Object.onceWrapper (events.js:299:28)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at IncomingMessage.emit (events.js:215:7)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at IncomingMessage.EventEmitter.emit (domain.js:475:20)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at endReadableNT (_stream_readable.js:1184:12)
Apr 15 17:37:35 rocket2.domain2.com rocketchat[3833]: at processTicksAndRejections (internal/process/task_queues.js:80:21)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report identifies server.js, packages/http.js, and the createDirectMessage method in the server log; start by tracing that federation request and reproduce it with the two-server setup described. Done means inviting a user from the federated domain completes without the reported 400 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, nodejs, typescript
Domain
backend, distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.