Error in Push Notifications | Cloud Registration Error

Description

After updating RC and MongoDB, I’m getting the following errors. RC is working, but notifications (both in the browser and app) just don’t work anymore.

{“level”:40,“time”:“2022-09-15T11:54:21.307Z”,“pid”:1,“hostname”:“39f56867de46”,“name”:“Push”,“msg”:“Error sending push to gateway (not authorized) {"statusCode":401,"content":"{\"code\":121,\"error\":\"rocket.chat cloud registration required\",\"requestId\":\"0bc27b0d-1e88-4859-b3a4-4a8d3eb88698\",\"status\":401}","headers":{"access-control-allow-headers":"Content-Type, Authorization, Content-Length, X-Requested-With","access-control-allow-methods":"GET, PUT, POST, DELETE, OPTIONS","access-control-allow-origin":"*","access-control-expose-headers":"Content-Type, Authorization, Cache-Control, Expires, Pragma, X-powered-by","cache-control":"private, no-cache, no-store, must-revalidate","connection":"close","content-length":"126","content-type":"application/json; charset=utf-8","date":"Thu, 15 Sep 2022 11:54:21 GMT","expires":"-1","pragma":"no-cache","vary":"Accept-Encoding","x-powered-by":"Rocket Fuel and Rocketeers"},"ok":false,"data":{"code":121,"error":"rocket.chat cloud registration required","requestId":"0bc27b0d-1e88-4859-b3a4-4a8d3eb88698","status":401}}”}

I’ve tried re-registering RC on the cloud and currently it shows the instance is connected. I’m also able to sync it, at least that’s the notification that I get.


02

but I cannot Login to Rocket.Chat Cloud when I click the Login to Rocket.Chat Cloud button. This is the error message that I get:

{“level”:50,“time”:“2022-09-15T12:01:09.946Z”,“pid”:1,“hostname”:“39f56867de46”,“name”:“System”,“err”:{“type”:“Error”,“message”:“failed [401]{"status":401}”,“stack”:“Error: failed [401]{"status":401}\n at makeErrorByStatus (server/lib/http/call.ts:59:9)\n at server/lib/http/call.ts:168:19\n at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40”,“response”:{“statusCode”:401,“content”:“{"status":401}”,“headers”:{“access-control-allow-headers”:“Content-Type, Authorization, Content-Length, Last-Event-ID, X-Requested-With”,“access-control-allow-methods”:“GET, PUT, POST, DELETE, OPTIONS”,“access-control-allow-origin”:“*”,“access-control-expose-headers”:“Content-Type, Authorization, Cache-Control, Expires, Pragma, X-powered-by”,“cache-control”:“private, no-cache, no-store, must-revalidate”,“connection”:“close”,“content-length”:“14”,“content-type”:“application/json; charset=utf-8”,“date”:“Thu, 15 Sep 2022 12:01:09 GMT”,“expires”:“-1”,“pragma”:“no-cache”,“vary”:“Accept-Encoding”,“x-fleet-version”:“-77b34ba”,“x-powered-by”:“Rocket Fuel and Rocketeers”},“ok”:false,“data”:{“status”:401}}},“msg”:“failed [401]{"status":401}”}
{“level”:50,“time”:“2022-09-15T12:03:45.303Z”,“pid”:1,“hostname”:“39f56867de46”,“name”:“System”,“msg”:“Exception while invoking method cloud:finishOAuthAuthorization ‘Invalid state provided [error-invalid-state]’”}

Server Setup Information

  • Version of Rocket.Chat Server: 5.0.3
  • Operating System: Unraid
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.19.3 - x64
  • MongoDB Version: 6.0.1
  • Proxy: swag
  • Firewalls involved:
    ±-------------------------------------------------+
    | SERVER RUNNING |
    ±-------------------------------------------------+
    | |
    | Rocket.Chat Version: 5.0.3 |
    | NodeJS Version: 14.19.3 - x64 |
    | MongoDB Version: 6.0.1 |
    | MongoDB Engine: wiredTiger |
    | Platform: linux |
    | Process Port: 3000 |
    | Site URL: https://my.server.com |
    | ReplicaSet OpLog: Enabled |
    | Commit Hash: |
    | Commit Branch: HEAD |
    | |
    ±-------------------------------------------------+

Any additional Information

Is there any way to resolve this? Any help will be highly appreciated. Thanks in advance!

I’m having this exact same issue on Unraid with the exact same setup and docker versions

Sync says it’s working, which may be true, but when I click the Login to Rocket.Chat Cloud button, it takes me to the Authorization screen, where I receive the “error-invalid-state” error when I press the Authorize button

Following, I have similar issue.
Edit: After going back and forth now I have exactly the same issue!

Funnily enough I received a push notification this morning from the update thread, however I can’t install apps as it requires logging in.

Updated to 5.1.3 and still have the same issue.
Also, messages are sent out but are still grey and not marked as sent out.
The other side sometimes receives a notification that they have received it, but don’t get anything until they refresh.

Here’s the server log entry upon error:

{“level”:50,“time”:“2022-09-26T06:17:22.311Z”,“pid”:1,“hostname”:“0b8fd1acb48a”,“name”:“System”,“msg”:“Exception while invoking method cloud:finishOAuthAuthorization ‘Invalid state provided [error-invalid-state]’”}

Here’s a link to the github bug:

Here’s a link to the unRAID support thread. Looks like it’s not just an unraid issue though as Vaxter is on a different platform

https://forums.unraid.net/topic/61337-support-rocketchat/page/6/

Hi!

Can you ping me at Rocket.Chat so I can take a closer look on it together with you?

The registration is usually an easy step, but a lot can go wrong from both sides, and sometimes is hard to tackle the issue only from logs.

Thanks!

1 Like

{“level”:50,“time”:“2022-09-28T20:51:46.063Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“System”,“msg”:“Exception while invoking method autoTranslate.getSupportedLanguages ‘Auto-Translate is disabled [error-autotranslate-disabled]’”}
Exception while invoking method autoTranslate.getSupportedLanguages errorClass [Error]: Auto-Translate is disabled [error-autotranslate-disabled]
at MethodInvocation.autoTranslate.getSupportedLanguages (app/autotranslate/server/methods/getSupportedLanguages.ts:11:10)
at MethodInvocation.methodsMap. (app/lib/server/lib/debug.js:74:34)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1885:12)
at packages/ddp-server/livedata_server.js:1803:15
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at packages/ddp-server/livedata_server.js:1801:36
at new Promise ()
at Server.applyAsync (packages/ddp-server/livedata_server.js:1800:12)
at Server.apply (packages/ddp-server/livedata_server.js:1739:26)
at Server.call (packages/ddp-server/livedata_server.js:1721:17)
at Object.post (app/api/server/v1/misc.ts:554:27)
at app/api/server/api.js:463:96
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:463:39)
at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32)
at packages/rocketchat_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:100:9
=> awaited here:
at Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)
at Server.apply (packages/ddp-server/livedata_server.js:1752:22)
at Server.call (packages/ddp-server/livedata_server.js:1721:17)
at Object.post (app/api/server/v1/misc.ts:554:27)
at app/api/server/api.js:463:96
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:463:39)
at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32)
at packages/rocketchat_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:100:9 {
isClientSafe: true,
error: ‘error-autotranslate-disabled’,
reason: ‘Auto-Translate is disabled’,
details: undefined,
errorType: ‘Meteor.Error’
}
{“level”:35,“time”:“2022-09-28T20:51:46.063Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/autoTranslate.getSupportedLanguages”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“119”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:7}
{“level”:35,“time”:“2022-09-28T20:51:46.065Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“Meteor”,“method”:“autoTranslate.getProviderUiMetadata”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“instanceId”:"dHfK9f7YuSr9Qr7Xk”}
{“level”:35,“time”:“2022-09-28T20:51:46.065Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/autoTranslate.getProviderUiMetadata”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“113”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:0}
{“level”:35,“time”:“2022-09-28T20:51:46.073Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:checkRegisterStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“103”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:7}
{“level”:35,“time”:“2022-09-28T20:51:46.371Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/cloud.registrationStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:4}
{“level”:35,“time”:“2022-09-28T20:51:46.413Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.isEnterprise”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:3}
{“level”:35,“time”:“2022-09-28T20:51:46.568Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:checkRegisterStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“103”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:1}
{“level”:50,“time”:“2022-09-28T20:51:46.571Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“System”,“msg”:“Exception while invoking method cloud:finishOAuthAuthorization ‘Invalid state provided [error-invalid-state]’”}
Exception while invoking method cloud:finishOAuthAuthorization errorClass [Error]: Invalid state provided [error-invalid-state]
at finishOAuthAuthorization (app/cloud/server/functions/finishOAuthAuthorization.js:12:9)
at MethodInvocation.cloud:finishOAuthAuthorization (app/cloud/server/methods.js:147:10)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1885:12)
at packages/ddp-server/livedata_server.js:1803:15
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at packages/ddp-server/livedata_server.js:1801:36
at new Promise ()
at Server.applyAsync (packages/ddp-server/livedata_server.js:1800:12)
at Server.apply (packages/ddp-server/livedata_server.js:1739:26)
at Server.call (packages/ddp-server/livedata_server.js:1721:17)
at Object.post (app/api/server/v1/misc.ts:554:27)
at app/api/server/api.js:463:96
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:463:39)
at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32)
at packages/rocketchat_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:100:9
=> awaited here:
at Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)
at Server.apply (packages/ddp-server/livedata_server.js:1752:22)
at Server.call (packages/ddp-server/livedata_server.js:1721:17)
at Object.post (app/api/server/v1/misc.ts:554:27)
at app/api/server/api.js:463:96
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:463:39)
at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32)
at packages/rocketchat_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:100:9 {
isClientSafe: true,
error: ‘error-invalid-state’,
reason: ‘Invalid state provided’,
details: { method: ‘cloud:finishOAuthAuthorization’ },
errorType: ‘Meteor.Error’
}
{“level”:35,“time”:“2022-09-28T20:51:46.571Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:finishOAuthAuthorization”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“154”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:2}
{“level”:35,“time”:“2022-09-28T20:51:46.635Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.get”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:1}
{“level”:35,“time”:“2022-09-28T20:51:46.689Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“Meteor”,“publication”:“stream-notify-logged”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“remoteIP”:null,“instanceId”:“dHfK9f7YuSr9Qr7Xk”}
{“level”:35,“time”:“2022-09-28T20:51:46.798Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.isEnterprise”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:4}
{“level”:35,“time”:“2022-09-28T20:51:46.812Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/cloud.registrationStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:4}
{“level”:35,“time”:“2022-09-28T20:51:46.830Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:checkUserLoggedIn”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“101”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud/oauth-callback?code=izuXm_K4p11F1uiUCaDO&state=P7EEWmmq3BktbcaZd",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:3}
{“level”:35,“time”:“2022-09-28T20:51:46.904Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“Meteor”,“method”:“private-settings/get”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“instanceId”:"dHfK9f7YuSr9Qr7Xk”}
{“level”:35,“time”:“2022-09-28T20:51:46.912Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/private-settings:get”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“123”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:10}
{“level”:35,“time”:“2022-09-28T20:51:47.161Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“Meteor”,“publication”:“stream-user-presence”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“remoteIP”:null,“instanceId”:“dHfK9f7YuSr9Qr7Xk”}
{“level”:35,“time”:“2022-09-28T20:51:47.185Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/users.presence?ids=JjaxwzuKpzcwYrao8&ids=rocket.cat&ids=i2GspYKtRC8FXFHKf”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:9}
{“level”:30,“time”:“2022-09-28T20:52:00.328Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“SyncedCron”,“msg”:“Starting "Generate download files for user data".”}
{“level”:30,“time”:“2022-09-28T20:52:00.329Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“SyncedCron”,“msg”:“Finished "Generate download files for user data".”}
{“level”:35,“time”:“2022-09-28T20:52:01.672Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/cloud.registrationStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:29}
{“level”:35,“time”:“2022-09-28T20:52:01.687Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:checkRegisterStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“length”:“103”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:3}
{“level”:35,“time”:“2022-09-28T20:52:01.693Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.isEnterprise”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:16}
{“level”:35,“time”:“2022-09-28T20:52:01.700Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.get”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:3}
{“level”:35,“time”:“2022-09-28T20:52:05.685Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.call/cloud:checkRegisterStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15”,“length”:“103”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:7}
{“level”:35,“time”:“2022-09-28T20:52:05.722Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.isEnterprise”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:8}
{“level”:35,“time”:“2022-09-28T20:52:05.725Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/cloud.registrationStatus”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:28}
{“level”:35,“time”:“2022-09-28T20:52:05.736Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“API”,“method”:“GET”,“url”:“/api/v1/licenses.get”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15”,“host”:“rocket.some.domain”,“referer”:“https://rocket.some.domain/admin/cloud",“remoteIP”:“178.222.13.32”,“status”:200,"responseTime”:3}
{“level”:35,“time”:“2022-09-28T20:52:06.880Z”,“pid”:1,“hostname”:“5e5ffe195f41”,“name”:“Meteor”,“method”:“UserPresence:online”,“userId”:“7mkwppfnTDRJsQjEF”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15”,“remoteIP”:null,“instanceId”:“dHfK9f7YuSr9Qr7Xk”}

Additional info, if it helps.
I have tried completely removing cloud setting and my instance from workspace and registering again.
When I paste the token I het an error and nothing happens, but once I restart the instance I can see Login to Cloud button, Sync etc, and my instance registered in workspace.
After I click on Login to Cloud the error above appears.

1 Like

Ok, I have managed to fix it on my side, after a while…
The issue was in oplog connectivity, but Rocket logs and info were falsely showing that everything is ok.
My issue was that my MongoDB server was in standalone mode, and oplog events are not thrown in MongoDB standalone mode, only in replica sets.
I have just converted my mongo into a replica set and everything works now.
After this started working Rocket.Chat was able to finish the cloud registration properly.

1 Like

Glad to hear that, @vaxter!

And thanks for sharing!

Hmm. Seems like you had a different issue. My mongodb is already a replica set :frowning:

Edit:

This has given me an idea. I was adding the directConnection=true variable to MONGO_URL and MONGO_OPLOG_URL but I think I might be doing it wrong. First of all, I didn’t have the replicaSet=rs prefix, where my replica set is rs01. Can someone confirm if this is correct?

MONGO_URL=mongodb://rocketchat:password@localhost:27017/rocketchat?replicaSet=rs01&directConnection=true

MONGO_OPLOG_URL=mongodb://rocketchat:password@localhost:27017/local?authSource=admin?replicaSet=rs01&directConnection=true

I’m not familiar with the syntax and I think the “?” or “&” somewhere might be wrong. I’ve seen the first sections of each line written differently, but this is how it’s always been written for unRAID as shown here:

https://forums.unraid.net/topic/61337-support-rocketchat/?do=findComment&comment=1156956

Hey all. Sorry I’ve been busy but I did end up having that chat with @dudanogueira from Rocket.Chat. Great guy btw!

The solution was to use the docker compose stack that installs rocket.chat and mongodb together. If you’re on unRAID like me, you’ll need to look at getting Docker Compose enabled first, yes it’s a thing and it works great.

Here is the compose file:

volumes:
  mongodb_data: { driver: local }
networks:
  default:
    external: false
  YOUR-CUSTOM-DOCKER-NETWORK:
    external: true

services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest}
    restart: on-failure
    labels:
      traefik.enable: "true"
      traefik.http.routers.rocketchat.rule: Host(`${DOMAIN}`)
      traefik.http.routers.rocketchat.tls: "true"
      traefik.http.routers.rocketchat.entrypoints: https
      traefik.http.routers.rocketchat.tls.certresolver: le
    environment:
      MONGO_URL: "${MONGO_URL:-\
        mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        ${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\
        -mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
        local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
      ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3001}}
      PORT: ${PORT:-3001}
      DEPLOY_METHOD: docker
      DEPLOY_PLATFORM: ${DEPLOY_PLATFORM}
    depends_on:
      - mongodb
    expose:
      - ${PORT:-3001}
    networks:
      - default
      - YOUR-CUSTOM-DOCKER-NETWORK
    ports:
      - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3001}:${PORT:-3001}"

  mongodb:
    image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-4.4}
    restart: on-failure
    volumes:
      - mongodb_data:/bitnami/mongodb
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0}
      MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017}
      MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb}
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}
      MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb}
      MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true}
      ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes}

Please note thee sections that read “YOUR-CUSTOM-DOCKER-NETWORK”, this is where you would enter the name of your custom docker network if you use one, there are two sections, one near the top and one under the “networks” parameter after the port is specified further below.

This was one and done, all working. That easily! I was able to register the server and log in to Rocket.Chat cloud from the settings menu with everything working perfectly. Good luck!

1 Like

I’ve finally managed to get RC docker working on mongo:5 with all my previous data restored successfully :).

Notifications are working now and I can connect to the Rocket.Chat cloud.

+--------------------------------------------------+
|                  SERVER RUNNING                  |
+--------------------------------------------------+
|                                                  |
|  Rocket.Chat Version: 5.2.0                      |
|       NodeJS Version: 14.19.3 - x64              |
|      MongoDB Version: 5.0.13                     |
|       MongoDB Engine: wiredTiger                 |
|             Platform: linux                      |
|         Process Port: 3000                       |
|             Site URL: https://my.domain.com      |
|     ReplicaSet OpLog: Enabled                    |
|          Commit Hash: 08f03cc9d8                 |
|        Commit Branch: HEAD                       |
|                                                  |
+--------------------------------------------------+

Posting the steps I followed for anyone who might be facing a similar issue.

#1 Stop RC and backup existing data from your current mongodb docker console

mongodump --archive --gzip > 2022.10.15_rocketchat_mongo_server.dump.archive.gzip

#2 Remove the existing mongodb docker

  • stop the mongodb docker
  • rename the /mnt/appdata/mongodb folder to mongodb-backup
  • remove the mongodb docker.

#3 Install mongodb docker (default) with the following changes

Repository:

mongo:5

(Advanced View)

Extra Parameters:

--hostname mongodatabase

Post Arguments:

--bind_ip_all --replSet "rs0"

#4 Initialise ReplicaSet in mongodb

  • open the console and type

mongosh

then on the prompt

test >

type

rs.initiate( { _id : "rs0", members: [ { _id: 0, host: "<YOUR-SERVER-IP>:27017" }, ] })

  • you should see the result as below

test> rs.initiate( {
… _id : “rs0”,
… members: [
… { _id: 0, host: “:27017” },
… ]
… })
{ ok: 1 }

rs0 [direct: other] test>

rs0 [direct: primary] test>

#5 Restore the backup data to the new mongodb instance

  • copy the backup file from step #1 into the new mongodb appdata folder
  • open the mongodb console and move into the /data/db dir
  • then type

mongorestore --archive --gzip < 2022.10.15_rocketchat_mongo_server.dump.archive.gzip

You should see something similar to this on a successful restore (this may take a while depending on your backup file size):

2022-10-15T14:54:16.776+0400 159574 document(s) restored successfully. 0 document(s) failed to restore.

#6 Edit your RC docker settings as below

MONGO_URL

mongodb://rocketchat:<Password>@<YOUR-SERVER-IP>:27017/rocketchat?replicaSet=rs0

MONGO_OPLOG_URL

mongodb://rocketchat:<Password>@<YOUR-SERVER-IP>:27017/local?replicaSet=rs0

That’s it.

Start the docker and it should work! Enjoy ! :slight_smile:

1 Like

Thanks for sharing!!!

I do have the same problem, I am unable to register my server to rocketchat, but I am not able to follow these steps.

When I try to Backup my existing Data with monogdump… from your #1 step, I do always get this error

2022-11-01T22:00:01.806+0100    Failed: error creating intents to dump: error getting database names: (Unauthorized) command listDatabases requires authentication

I am using Rocketchat Version 5.2.0 and MongoDB Version 6.0.2

Thanks for your help

Hi! How have you deployed it?

Seems that you have some user/password and because of that it’s not authorizing connections.