Migration import fails because of "We could not count the users" and access lost to target instance

For troubleshooting questions, please post in the following format:

Summary
Import fails because of an error related to “We could not count the users”. Now I can’t access my self-hosted (target) server.

Steps to reproduce
I deployed MM using docker a week ago following the relative guide, and now I am trying to port a cloud instance there. I followed the guide and managed to arrive up until the processing of the imported zip file.

Unfortunately, I did not save the full error stack because I was planning to try again. However, I think the script failed mid-way through the execution, as I have now lost access to my self-hosted server. Since I was the only admin, I’m having a hard time recovering the password as, for some reason, the reset email is not getting delivered to my inbox.

Does any of this ring a bell to anyone?
Is there something I can do?

Expected behavior
A successful import and migration.

Hi Giuseppe and welcome to the Mattermost forums!

Most likely your local user accounts have been overwritten by the imported ones, you can set up mmctl in LocalMode and reset the password with it. To do that, change the value of ServiceSettings.EnableLocalMode in your config.json to true and restart the application container. Then, you can administer your users using the mmctl user subcommands:

docker exec -ti <mattermostcontainer> mmctl --local user

Hi, thanks! That was the issue. Enabling the local mode allowed me to change my user password and access the server again.

However, I keep having the same issue with the import processing (although it seems that users and conversations have been ported now). This is what the command mmctl import job list gives me:

ID: 8hbjqmfpytywmcaaneazkem3cr
  Status: error
  Created: 2023-07-04 00:15:19 +0200 CEST
  Started: 2023-07-04 00:15:29 +0200 CEST
  Data: map[error:We could not count the users. — Post.IsValid: Invalid type., id=system_welcome_post import_file:qjjzgxxjst8tjqs3dfpft8fwcy_imtxs1483ig4jkkbwgr53f51aa_export.zip line_number:476]

Edit: actually, no, the conversation history dates back to the date of my first export attempt (late June 2023). Trying now again to export and import a fresh archive did not have the effect to update all the conversation history (i.e., none of the messages exchanged between June 2023 and now is there).

If you haven’t been able to figure it out before July 27th, feel free to open a support ticket via https://support.mattermost.com/hc/en-us/requests/new.

Hey, I tried to dig a bit in the issue but after hours spent in checking all the exported files, editing the import.jsonl, and several other workarounds, I still have errors in the import processing.

We are dismissing the cloud instance on the 27th, so I think this is urgent enough.
I have opened a support ticket @amy.blais @agriesser

1 Like