Importing SMF 2 to discourse

AI-generated summary

The user is experiencing an error while importing posts from SMF 2 to Discourse, specifically a “stack level too deep” error. This occurs during the post creation process. pfaffman suggests that the issue is due to the script attempting to sort all posts at once, causing it to run out of memory. A possible solution is to modify the importer to pull in posts in batches, similar to other importers that process 1000 posts at a time. A related thread may provide further guidance on resolving this issue.

Trying to import posts from SMF

getting error
in each_strongly_connected_component_from’: stack level too deep

creating groups
        2 / 2 (100.0%)
creating users
       19 / 0 (  Inf%)
creating posts
//usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from': stack level too deep (SystemStackError)
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
         ... 9868 levels...
        from smf2.rb:66:in `execute'
        from /var/www/discourse/script/import_scripts/base.rb:45:in `perform'
        from smf2.rb:25:in `run'
        from smf2.rb:667:in `<main>'

Any idea what to look for?

You should see this thread.

Looks like the problem is that the script tries to sort all of the posts at once and runs out of memory. Most importers pull in only 1000 posts at a time, which keeps that from happening. It looks like there’s something strange about how topics are ordered.