Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web access connection problems since upgrade 4.6.3 -> 4.7.0 #25460

Closed
Sh0uld opened this issue May 10, 2022 · 5 comments
Closed

Web access connection problems since upgrade 4.6.3 -> 4.7.0 #25460

Sh0uld opened this issue May 10, 2022 · 5 comments

Comments

@Sh0uld
Copy link
Contributor

Sh0uld commented May 10, 2022

Description:

Web access is not available due to connection problems, but the Rocket.Chat App launches and is usable through Android apps (cannot test it with iOS). The web parts of the android apps (e.g. Admin Panel) doesn't load either.
The error occurred after the upgrade from 4.6.3 to 4.7.0 with the docker image.

Steps to reproduce:

  1. Have a running docker instance with Rocket.Chat version 4.6.3
  2. Upgrade to Rocket.Chat version 4.7.0
  3. Admire the connection/loading errors in a browser ;-)

Expected behavior:

Rocket.Chat should greet me with a functional login screen.

Actual behavior:

The login screen doesn't load completely, and a connection banner on the top of screen appears (see screenshot). This behavior occurs in Edge, Chrome and Firefox (no other browsers tested).

Screenshot login screen

Server Setup Information:

  • Version of Rocket.Chat Server: 4.7.0
  • Operating System: Ubuntu 20.04 LTS
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.18.3 - x64
  • MongoDB Version: 5.0.8

Client Setup Information

  • Browser Version: Edge, Firefox and Chrome in current version.
  • Operating System: Ubuntu 22.04 / Windows 10

Additional context

I tried to roll back to Rocket.Chat version 4.6.3 (docker), but this version doesn't start anymore due to "migration 261 not found".

Relevant logs:

Rocket.Chat Startup-Log:

(node:1) UnhandledPromiseRejectionWarning: MongoError: An equivalent index already exists with the same name but different options. Requested index: { v: 2, key: { _updatedAt: 1 }, name: "_updatedAt_1", expireAfterSeconds: 2592000 }, existing index: { v: 2, key: { _updatedAt: 1 }, name: "_updatedAt_1", ns: "parties.rocketchat_integration_history" }
    at MessageStream.messageHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
    at MessageStream.emit (events.js:400:28)
    at MessageStream.emit (domain.js:475:12)
    at processIncomingData (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at MessageStream.Writable.write (internal/streams/writable.js:303:10)
    at Socket.ondata (internal/streams/readable.js:731:22)
    at Socket.emit (events.js:400:28)
    at Socket.emit (domain.js:475:12)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at Socket.Readable.push (internal/streams/readable.js:206:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
    at TCP.callbackTrampoline (internal/async_hooks.js:130:17)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1) UnhandledPromiseRejectionWarning: MongoError: Index build failed: 8dfa1844-33d9-4946-87b8-f873a74d32a2: Collection parties.rocketchat_read_receipts ( 0c8e6256-985c-4785-b21a-e7ab7bab6d83 ) :: caused by :: E11000 duplicate key error collection: parties.rocketchat_read_receipts index: roomId_1_userId_1_messageId_1 dup key: { roomId: "GENERAL", userId: "3yKRrgqufT4LELkpo", messageId: "TPMACsGpR6A9wZi7X" }
    at MessageStream.messageHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
    at MessageStream.emit (events.js:400:28)
    at MessageStream.emit (domain.js:475:12)
    at processIncomingData (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at MessageStream.Writable.write (internal/streams/writable.js:303:10)
    at Socket.ondata (internal/streams/readable.js:731:22)
    at Socket.emit (events.js:400:28)
    at Socket.emit (domain.js:475:12)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at Socket.Readable.push (internal/streams/readable.js:206:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
    at TCP.callbackTrampoline (internal/async_hooks.js:130:17)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
LocalStore: store created at 
LocalStore: store created at 
LocalStore: store created at 
MessageType.render is deprecated. Use MessageType.message instead. livechat_webrtc_video_call
{"level":40,"time":"2022-05-10T19:08:57.953Z","pid":1,"hostname":"285e65864a04","name":"VoIPService","msg":"Voip is not enabled. Cant start the service"}
{"level":51,"time":"2022-05-10T19:08:58.324Z","pid":1,"hostname":"285e65864a04","name":"Migrations","msg":"Not migrating, already at version 261"}
ufs: temp directory created at "/tmp/ufs"
Loaded the Apps Framework and loaded a total of 1 Apps!
+--------------------------------------------------+
|                  SERVER RUNNING                  |
+--------------------------------------------------+
|                                                  |
|  Rocket.Chat Version: 4.7.0                      |
|       NodeJS Version: 14.18.3 - x64              |
|      MongoDB Version: 5.0.8                      |
|       MongoDB Engine: wiredTiger                 |
|             Platform: linux                      |
|         Process Port: 3000                       |
|             Site URL: https://mydomain.com  |
|     ReplicaSet OpLog: Enabled                    |
|          Commit Hash: 9a59ff41e3                 |
|        Commit Branch: HEAD                       |
|                                                  |
+--------------------------------------------------+

docker --version

docker --version
Docker version 20.10.15, build fd82621

ldd --version

ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31

Firefox console messages (other browsers are similar):

fuselage: 0.31.11 28f042d48dc7212074cc2b3601f91762d103324d.js:5:585875
MessageType.render is deprecated. Use MessageType.message instead. livechat_webrtc_video_call 28f042d48dc7212074cc2b3601f91762d103324d.js:1512:192512
InstallTrigger is deprecated and will be removed in the future. 28f042d48dc7212074cc2b3601f91762d103324d.js:1512:784072
Content Security Policy: The page’s settings blocked the loading of a resource at data:application/octet-stream;base64,AGF… (“connect-src”). 28f042d48dc7212074cc2b3601f91762d103324d.js:1:447146
Uncaught (in promise) Error: Cannot find module 'stream'
    y https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/cipher-base/index.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/create-hash/browser.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/crypto-browserify/index.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/meteor-node-stubs/wrappers/crypto.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/sodium-plus/lib/polyfill.js:1
    module /node_modules/sodium-plus/lib/polyfill.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/sodium-plus/lib/backend/libsodium-wrappers.js:1
    module /node_modules/sodium-plus/lib/backend/libsodium-wrappers.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/sodium-plus/lib/sodiumplus.js:1
    module /node_modules/sodium-plus/lib/sodiumplus.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    t https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    module /node_modules/sodium-plus/index.js:1
    module /node_modules/sodium-plus/index.js:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    a https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:5
    module /ee/app/ecdh/Session.ts:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    a https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:5
    module /ee/app/ecdh/client/ClientSession.ts:1
    l https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    g https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    n https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:3
    a https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:5
    h https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    dynamicImport https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1253
    bindEnvironment https://mydomain.com/28f042d48dc7212074cc2b3601f91762d103324d.js?meteor_js_resource=true:1
28f042d48dc7212074cc2b3601f91762d103324d.js:3:638
@Sh0uld
Copy link
Contributor Author

Sh0uld commented May 17, 2022

I have been running some tests on my site again the last few days, but with no progress. For example, I manually disabled the Content Security Policy in MongoDB, but this only resulted in the disappearance of the corresponding console output - the main problem still persists.

I think that connection problem is caused by not finding the module "stream". Is there any way to check that the module is present in Docker? Is there perhaps a setting that bypasses the module? Or maybe it is possible to load the module manually?

@Sh0uld
Copy link
Contributor Author

Sh0uld commented May 23, 2022

New findings on my part:

The error is still existing in Rocket.Chat 4.7.1 and 4.7.2.

The error seems to lie within the mongo database. When I export the database and import it in a new docker enviroment, the error occurs. If I setup a new clean database with Rocket.Chat 4.6.3 (and do some test channels, messages), migrate to 4.7.0 or above, the error does not occur. I can provide the mongo database (~ 400 MB) via private message, if needed.

And last, but not least: There's a similar issue listed in meteor: meteor/meteor#11974, which is fixed in meteor-node-stubs package version 1.2.3. But I couldn't get my Docker environment to use the new version yet (it uses version 1.2.1).

@Sh0uld
Copy link
Contributor Author

Sh0uld commented May 25, 2022

New findings in my part 2:

The error is still existing in Rocket.Chat 4.8.0-rc.0.

Also, I tried to fix this bug myself by building Rocket.Chat with NodeJS 4.19.1/meteor 2.7.2/meteor-node-stubs 1.2.3 on Ubuntu 22.04 and imported my mongodb - the bug doesn't occur here anymore and the web access works fine again.

But now I'm stuck creating an pull request out of my findings.

YARN_CHECKSUM_BEHAVIOR=update meteor yarn dev

• Packages in scope: @rocket.chat/core-typings, @rocket.chat/eslint-config, @rocket.chat/livechat, @rocket.chat/meteor, @rocket.chat/rest-typings, @rocket.chat/ui-contexts
• Running dev in 6 packages
@rocket.chat/livechat:build: cache hit, replaying output af5b77ffb2b7ce98
@rocket.chat/livechat:build: Child
@rocket.chat/livechat:build:     
@rocket.chat/livechat:build:     WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
@rocket.chat/livechat:build:     This can impact web performance.
@rocket.chat/livechat:build:     Assets: 
@rocket.chat/livechat:build:       4.chunk.d6cf5.js (1.91 MiB)
@rocket.chat/livechat:build:       5.chunk.6037c.js (494 KiB)
@rocket.chat/core-typings:build: cache hit, replaying output 72c55e4b357f12fb
@rocket.chat/rest-typings:build: cache hit, replaying output 2a9e267b5b0c2fd3
@rocket.chat/ui-contexts:build: cache hit, replaying output 59eaeb10ebab5ccc
@rocket.chat/meteor:dev: cache miss, executing 9eebeddf2939ab19
@rocket.chat/meteor:dev: [[[[[ ~/Rocket.Chat/apps/meteor ]]]]]
@rocket.chat/meteor:dev: 
@rocket.chat/meteor:dev: => Started proxy.
@rocket.chat/meteor:dev: => Started MongoDB.
@rocket.chat/meteor:dev: I20220525-22:37:02.243(0)? LocalStore: store created at 
@rocket.chat/meteor:dev: I20220525-22:37:02.252(0)? LocalStore: store created at 
@rocket.chat/meteor:dev: I20220525-22:37:02.252(0)? LocalStore: store created at 
@rocket.chat/meteor:dev: W20220525-22:37:03.588(0)? (STDERR) MessageType.render is deprecated. Use MessageType.message instead. livechat_webrtc_video_call
@rocket.chat/meteor:dev: W20220525-22:37:04.032(0)? (STDERR) (node:2811) [MONGODB DRIVER] Warning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
@rocket.chat/meteor:dev: W20220525-22:37:04.032(0)? (STDERR) (Use `node --trace-warnings ...` to show where the warning was created)
@rocket.chat/meteor:dev: I20220525-22:37:04.324(0)? [2022-05-25T22:37:03.640Z] ERROR (System/2811 on rocketchat-dev): Invalid setting code SMS_Mobex_from_number: Setting SMS_Mobex_from_number is of type int but got string
@rocket.chat/meteor:dev: I20220525-22:37:04.324(0)? [2022-05-25T22:37:03.641Z] ERROR (System/2811 on rocketchat-dev): Invalid setting stored SMS_Mobex_from_number: Setting SMS_Mobex_from_number is of type int but got string
@rocket.chat/meteor:dev: I20220525-22:37:04.324(0)? [2022-05-25T22:37:03.814Z] WARN (VoIPService/2811 on rocketchat-dev): Voip is not enabled. Cant start the service
@rocket.chat/meteor:dev: W20220525-22:37:05.780(0)? (STDERR) (node:2811) [MONGODB DRIVER] Warning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
@rocket.chat/meteor:dev: I20220525-22:37:05.971(0)? Loaded the Apps Framework and loaded a total of 1 Apps!
@rocket.chat/meteor:dev: => Started your app.
@rocket.chat/meteor:dev: 
@rocket.chat/meteor:dev: => App running at: http://localhost:3000/
@rocket.chat/meteor:dev: I20220525-22:37:06.271(0)? +---------------------------------------------------+
@rocket.chat/meteor:dev: I20220525-22:37:06.272(0)? |                   SERVER RUNNING                  |
@rocket.chat/meteor:dev: I20220525-22:37:06.272(0)? +---------------------------------------------------+
@rocket.chat/meteor:dev: I20220525-22:37:06.272(0)? |                                                   |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |  Rocket.Chat Version: 4.8.0-develop               |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |       NodeJS Version: 14.19.1 - x64               |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |      MongoDB Version: 5.0.5                       |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |       MongoDB Engine: wiredTiger                  |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |             Platform: linux                       |
@rocket.chat/meteor:dev: I20220525-22:37:06.273(0)? |         Process Port: 20098                       |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? |             Site URL: http://192.168.188.40:3000  |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? |     ReplicaSet OpLog: Enabled                     |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? |          Commit Hash: 2452448e6c                  |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? |        Commit Branch: develop                     |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? |                                                   |
@rocket.chat/meteor:dev: I20220525-22:37:06.274(0)? +---------------------------------------------------+

Sh0uld added a commit to Sh0uld/Rocket.Chat-meteor-node-stub-update that referenced this issue May 27, 2022
@ankar84
Copy link

ankar84 commented May 30, 2022

@sampaiodiego Hey, Diego! Please consider to test linked PR and if possible include that in 4.8 release.
cc @d-gubert
Thank you!

casalsgh pushed a commit that referenced this issue Jun 6, 2022
* Bumb meteoer-node-stubs to version 1.2.3 to fix issue #25460

* yarn.lock

Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
ggazzo added a commit that referenced this issue Jun 9, 2022
* Bumb meteoer-node-stubs to version 1.2.3 to fix issue #25460

* yarn.lock

Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
@ggazzo ggazzo mentioned this issue Jun 9, 2022
@ggazzo
Copy link
Member

ggazzo commented Jun 9, 2022

closed by #25669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants