Core dump when running the MyBB import script

I get the same error message as in this post when running the MyBB importer as I’ve described here:

$ RAILS_ENV=production ruby mybb2.rb
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...

creating users
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.9.7/lib/patches/db/mysql2.rb:6: [BUG] Segmentation fault
ruby 2.0.0p647 (2015-08-18 revision 51631) [x86_64-linux]

[... about 3000 lines snipped ...]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted

The script does include the latest fix. By the way, while at it, can someone please merge in my PR that fixes the migration of quotes?

I’m seeing the same on this end as well, not in the same place, but definitely the same segfault.

1 Like

I had a similar problem with the phpBB3 importer.
Try changing the cache_rows to true.

https://github.com/discourse/discourse/blob/master/script/import_scripts/mybb.rb#L184-L186

If that doesn’t help try upgrading the mysql2 gem:
gem update mysql2

2 Likes

Oh cool, that looks like it works. Thanks!

cache_rows: true prevents the crash.

MyBB imports used to work until a few weeks ago. The crash is a regression and blocks not only imports, but also certain kinds of batch processing.

Can we please get an official fix? CC @zogstrip, @techAPJ, @riking

UPDATE removing cache_rows altogether also prevents the crash. I did downgrade the mysql gem to v0.3.20 though.

I JUST saw that today … we got to raise this issue with the mysql2 gem…its crash central with cache_rows: true. Can you raise that with them together with the segfault?

This is a reasonably new issue, was working fine a few weeks ago. Now it is bust on pretty much every ruby version.

Never mind … will raise …

1 Like

Thanks @sam. How can one revert to a working state of the gem and whatever else is involved? I only need to obtain a map of old_topic_id -> imported topic_id to create a redirect map file, and the importer itself was the easiest way to get that.

I can’t find the core dump and am in the middle of an import, can you do a gist of it?

https://gist.github.com/dandv/9d260ba2bf1113fd0b4e

Unless you are a paying customer, you are not obligated to our time. If you continue to make demands like this, either buy a hosting contract, or with all due respect, take your demands somewhere else.

I know. Discourse is an OSS project. To which I contributed many hours to the best of my abilities.

I didn’t make any demand. I said “please”. Maybe too many times. Please accept my apologies.

I raised the issue here:

https://github.com/brianmario/mysql2/issues/691

Totally fine with a PR that removes all the cache_rows: true from the importers using mysql2 for now.

1 Like

This appears to have been fixed:

https://github.com/brianmario/mysql2/pull/745

4 Likes