Rebuilding mbox import container fails due to tiny_tds

(Yaw Anokwa) #1

On Discourse v2.1.0.beta2, rebuilding the import box that @gerhard shared at Importing mailing lists (mbox, Listserv, emails, ...) is broken.

My guess is that the tiny_tds gem that @zogstrip added requires building freetds from source.

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.

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:
/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:

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


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

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

In Gemfile:

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...

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'"]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

(Gerhard Schlager) #3

I pushed a fix: Install only sqlite3 gem for mbox import · discourse/discourse_docker@b9f89fc · GitHub

(Gerhard Schlager) #4

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