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

syn2mas does not import user if it has warnings #3479

Open
tonkku107 opened this issue Nov 6, 2024 · 3 comments
Open

syn2mas does not import user if it has warnings #3479

tonkku107 opened this issue Nov 6, 2024 · 3 comments

Comments

@tonkku107
Copy link
Contributor

Describe the bug
syn2mas will skip migrating a user if non-fatal warnings were encountered, such as a non-email 3pid type.

To Reproduce
Steps to reproduce the behavior:

  1. Have a user with an msisdn 3pid
  2. Run the migration
  3. Observe the warning "Skipping non-email 3pid msisdn for user"
  4. Notice that the specific user is entirely missing from MAS

Expected behavior
User is migrated but with the msisdn 3pid missing

Additional context
Discussion in the #matrix-auth:matrix.org room

The problematic piece of code is here:

if (warningsForUser > 0) {
if (!args.dryRun) {
fatal(`User ${user.name} had ${warningsForUser} warnings`);
} else {
log.warn(`User ${user.name} had ${warningsForUser} warnings`);
}
} else if (!args.dryRun) {
log.info(`Running ${executions.length} updates for user ${user.name}`);
const tx = await mas.transaction();

@johansmitsnl
Copy link

I also have this issue, how did you solve it?

@moqmar
Copy link

moqmar commented Mar 4, 2025

Changing line 410 to if (false) { works (you can usually find the file with find "$(npm prefix -g)" -name migrate.mts). Only do this if you understood all warnings from the dry run though and are sure that you want to ignore them.

This behaviour definitely needs to be fixed, as it means that the dry run succeeds but the actual run leaves you with a corrupt MAS database that needs to be deleted and migrated to again from scratch. This is basically the opposite of how a dry run shall normally work.

@tonkku107
Copy link
Contributor Author

This should be solved with #3878 for the rewrite of the syn2mas tool but the rewrite is still work in progress

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