# Rebuilding mbox import container fails due to tiny\_tds

**URL:** https://meta.discourse.org/t/rebuilding-mbox-import-container-fails-due-to-tiny-tds/90674
**Category:** Bug
**Created:** [25 ביוני,‏ 2018,‏ 5:54am UTC](https://meta.discourse.org/t/rebuilding-mbox-import-container-fails-due-to-tiny-tds/90674 "2018-06-25T05:54:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yanokwa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yanokwa/32/105083_2.png) [@yanokwa](https://meta.discourse.org/u/yanokwa)
#### Post date: [25 ביוני,‏ 2018,‏ 5:54am UTC](https://meta.discourse.org/t/rebuilding-mbox-import-container-fails-due-to-tiny-tds/90674/1 "2018-06-25T05:54:08Z")

</div>

On Discourse v2.1.0.beta2, rebuilding the import box that @gerhard shared at [Migrate a mailing list to Discourse (mbox, Listserv, Google Groups, etc)](https://meta.discourse.org/t/importing-mailing-lists-mbox-listserv-emails/79773) is broken.

My guess is that the `tiny_tds` gem that @zogstrip [added](https://github.com/discourse/discourse/commit/685083491e08c6147f7162a953eabc177ab3da27) requires [building freetds from source](https://github.com/rails-sqlserver/tiny_tds#install).

I’ve tried making sure `freetds-dev` and `freetds-bin` are installed in `templates/import/mbox.template.yml`, but that doesn’t seem to help.

I’ve put a log below.

```plaintext
Using lograge 0.10.0
Using rails_multisite 2.0.5
Using rspec-rails 3.7.2
Using ember-rails 0.18.5
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/tiny_tds-2.1.2/ext/tiny_tds
/usr/local/bin/ruby -r ./siteconf20180625-14532-yvtszm.rb extconf.rb
checking for sybfront.h... no
checking for sybdb.h... no
checking for tdsdbopen() in -lsybdb... no
checking for dbanydatecrack() in -lsybdb... no
Failed! Do you have FreeTDS 0.95.80 or higher installed?
***extconf.rb failed***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
	--help
	--with-freetds-dir
	--without-freetds-dir
	--with-freetds-include
	--without-freetds-include=${freetds-dir}/include
	--with-freetds-lib
	--without-freetds-lib=${freetds-dir}/lib
	--with-freetds-dir
	--without-freetds-dir
	--with-freetds-include
	--without-freetds-include=${freetds-dir}/include
	--with-freetds-lib
	--without-freetds-lib=${freetds-dir}/lib
	--with-sybdblib
	--without-sybdblib
	--with-sybdblib
	--without-sybdblib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/var/www/discourse/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/tiny_tds-2.1.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/tiny_tds-2.1.2 for inspection.
Results logged to
/var/www/discourse/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/tiny_tds-2.1.2/gem_make.out

An error occurred while installing tiny_tds (2.1.2), and Bundler cannot
continue.
Make sure that `gem install tiny_tds -v '2.1.2' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  tiny_tds

I, [2018-06-25T05:04:57.425164 #17] INFO -- : Terminating async processes
I, [2018-06-25T05:04:57.426875 #17] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 72
2018-06-25 05:04:57.428 UTC [72] LOG: received fast shutdown request
I, [2018-06-25T05:04:57.429104 #17] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 188
188:signal-handler (1529903097) Received SIGTERM scheduling shutdown...
2018-06-25 05:04:57.432 UTC [72] LOG: aborting any active transactions
2018-06-25 05:04:57.441 UTC [72] LOG: worker process: logical replication launcher (PID 81) exited with exit code 1
2018-06-25 05:04:57.444 UTC [76] LOG: shutting down
188:M 25 Jun 05:04:57.468 # User requested shutdown...
188:M 25 Jun 05:04:57.468 * Saving the final RDB snapshot before exiting.
2018-06-25 05:04:57.479 UTC [72] LOG: database system is shut down
188:M 25 Jun 05:04:57.495 * DB saved on disk
188:M 25 Jun 05:04:57.496 # Redis is now ready to exit, bye bye...

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'IMPORT=1 bundle install --no-deployment --without test --without development --path vendor/bundle' failed with return #<Process::Status: pid 14530 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmysqlclient-dev libsqlite3-dev", "su discourse -c 'IMPORT=1 bundle install --no-deployment --without test --without development --path vendor/bundle'"]}
b80283c9621f9427ef0bd61fac15af0ee6e37a3e7d4759c1d81125516c244d0e
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

<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: [25 ביוני,‏ 2018,‏ 11:41am UTC](https://meta.discourse.org/t/rebuilding-mbox-import-container-fails-due-to-tiny-tds/90674/3 "2018-06-25T11:41:29Z")

</div>

I pushed a fix: [Install only sqlite3 gem for mbox import · discourse/discourse\_docker@b9f89fc · GitHub](https://github.com/discourse/discourse_docker/commit/b9f89fceba25cd4a9e36a2d8991820fba39528c5)

---

<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: [26 ביוני,‏ 2018,‏ 11:41am UTC](https://meta.discourse.org/t/rebuilding-mbox-import-container-fails-due-to-tiny-tds/90674/4 "2018-06-26T11:41:35Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
