Closed manc74 closed 1 year ago
I've managed to "resolve" this - it was caused by a user with a "+" in the email address causing the issue. Ive removed that bot user now and the process runs,
Hello @zulip/server-misc members, this issue was labeled with the "area: export/import" label, so you may want to check it out!
To make sure I'm understanding right -- you removed the bot user in RocketChat and re-exported, then ran the conversion on that new export, and it succeeded?
Yes that's correct.
OK! If you have the old export file still around, can you try applying this diff and re-running the conversion on it?
diff --git zerver/data_import/rocketchat.py zerver/data_import/rocketchat.py
index 5c4d32e184..0b21189449 100644
--- zerver/data_import/rocketchat.py
+++ zerver/data_import/rocketchat.py
@@ -71,6 +71,7 @@ def process_users(
# "user": This is a regular user of the system.
# "bot": A special user types for bots.
# "unknown": This usually represents a livechat guest.
+ logging.info("%r", user_dict)
if user_dict["type"] != "user":
is_active = False
Running ./manage.py convert_rocketchat_data
will not affect any data in your current Zulip instance, and the patch is also safe to apply to a running Zulip instance -- the serving codepaths don't use that file at all.
The output should be a bunch of user data -- we're interested in the last one output. You can redact anything user-specific in it -- we're interested in the following keys:
type
(exact value is important)username
(mostly just presence or absence)emails
(mostly just presence or absence)Sure, I'll give it a go in the morning and let you know the results! Thanks.
Actually, just ran it now as I had a local copy of the dump - this is the output of the last record (redacted) and also the traceback:
2023-05-16 19:38:05.637 INFO [] {'_id': 'RzcsZYNmZMFatF95Y', 'createdAt': datetime.datetime(2019, 9, 25, 12, 12, 4, 217000, tzinfo=<bson.tz_util.FixedOffset object at 0x7f7546822da0>), 'services': {'password': {'bcrypt': $2b$10$cEQxxxxxxxxxxxxxxxSd8Iu27i5t0XyFW'}}, 'username': 'redactedusername', 'type': 'user', 'status': 'offline', 'active': True, '_updatedAt': datetime.datetime(2021, 1, 28, 17, 43, 38, 771000, tzinfo=<bson.tz_util.FixedOffset object at 0x7f7 546822da0>), 'roles': ['bot'], 'utcOffset': -7, 'name': 'redactedusername', 'importIds': ['UNQLBPS2H', 'BNBSVGNM8'], 'rooms': []}
redactedusername
Traceback (most recent call last):
File "/home/zulip/deployments/2023-05-15-08-51-03/./manage.py", line 151, in
Thanks for that! I've pushed a PR to resolve this -- though I'll admit I'm a bit confused about RocketChat's data model which permits users without email addresses.
I've pushed another commit to key off of the roles: ['bot']
to treat that "user" as a bot.
No, the user did have an email address, but it was in the format of "bot+name@domain.com" - I suspect its the "+" plus addressing in the email address that was confusing either the export from Rocketchat or the import to Zulip.
Must have been the export, since it's not in the logline you showed.
Attempting a new deployment of Zulip and importing data from Rocket chat. Following the instructions im getting to the data conversion and getting this error:
Any ideas?