I’m using [this q2a import](https://gist.github.com/Communiteq (formerly DiscourseHosting)/769eff2014d5482f0ab776de03dc3349) script and see below error. Please help to fix this issue.
Is it problem with my userbase or script. How to fix. Thanks!
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
importing users
80 / 447 ( 17.9%) [208 items/min] Traceback (most recent call last):
12: from script/import_scripts/question2answer.rb:601:in `<main>'
11: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
10: from script/import_scripts/question2answer.rb:70:in `execute'
9: from script/import_scripts/question2answer.rb:89:in `import_users'
8: from /var/www/discourse/script/import_scripts/base.rb:877:in `batches'
7: from /var/www/discourse/script/import_scripts/base.rb:877:in `loop'
6: from /var/www/discourse/script/import_scripts/base.rb:878:in `block in batches'
5: from script/import_scripts/question2answer.rb:106:in `block in import_users'
4: from /var/www/discourse/script/import_scripts/base.rb:247:in `create_users'
3: from /var/www/discourse/script/import_scripts/base.rb:247:in `each'
2: from /var/www/discourse/script/import_scripts/base.rb:259:in `block in create_users'
1: from /var/www/discourse/script/import_scripts/base.rb:290:in `create_user'
/var/www/discourse/script/import_scripts/base.rb:393:in `find_existing_user': undefined method `downcase' for nil:NilClass (NoMethodError)
Some field is empty or missing and shouldn’t be. You can try adding a put statement at line 111 printing out the user data and see if any of those fields are empty. And if they are, then you figure out why.
@pfaffman I tired below solution at line 111 and it worked. Do you see issue with this code? I’m planning to delete all users with below email id/username after import.
Thanks again for your help!
if !username
username = "userempty"
end
if !email
email = "test@example.com"
end
puts "username: #{username}"
puts "email: #{email}"