Gem update bunlder error Errno::ETIMEDOUT: Connection timed out - connect


(bubill) #1

This error cause by network (and not discourse code itself) , because the virtual machine locate china where block good services ,such as visit google.com . and gem update bunlder .

How to fix it?
change what about network configure and how to change it ?

Thanks very much !

# ./launcher bootstrap app
...
...
...
I, [2014-09-11T11:02:49.671886 #48]  INFO -- : > mkdir -p /var/nginx/cache
I, [2014-09-11T11:02:49.690786 #48]  INFO -- : 
I, [2014-09-11T11:02:49.691536 #48]  INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2014-09-11T11:02:49.692930 #48]  INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2014-09-11T11:02:49.694186 #48]  INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2014-09-11T11:02:49.695585 #48]  INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2014-09-11T11:02:49.697104 #48]  INFO -- : > echo "done configuring web"
I, [2014-09-11T11:02:49.715172 #48]  INFO -- : done configuring web

I, [2014-09-11T11:02:49.718860 #48]  INFO -- : > cd /var/www/discourse && gem update bundler
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) (https://api.rubygems.org/specs.4.8.gz)
I, [2014-09-11T11:02:57.880276 #48]  INFO -- : Updating installed gems



FAILED
--------------------
RuntimeError: cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 257 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:85:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "chown -R discourse $home", "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'"]}
f25993019f5aee2c6e1f0bc58adbb6ea10a6ba01982aa9f35fa7a6713f65422a
FAILED TO BOOTSTRAP

What are the contents of the file /etc/apt/sources.list?

# deb http://mirrors.liantuo.com:5588/debian/ wheezy main

deb http://mirrors.sohu.com/debian/ wheezy main non-free contrib
deb-src http://mirrors.sohu.com/debian/ wheezy main non-free contrib

#deb http://security.debian.org/ wheezy/updates main contrib non-free
#deb-src http://security.debian.org/ wheezy/updates main contrib non-free

What are the contents of the folder /etc/apt/sources.list.d/?

root:/var/discourse# cat /etc/apt/sources.list.d
 cat: /etc/apt/sources.list.d: Is a directory

Is it a virtual machine?
A: Yes . It’s a virtual machine !!

Are you renting it from a service provider?
A: Yes . IDC is on the city of beijing in china.


(Erick Guan) #2

It’s a duplication of this topic.

Actually. Just ./launcher ssh app and type bundle config mirror.https://rubygems.org https://ruby.taobao.org/ should work(not tested)

If it was not bootstrapped, firstly I assumed you are using standalone which is using templates/web.template.yml, then open templates/web.template.yml and search sudo -E -u discourse bundle install --deployment --verbose --without test --without development. Insert - su discourse -c 'bundle config mirror.https://rubygems.org https://ruby.taobao.org/' before that line.


(bubill) #3
root:/var/discourse# ./launcher ssh app
WARNING: No memory limit support
WARNING: No swap limit support
No cid found

(bubill) #4

add blow command

- su discourse -c 'bundle config mirror.https://rubygems.org https://ruby.taobao.org/'

and then,
run ./launcher bootstrap app

It works fine !

Thanks very much !!!


(Régis Hanol) #5