Server in China can't reach rubygems.org so install fails

Install being given today
FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c ‘bundle install --deployment --verbose --without test --without development’ failed with return #<Process::Status: pid 343 exit 7>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn’
exec failed with the params {“cd”=>"$home", “hook”=>“bundle_exec”, “cmd”=>[“su discourse -c ‘bundle install --deployment --verbose --without test --without development’”, “su discourse -c ‘bundle exec rake db:migrate’”, “su discourse -c ‘bundle exec rake assets:precompile’”]}
b9d7f127683db22ead5399eb31aebf6d505c0e092514327234ff3e9f2ba82a19
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Mmmhmm… and what do the earlier error messages look like?

1 Like

That’s all the error log

No previous problems, is today updated a bit, then can not rebuild or install

What are your hosting specs? how much memory?

1 Like

CPU: 2 nuclear
Memory: 4096 MB

1 Like

There is an error message on the front

HTTP 200 OK
Query List: []
Could not find email_reply_trimmer-0.0.6 in any of the sources

it will help if we can see the full log.

1 Like
HTTP 200 OK
Query List: []
Could not find email_reply_trimmer-0.0.6 in any of the sources

I, [2016-02-10T11:52:36.804974 #38]  INFO -- : Terminating async processes
I, [2016-02-10T11:52:36.805054 #38]  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/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 108
I, [2016-02-10T11:52:36.805132 #38]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 236
2016-02-10 11:52:36 UTC [108-2] LOG:  received fast shutdown request
2016-02-10 11:52:36 UTC [108-3] LOG:  aborting any active transactions
2016-02-10 11:52:36 UTC [115-2] LOG:  autovacuum launcher shutting down
2016-02-10 11:52:36 UTC [112-1] LOG:  shutting down
236:signal-handler (1455105156) Received SIGTERM scheduling shutdown...
236:M 10 Feb 11:52:36.881 # User requested shutdown...
236:M 10 Feb 11:52:36.882 * Saving the final RDB snapshot before exiting.
236:M 10 Feb 11:52:36.886 * DB saved on disk
236:M 10 Feb 11:52:36.886 # Redis is now ready to exit, bye bye...
2016-02-10 11:52:36 UTC [112-2] LOG:  database system is shut down

What happens when you run “gem install email_reply_trimmer” from inside the container?

1 Like
An error occurred while installing email_reply_trimmer (0.0.6), and Bundler
cannot continue.
Make sure that `gem install email_reply_trimmer -v '0.0.6'` succeeds before
bundling.

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development' failed with return #<Process::Status: pid 296 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
d1702bba1d88ff0da3097b76755409118974ef56618dbf4673348d5a6e812967
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

What happens when you run “gem install email_reply_trimmer -v '0.0.6'” then?

1 Like
I, [2016-02-10T16:32:05.094803 #38]  INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps

I, [2016-02-10T16:32:05.104034 #38]  INFO -- : File > /usr/local/bin/discourse  chmod: +x
I, [2016-02-10T16:32:05.110299 #38]  INFO -- : File > /usr/local/bin/rails  chmod: +x
I, [2016-02-10T16:32:05.116701 #38]  INFO -- : File > /usr/local/bin/rake  chmod: +x
I, [2016-02-10T16:32:05.122977 #38]  INFO -- : File > /etc/update-motd.d/10-web  chmod: +x
I, [2016-02-10T16:32:05.126559 #38]  INFO -- : File > /etc/logrotate.d/rails  chmod: 
I, [2016-02-10T16:32:05.130444 #38]  INFO -- : File > /etc/logrotate.d/nginx  chmod: 
I, [2016-02-10T16:32:05.137048 #38]  INFO -- : File > /etc/runit/1.d/00-ensure-links  chmod: +x
I, [2016-02-10T16:32:05.138040 #38]  INFO -- : Replacing (?-mix:server.+{) with limit_req_zone $binary_remote_addr zone=flood:10m rate=$reqs_per_secondr/s;
limit_req_zone $binary_remote_addr zone=bot:10m rate=$reqs_per_minuter/m;
limit_req_status 429;
server {
 in /etc/nginx/conf.d/discourse.conf
I, [2016-02-10T16:32:05.138665 #38]  INFO -- : Replacing (?-mix:location @discourse {) with location @discourse {
  limit_req zone=flood burst=$burst_per_second nodelay;
  limit_req zone=bot burst=$burst_per_minute nodelay; in /etc/nginx/conf.d/discourse.conf
I, [2016-02-10T16:32:05.139954 #38]  INFO -- : > echo "Beginning of custom commands"
I, [2016-02-10T16:32:05.142535 #38]  INFO -- : Beginning of custom commands

I, [2016-02-10T16:32:05.143269 #38]  INFO -- : > echo "End of custom commands"
I, [2016-02-10T16:32:05.145816 #38]  INFO -- : End of custom commands

I, [2016-02-10T16:32:05.146430 #38]  INFO -- : > awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'
awk: fatal: cannot open file `/root/.ssh/authorized_keys' for reading (No such file or directory)
I, [2016-02-10T16:32:05.152361 #38]  INFO -- : Authorized SSH keys for this container:

I, [2016-02-10T16:32:05.152624 #38]  INFO -- : Terminating async processes
I, [2016-02-10T16:32:05.152758 #38]  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/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 67
I, [2016-02-10T16:32:05.152857 #38]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 196
2016-02-10 16:32:05 UTC [67-2] LOG:  received fast shutdown request
2016-02-10 16:32:05 UTC [67-3] LOG:  aborting any active transactions
2016-02-10 16:32:05 UTC [74-2] LOG:  autovacuum launcher shutting down
196:signal-handler (1455121925) Received SIGTERM scheduling shutdown...
2016-02-10 16:32:05 UTC [71-1] LOG:  shutting down
196:M 10 Feb 16:32:05.208 # User requested shutdown...
196:M 10 Feb 16:32:05.208 * Saving the final RDB snapshot before exiting.
196:M 10 Feb 16:32:05.213 * DB saved on disk
196:M 10 Feb 16:32:05.213 # Redis is now ready to exit, bye bye...
2016-02-10 16:32:05 UTC [71-2] LOG:  database system is shut down
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
An error occurred while installing omniauth-google-oauth2 (0.3.1), and Bundler
cannot continue.
Make sure that `gem install omniauth-google-oauth2 -v '0.3.1'` succeeds before
bundling.

Ok so it’s not related to that specific gem. Where is your server located? Is it in China by any chances? Seems like it’s having issues connecting to rubygems.org

2 Likes

in China :slightly_smiling:

1 Like

That’s interesting. I guess traffic has been blocked from the whole country to rubygems? It would seem using a proxy is the solution.

When on china you need to use:

source https://ruby.taobao.org/

instead of

source https://rubygems.org/

in your Gemfile.

PS.: I’m never been to China but read about this on StackOverflow.

9 Likes

This topic was automatically closed after 3041 days. New replies are no longer allowed.