Rebuild app failed due to issue with mini-racer

I followed this instructions Changing Max Attachment Size and when rebuilding I see:

Any idea how to fix it?

+1 - Experiencing a similar build failure:

09:28:31 Fetching lograge 0.7.1
09:28:31 Installing lograge 0.7.1
09:28:31 2:  lograge (0.7.1) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/lograge-0.7.1.gemspec
09:28:31 Fetching rails_multisite 2.0.4
09:28:31 Installing rails_multisite 2.0.4
09:28:31 2:  rails_multisite (2.0.4) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/rails_multisite-2.0.4.gemspec
09:28:31 Fetching rspec-rails 3.6.1
09:28:31 Installing rspec-rails 3.6.1
09:28:31 2:  rspec-rails (3.6.1) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/rspec-rails-3.6.1.gemspec
09:28:31 Using ember-rails 0.18.5
09:28:31 2:  ember-rails (0.18.5) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/ember-rails-0.18.5.gemspec
09:28:31 1:  sassc (1.11.2) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/sassc-1.11.2.gemspec
09:28:31 I, [2018-07-23T16:28:31.830637 #15]  INFO -- : Terminating async processes
09:28:31 I, [2018-07-23T16:28:31.830682 #15]  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/post******** -D /etc/postgresql/10/main pid: 85
09:28:31 2018-07-23 16:28:31.830 UTC [85] LOG:  received fast shutdown request
09:28:31 2018-07-23 16:28:31.832 UTC [85] LOG:  aborting any active transactions
09:28:31 2018-07-23 16:28:31.833 UTC [85] LOG:  worker process: logical replication launcher (PID 94) exited with exit code 1
09:28:31 2018-07-23 16:28:31.834 UTC [89] LOG:  shutting down
09:28:32 2018-07-23 16:28:32.055 UTC [85] LOG:  database system is shut down

HTTP 429 Too Many Requests


@Falco -

I am not actually sure this is related to RubyGems - on closer inspection, it appears to be failing due to issues building mini-racer:

1:  sassc (1.11.2) from /var/www/discourse/vendor/bundle/ruby/2.5.0/specifications/sassc-1.11.2.gemspec
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/bin/ruby -r ./siteconf20180723-484-1dvgphl.rb extconf.rb
checking for -lpthread... yes
creating Makefile

current directory:
make "DESTDIR=" clean

current directory:
make "DESTDIR="
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but
not for C++ In function ‘void gc_callback(v8::Isolate*, v8::GCType,
v8::GCCallbackFlags)’: error: ‘TerminateExecution’ is not a member of
         ^ In function ‘VALUE rb_isolate_idle_notification(VALUE,
VALUE)’: error: ‘class v8::Isolate’ has no member named
return isolate_info->isolate->IdleNotification(NUM2INT(idle_time_in_ms)) ?
Qtrue : Qfalse;
                                   ^ In function ‘void* gvl_ruby_callback(void*)’: error: ‘TerminateExecution’ is not a member of
  ^ error: ‘TerminateExecution’ is not a member of
       ^ In function ‘VALUE rb_context_stop(VALUE)’: error: ‘TerminateExecution’ is not a member of
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’
cc1plus: warning: unrecognized command line option
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1plus: warning: unrecognized command line option ‘-Wno-tautological-compare’
Makefile:209: recipe for target 'mini_racer_extension.o' failed
make: *** [mini_racer_extension.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/mini_racer-0.1.15 for
Results logged to

  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:92:in `run'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:52:in `block in
  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:44:in `each'
  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:44:in `make'
`block in build'
  /usr/local/lib/ruby/2.5.0/tempfile.rb:295:in `open'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:164:in `block (2
levels) in build_extension'
  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:163:in `chdir'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:163:in `block in
  /usr/local/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:201:in `block in
  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/ext/builder.rb:198:in `each'
  /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/installer.rb:309:in `install'
`block in install'
`block in worker_pool'
`block in process_queue'
`block (2 levels) in create_threads'

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

In Gemfile:

We are tracking stable, and it looks like last night’s commit to discourse_docker may break building stable:

If I build with either the previous version of discourse_docker, or with tests-passed the build doesn’t fail.

@alekstrust not sure what branch you’re pointed at, but the above ^ may be related.

Yes, I had to change to tests-passed and build completed successfully :slight_smile:

Thank you everybody.

1 Like

This makes sense, because as the base image gets older it makes more and more requests to RubyGems, presumably for newer versions of outdated dependencies?

Is that the correct way to describe this @tgxworld?

OH I just had this reported here:

Will update stable gemfile lock so this does not happen

EDIT: stable bundles just fine… maybe you are trying to update mini racer somehow…


Yup this is the correct way to describe it. However, the number of requests to RubyGems should be limited right now because I updated the base image for launcher yesterday.


OK correction… now that I see it internally I see what happens.

Base image has libv8 6.7 … so even though the bundle specifies 6.3 somehow bundler is not passing this information to mini_racer…

To save us all heartache I will just backport the mini racer update since the api is stable

EDIT done …


I’m trying to rebuild a two-container install (on tests-passed) and it’s failing on installing the mini-racer Gem.

Do we have a regression here? I did a git pull; does something else need to happen to get the correct image?

Edit: Somehow I’d pinned a particular commit, so I wasn’t getting latest.

Updating mini_racer to 0.2.0 fixes this problem for legacy users (v1.9.7), you can add the attached snippet to your app.yml file and do a sudo /var/discourse/launcher rebuild, that code simply edit via sed the Gemfile.lock to fix the mini_racer version to 0.2.0

        - exec:
            cd: $home/plugins
              - mkdir -p plugins
              - git clone
              - git clone
        # Fix for mini-racer error
        - exec:
            cd: $home
              - sed -i "s/mini_racer .*/mini_racer (0.2.0)/" Gemfile.lock
1 Like

Stable is on mini racer 0.2.0 …

I see no reason you would need to do this.


It is because we are still using the legacy v1.9.7 version because we have a lot of self code not yet migrated to 2.0, waiting a v1.9.8 versión that fixes that dependency for legacy users.