Importing SMF 2 to discourse

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.

3 Likes