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

"Oops! Something went wrong" while opening some channels via web/desktop since 5.0.0 #26365

Closed
iglooom opened this issue Jul 26, 2022 · 25 comments

Comments

@iglooom
Copy link

iglooom commented Jul 26, 2022

Description:

Since 5.0.0 we can't open some chats. Got "Oops! Something went wrong." on web/desktop only.
Android works fine.
No errors in logs, even in debug mode.
In browser console: "TypeError: j.replies is undefined"

All this channels was imported from slack earlier and worked just fine. But since 5.0.0 if chat has a thread from slack - this chat can't be opened.
When viewing from android app I've noticed that old threads from slack displayed as e.g. "Messages: 24, Users: 0". After I deleted all this threads - errors gone.

photo_2022-07-26_18-32-23

Steps to reproduce:

  1. Install some old version like 4.6.*
  2. Import data from slack
  3. Upgrade every single release up to 5.0.0

Server Setup Information:

  • Version of Rocket.Chat Server: 5.0.0
  • Operating System: Ubuntu 20.04 LTS
  • Deployment Method: docker

If it needs some diagnostics, I can perform queries in mongo.

@aleadco
Copy link

aleadco commented Jul 26, 2022

I can confirm this in 5.0.0-rc12 with manual implementation... In our case no channel was imported, it happens with all rooms created in the service

@lovekyleman
Copy link

Confirm that

@ankar84
Copy link

ankar84 commented Jul 27, 2022

duplicate of #26352

@iglooom
Copy link
Author

iglooom commented Jul 27, 2022

I already saw the #26352 but I thought it is different bug, since my related to room/chat, not user profile.

@treebes
Copy link

treebes commented Jul 28, 2022

#26352 (comment)

@charisteed28
Copy link

I still think that this is a different problem than in #26352
Perhaps they are related.

We noticed that the error pops up at the moment when messages imported from Slack appear.
For example, we imported messages in February - and the channels work fine, but when you scroll through the history and scroll to the last imported message, an error pops up.

Error:

Uncaught Error: TypeError: Cannot read properties of undefined (reading 'indexOf')
    at O (/client/views/room/MessageList/components/MessageContent.tsx:1:2814)
    at Dc (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:59696)
    at gi (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:69176)
    at di (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:68510)
    at li (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:68168)
    at Rs (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:114835)
    at nu (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:98840)
    at ru (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:98768)
    at eu (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:98631)
    at Gs (07209f7aff72860ca8f6c4de51803a1e16f37033.js?meteor_js_resource=true:1124:95485) {componentStack: '\n    at O (/client/views/room/MessageList/componen…esource=true:1218:63317)\n    at Suspense\n    at f'}

@terR0Q
Copy link

terR0Q commented Aug 4, 2022

I still think that this is a different problem than in #26352 Perhaps they are related.

We noticed that the error pops up at the moment when messages imported from Slack appear. For example, we imported messages in February - and the channels work fine, but when you scroll through the history and scroll to the last imported message, an error pops up.

Same here. We have this error in all channels when scrolling up to old messages imported from Slack.

@Weterok
Copy link

Weterok commented Aug 5, 2022

I still think that this is a different problem than in #26352 Perhaps they are related.
We noticed that the error pops up at the moment when messages imported from Slack appear. For example, we imported messages in February - and the channels work fine, but when you scroll through the history and scroll to the last imported message, an error pops up.

Same here. We have this error in all channels when scrolling up to old messages imported from Slack.

Same here.

@iglooom
Copy link
Author

iglooom commented Aug 13, 2022

Seems I've found a root cause.
In 'normal' threads there is a field replies along with tcount and tlm
"replies" : [ "YXFgesNuvbBpD5hnt", "QYSfQEECvgruQBLpS", "KXcDtcEqGzoGXaoo9", "jhZvN4nZeZkdEifKZ", "dHFpxLQRBdGGcwWmW", "jMNxBjrxuRGvosEzH", "sEDKfb2LqCzmhYjug" ], "tcount" : 14, "tlm" : ISODate("2022-06-10T14:39:35.485Z")

But in threads imported from slack there is not replies, but frontend expects it should be when tcount and tlm exists.

Some routine to fix this threads maybe needed.

@iglooom
Copy link
Author

iglooom commented Aug 13, 2022

Just tried this hack, and it works decent. On all this threads displayed only one participants, but at least all works now and channels/threads can be opened.
db.rocketchat_message.updateMany({ _id:/slack-/, tcount: { $exists :1}, replies : { $exists: 0}},{ $set: { replies: [ "rocket.cat" ] } })

@terR0Q
Copy link

terR0Q commented Aug 14, 2022

Didn't fix error for me. Got matchedCount and modifiedCount 0.0.

@iglooom
Copy link
Author

iglooom commented Aug 15, 2022

Try to do use rocketchat in mongo before query.

@terR0Q
Copy link

terR0Q commented Aug 16, 2022

I thought i've selected db before query. modifiedCount: 2703
And this did the trick! All merged messages and threads are now in place and no error hits the screen.
Big thx!

@dotty37
Copy link

dotty37 commented Aug 18, 2022

Im having this issue with one channel. How do I implement this DB hack? Im new to Rocket.chat .

@iglooom
Copy link
Author

iglooom commented Aug 18, 2022

@dotty37 if your rocketchat ran from docker-compose then you can run docker-compose exec mongo mongo rocketchat and apply command into opened console.

@dotty37
Copy link

dotty37 commented Aug 18, 2022 via email

@iglooom
Copy link
Author

iglooom commented Aug 19, 2022

Unfortunately, I'm not familiar with AWS at all. You should find a way to go to mongo console and run queries.

@LeoColman
Copy link

Just tried this hack, and it works decent. On all this threads displayed only one participants, but at least all works now and channels/threads can be opened. db.rocketchat_message.updateMany({ _id:/slack-/, tcount: { $exists :1}, replies : { $exists: 0}},{ $set: { replies: [ "rocket.cat" ] } })

This hack worked for me and I couldn't find any rooms that are still not working

@RyousukeUchino
Copy link

RyousukeUchino commented Aug 30, 2022

same error from ver 5.0.2
If you installed or updated from Snap Package, you can fix it by doing the following

$ rocketchat-server.mongo
----
rs0:PRIMARY> use parties;
rs0:PRIMARY> db.rocketchat_message.updateMany({ _id:/slack-/, tcount: { $exists :1}, replies : { $exists: 0}},{ $set: { replies: [ "rocket.cat" ] } });

@iglooom Thanks for your great tips!

Just tried this hack, and it works decent. On all this threads displayed only one participants, but at least all works now and channels/threads can be opened. db.rocketchat_message.updateMany({ _id:/slack-/, tcount: { $exists :1}, replies : { $exists: 0}},{ $set: { replies: [ "rocket.cat" ] } })

@paulharris
Copy link

Is there a plan to fix this bug properly? Or at least compute a better manual query fix?
ie so threads don't just show "only one participant" ?

@paulharris
Copy link

paulharris commented Sep 13, 2022

I've fixed it "more properly" by computing the replies properly.

I did it via python... so install pip,
ie on debian, apt install python-pip
and then install pymongo python -m pip install pymongo or probably just pip install pymongo

And then in python

from pymongo import MongoClient
client = MongoClient("localhost")
db = client.rocketchat
table = db.rocketchat_message
for m in table.find({'_id':{'$regex':'^slack-'}, 'tcount': {'$exists':1}, 'replies': {'$exists':0}}):
    r = table.distinct('u._id', {'tmid':m['_id']})
    table.update_one({'_id':m['_id']}, {'$set':{'replies':r}})

Note that I do NOT think this fixes all the missing things.
For example, there is no "value" field in the slack document items,
ie there is no:

  • 'md' field (markdown, i assume),
  • 'channels' field,
  • 'u.name' field (name of user)
  • '_updatedAt'
  • 'mentions'

Without these, will future versions of RocketChat crash?

@dotty37
Copy link

dotty37 commented Sep 13, 2022

Unfortunately, I'm not familiar with AWS at all. You should find a way to go to mongo console and run queries.

I finally had the chance to work on it today. I just had to do mongo --port 27017 and bang, inside the db. Typed the query hack and everything works now. Tested across reboots too. :-)

@shaymdev
Copy link

@pierre-lehnen-rc You've fixed a handful of other slack import issues and this one looks like there's a fair bit of user research here to point the fix in the right direction. Any chance this one might fit into the team's workload?

@pierre-lehnen-rc
Copy link
Contributor

Fixed by #26652

@shaymdev
Copy link

Thanks, you rock.

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