Importing comments, posts are not getting created. Says user not present but the user is present

So I am trying to import a disqus commenting system

All of the topics get created but the corresponding comments are not. So I started digging around and realized the user object for the corresponding comment/post is not shown as “present” even though I can browse them from the forum.

The code in question is this
https://github.com/discourse/discourse/blob/5012d46cbd3bcf79b7351f7d2d41003496a796c5/script/import_scripts/disqus.rb#L80

Before the import process started, I had disabled all outgoing emails. The script then created all these users (which I can verify)

But
post_user.present?
returns empty

Is this because the users are not active yet?

If yes, can I manually activate these users because they are part of an import and were already “active”

1 Like

I believe that the problem is that email addresses are now in a different table, and the code needs to be updated accordingly.

If I’m right, a bunch of importers will be broken similarly.

2 Likes

Thanks @pfaffman.

That’s bad news. Whom do you think can be tagged to raise concern? The whole importer side of the code has been moved from some other place and no history of owner.

By the way, shouldn’t this impact the user creation flow too?

https://github.com/discourse/discourse/blob/5012d46cbd3bcf79b7351f7d2d41003496a796c5/script/import_scripts/disqus.rb#L44

Hey, @gerhard. Does it look to you that the problem above is related to email addresses being moved to a different table?

No. The create_user code still works and puts the email address in the correct table, but I think that some changes may need to be made to access the email address. It’s completely obvious, but only if you already know.

1 Like

Thanks for finding the root cause. The disqus import script was the only one with that problem. It should be fixed now.

https://github.com/discourse/discourse/commit/94ceb06b02fc32be4f3f7b6072fe1a7449edf674

5 Likes

I am not a programmer and you’ve thanked me. I am on cloud nine. Thanks for all the work and for fixing this!

6 Likes