Unhandled error when importing banned user

(Dan Dascalescu) #1

While running the MyBB importer to incrementally import the posts created since the last import before finally shutting down the MyBB forum, I got this error for a user I had banned in Discourse but hadn’t yet deleted from MyBB:

creating users
     4679 / 4736 ( 98.8%)  Failed to create user id: 8382, username: adamssofia, email: adamssofia02@gmail.com
user errors: ["Email is not allowed."]
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activemodel-4.2.4/lib/active_model/attribute_methods.rb:433:in `method_missing': undefined method `user_profiler' for #<User:0x0055be977ef260> (NoMethodError)
        from /var/www/discourse/script/import_scripts/base.rb:242:in `block in create_users'
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.9.7/lib/patches/db/mysql2.rb:6:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.9.7/lib/patches/db/mysql2.rb:6:in `each'
        from /var/www/discourse/script/import_scripts/base.rb:221:in `create_users'
        from mybb2.rb:54:in `block in import_users'
        from /var/www/discourse/script/import_scripts/base.rb:665:in `block in batches'
        from /var/www/discourse/script/import_scripts/base.rb:664:in `loop'
        from /var/www/discourse/script/import_scripts/base.rb:664:in `batches'
        from mybb2.rb:39:in `import_users'
        from mybb2.rb:24:in `execute'
        from /var/www/discourse/script/import_scripts/base.rb:45:in `perform'
        from mybb2.rb:221:in `<main>'

(Sam Saffron) #2

I do not think this is a big deal, it will just skip the user afaik

(Mittineague) #3

I don’t know if things have changed, but when we migrated a lot of older vBulletin threads the Banned members were not imported and their posts were assigned to “System”

There member names might still be visible if they were quoted or referred to elsewhere in the discussion, but IMHO the results were OK

(Kane York) #4

Actually, it might crash the import script, waiting for you to fix it…

@dandv you should change the import_users method to do nothing (put return at the top).

(Dan Dascalescu) #5

Maybe the log I posted looked incomplete, but it does crash the import script; the user isn’t just skipped.