# Core dump when running the MyBB import script

**URL:** https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332
**Category:** Bug
**Created:** [2015年十月10日 01:54 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332 "2015-10-10T01:54:50Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年十月10日 01:54 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/1 "2015-10-10T01:54:50Z")

</div>

I get the same error message as in [this post](https://meta.discourse.org/t/cant-start-phpbb3-importer/33944/10) when running the MyBB importer as I’ve described [here](https://meta.discourse.org/t/migrating-from-mybb/25563/4):

```plaintext
$ 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](https://meta.discourse.org/t/mybb-importer-script-failing-at-creating-users-stage/33828/3). By the way, while at it, can someone please merge in [my PR that fixes the migration of quotes](https://github.com/discourse/discourse/pull/3802)?

---

<div class="post-metadata">

### Author: ![jeff\_wigal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeff_wigal/32/116871_2.png) [@jeff\_wigal](https://meta.discourse.org/u/jeff_wigal)
#### Post date: [2015年十月10日 17:56 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/2 "2015-10-10T17:56:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [2015年十月10日 18:22 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/3 "2015-10-10T18:22:17Z")

</div>

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

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

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

---

<div class="post-metadata">

### Author: ![jeff\_wigal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeff_wigal/32/116871_2.png) [@jeff\_wigal](https://meta.discourse.org/u/jeff_wigal)
#### Post date: [2015年十月10日 19:12 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/4 "2015-10-10T19:12:53Z")

</div>

Oh cool, that looks like it works. Thanks!

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年十月14日 01:13 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/5 "2015-10-14T01:13:33Z")

</div>

`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](https://github.com/dandv/discourse-post-process#fixing-quotes).

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年十月14日 01:15 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/6 "2015-10-14T01:15:10Z")

</div>

> [@dandv](#):
>
> cache\_rows: true prevents the crash

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 …

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年十月14日 01:19 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/7 "2015-10-14T01:19:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年十月14日 01:22 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/8 "2015-10-14T01:22:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年十月14日 01:55 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/9 "2015-10-14T01:55:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015年十月14日 01:59 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/10 "2015-10-14T01:59:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年十月14日 02:00 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/11 "2015-10-14T02:00:42Z")

</div>

> [@codinghorror](#):
>
> Unless you are a paying customer, you are not obligated to our time.

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

> [@codinghorror](#):
>
> If you continue to make demands like this, either buy a hosting contract, or with all due respect, take your demands somewhere else.

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2015年十月14日 02:01 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/12 "2015-10-14T02:01:35Z")

</div>

I raised the issue here:

[https://github.com/brianmario/mysql2/issues/691](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.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2016年五月3日 11:27 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/13 "2016-05-03T11:27:14Z")

</div>

This appears to have been fixed:

[https://github.com/brianmario/mysql2/pull/745](https://github.com/brianmario/mysql2/pull/745)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2016年五月3日 11:27 UTC](https://meta.discourse.org/t/core-dump-when-running-the-mybb-import-script/34332/14 "2016-05-03T11:27:17Z")

</div>


