Discourse update failed while building gem native extension through docker


(Thavanathan T) #1

My version of discourse is 0.9.8.9 and the new version is 0.9.8.11

I tried to update discourse through /admin/docker and the log output was

$ bundle install --deployment --without test --without development
Fetching source index from https://rubygems.org/
Killed

So, I tried to bootstrap again. It also failed with the following error message.

> cd /var/www/discourse && sudo -E -u discourse bundle install --deployment --verbose --without test --without development
I, [2014-03-26T06:06:42.408872 #37]  INFO -- : Fetching from: https://rubygems.org/api/v1/dependencies
HTTP Redirection
Fetching from: https://bundler.rubygems.org/api/v1/dependencies
HTTP Success
Fetching source index from https://rubygems.org/
Fetching from: https://rubygems.org/quick/Marshal.4.8/actionmailer-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/actionmailer-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/actionpack-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/actionpack-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/activesupport-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/activesupport-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/multi_json-1.9.2.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/multi_json-1.9.2.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/thread_safe-0.2.0.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/thread_safe-0.2.0.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/atomic-1.1.16.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/atomic-1.1.16.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/tzinfo-0.3.39.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/tzinfo-0.3.39.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/activemodel-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/activemodel-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/activerecord-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/activerecord-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/addressable-2.3.6.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/addressable-2.3.6.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/railties-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/railties-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/mini_portile-0.5.3.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/mini_portile-0.5.3.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/onebox-1.2.8.gemspec.rz
HTTP Redirection
Fetching from: https://bb-m.rubygems.org/quick/Marshal.4.8/onebox-1.2.8.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/rack-mini-profiler-0.9.1.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/rack-mini-profiler-0.9.1.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/rails-4.0.4.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/rails-4.0.4.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/sass-3.2.16.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/sass-3.2.16.gemspec.rz
HTTP Success
Fetching from: https://rubygems.org/quick/Marshal.4.8/sass-rails-4.0.2.gemspec.rz
HTTP Redirection
Fetching from: https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/sass-rails-4.0.2.gemspec.rz
HTTP Success
Using rake (10.1.1)
0:  rake (10.1.1) from /var/www/discourse/vendor/bundle/ruby/2.0.0/specifications/rake-10.1.1.gemspec
Using i18n (0.6.9)
0:  i18n (0.6.9) from /var/www/discourse/vendor/bundle/ruby/2.0.0/specifications/i18n-0.6.9.gemspec
Using minitest (4.7.5)
0:  minitest (4.7.5) from /var/www/discourse/vendor/bundle/ruby/2.0.0/specifications/minitest-4.7.5.gemspec
Installing multi_json (1.9.2)
0:  multi_json (1.9.2) from /var/www/discourse/vendor/bundle/ruby/2.0.0/specifications/multi_json-1.9.2.gemspec

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb 

Gem files will remain installed in /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/atomic-1.1.16 for inspection.
Results logged to /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/atomic-1.1.16/ext/gem_make.out
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:69:in ``'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:69:in `run'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:39:in `block in build'
/usr/local/lib/ruby/2.0.0/tempfile.rb:324:in `open'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:19:in `build'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:148:in `block (2 levels) in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:147:in `chdir'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:147:in `block in build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:146:in `synchronize'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:146:in `build_extension'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:180:in `block in build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:177:in `each'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:177:in `build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/installer.rb:667:in `build_extensions'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/installer.rb:225:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:100:in `block in install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:118:in `preserve_paths'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:93:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:111:in `block in install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:150:in `with_build_args'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:110:in `install_gem_from_spec'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:265:in `block in install_sequentially'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/2.0.0/forwardable.rb:171:in `each'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:264:in `install_sequentially'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:97:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/installer.rb:15:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/cli.rb:255:in `install'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/bin/bundle:20:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/bin/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
An error occurred while installing atomic (1.1.16), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.16'` succeeds before bundling.

2014-03-26 06:06:42 UTC LOG:  received smart shutdown request
2014-03-26 06:06:42 UTC LOG:  autovacuum launcher shutting down
2014-03-26 06:06:42 UTC LOG:  shutting down

(Sam Saffron) #2

hmm, what happens if you delete /var/docker/shared/vendor_bundle and try to re-bootstrap ?


(Thavanathan T) #3

Thanks. Deleting /var/docker/shared/vendor_bundle solved the issue.


(Sam Saffron) #4

Interesting, must of had a half working gem in the cache, perhaps I will add a retry there or something.


(Troy Anderson) #5

I had an issue with bundle install in an upgrade as well, my log output on the admin page just said bundle install and sat there for like 30 minutes before I tried a fresh bootstrap.

I also happened to jump into the container and do a ‘bundle’ and got an SSL warning for the gems, so it wouldn’t install anything.

Then the ./launcher bootstrap app failed to find a bundler gem;

I, [2014-05-01T14:16:54.066225 #39]  INFO -- : > cd /var/www/discourse && gem update bundler
ERROR:  While executing gem ... (Gem::SpecificGemNotFoundException)
    Could not find a valid gem 'bundler' (= 1.6.2) locally or in a repository
I, [2014-05-01T14:16:57.344967 #39]  INFO -- : Updating installed gems
Updating bundler

[1682014-05-01 14:16:57 UTC LOG:  received smart shutdown request
 | signal handler] (1398953817) Received SIGTERM, scheduling shutdown...
2014-05-01 14:16:57 UTC LOG:  autovacuum launcher shutting down
2014-05-01 14:16:57 UTC LOG:  shutting down
2014-05-01 14:16:57 UTC LOG:  database system is shut down
/pups/lib/pups/exec_command.rb:85:in `spawn': cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 248 exit 1> (RuntimeError)
	from /pups/lib/pups/exec_command.rb:55:in `block in run'
	from /pups/lib/pups/exec_command.rb:53:in `each'
	from /pups/lib/pups/exec_command.rb:53:in `run'
	from /pups/lib/pups/command.rb:6:in `run'
	from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
	from /pups/lib/pups/config.rb:76:in `each'
	from /pups/lib/pups/config.rb:76:in `block in run_commands'
	from /pups/lib/pups/config.rb:75:in `each'
	from /pups/lib/pups/config.rb:75:in `run_commands'
	from /pups/lib/pups/config.rb:71:in `run'
	from /pups/lib/pups/cli.rb:31:in `run'
	from /pups/bin/pups:8:in `<main>'
e7379df414a570468bb34c2ca1ab3476357b63e1f790d8eba3957de719555099
FAILED TO BOOTSTRAP

I’m currently stuck here… should I also try removing that vendor_bundle folder?


(Christopher Baker) #6

I’ve got the same problem and am stuck in the same place. I removed the vendor_bundle, but the bootstrap failed with the same error again.

I, [2014-05-03T00:37:46.717278 #43]  INFO -- : > cd /var/www/discourse && gem update bundler
ERROR:  While executing gem ... (Gem::SpecificGemNotFoundException)
    Could not find a valid gem 'bundler' (= 1.6.2) locally or in a repository
I, [2014-05-03T00:37:50.248253 #43]  INFO -- : Updating installed gems
Updating bundler

2014-05-03 00:37:50 UTC LOG:  received smart shutdown request
2014-05-03 00:37:50 UTC LOG:  autovacuum launcher shutting down
[172 | signal handler] (1399077470) Received SIGTERM, scheduling shutdown...
2014-05-03 00:37:50 UTC LOG:  shutting down
2014-05-03 00:37:50 UTC LOG:  database system is shut down
/pups/lib/pups/exec_command.rb:85:in `spawn': cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 252 exit 1> (RuntimeError)
        from /pups/lib/pups/exec_command.rb:55:in `block in run'
        from /pups/lib/pups/exec_command.rb:53:in `each'
        from /pups/lib/pups/exec_command.rb:53:in `run'
[172] 03 May 00:37:50.266 # User requested shutdown...
[172] 03 May 00:37:50.266 * Saving the final RDB snapshot before exiting.
        from /pups/lib/pups/command.rb:6:in `run'
        from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
        from /pups/lib/pups/config.rb:76:in `each'
        from /pups/lib/pups/config.rb:76:in `block in run_commands'
        from /pups/lib/pups/config.rb:75:in `each'
        from /pups/lib/pups/config.rb:75:in `run_commands'
        from /pups/lib/pups/config.rb:71:in `run'
        from /pups/lib/pups/cli.rb:31:in `run'
        from /pups/bin/pups:8:in `<main>'
804d7a5b4525ae8bb694e95490c9a9579a4c9d97d6bce1f92d1ab08694ecb7f3
FAILED TO BOOTSTRAP

(Troy Anderson) #7

Did you get yours working? My site has been offline for 10 days - I think I’m going to lose my small community :smile:


(Troy Anderson) #8

Ok, I just did a ./launcher start app instead of bootstrap, and got this;

root@mobilerepair:/var/docker# ./launcher start app
WARNING: No swap limit support
No cid found, creating a new container
Calculated ENV: -e HOME=/root -e RAILS_ENV=production -e UNICORN_WORKERS=3 -e RUBY_GC_MALLOC_LIMIT=40000000 -e RUBY_HEAP_MIN_SLOTS=800000 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e DISCOURSE_DEVELOPER_EMAILS=troemail -e DISCOURSE_HOSTNAME=www.SITEHERE.io -e DISCOURSE_SMTP_ADDRESS=smtp.SMTPHERE.net -e 
5206be3deb178ea2c117fba8e1baa024763d2182df69b8a1d07bb66ccf8db27c
root@mobilerepair:/var/docker# ./launcher start app
WARNING: No swap limit support
cid found, ensuring container is started
Error: Cannot start container 5206be3deb178ea2c117fba8e1baa024763d2182df69b8a1d07bb66ccf8db27c: The container 5206be3deb178ea2c117fba8e1baa024763d2182df69b8a1d07bb66ccf8db27c is already running.
2014/05/08 09:48:10 Error: failed to start one or more containers

And the site is running again… I really have no idea how this works, but the site is up… so… maybe I won’t do an update for a bit :smile:


(Jeff Atwood) #9

Suggestion: make sure your discourse docker is up to date first.

How? Easy:

cd /var/docker
git pull

Live example on my server:

root@discourse:~# cd /var/docker
root@discourse:/var/docker# git pull
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 4), reused 2 (delta 0)
Unpacking objects: 100% (6/6), done.
From https://github.com/discourse/discourse_docker
   e6cf159..8aca5cb  master     -> origin/master
Updating e6cf159..8aca5cb
Fast-forward
 launcher |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

After you’ve done that, do a

./launcher rebuild app


(Christopher Baker) #10

This process of pulling the latest docker and then ./launcher rebuild ... worked. Now upgraded!


(Marco) #11

Sorry I have the same problem.

I just did the usual

cd /var/discourse
sudo git pull
sudo ./launcher rebuild app

It waits a long time here:

cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without develo pment'

The error I get is:

ERROR: column topic_embeds.deleted_at does not exist

It has something to do with gems. How can I reset those, empty the cache, something like that?


(Marco) #12

This one was scaring guys. It was the Babble plug-in. Disabled and rebuilt.