Skip to content

gem install fails behind firewall #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
coldnebo opened this issue Feb 15, 2017 · 7 comments
Closed

gem install fails behind firewall #340

coldnebo opened this issue Feb 15, 2017 · 7 comments

Comments

@coldnebo
Copy link

In a docker context and from a machine behind a firewall that restricts traffic to a gem proxy server and doesn't allow any other outbound requests, I see the failure below in the install logs.

I think what is going on is that if tiny_tds doesn't find freetds dev headers (and of course the lib) installed, it will attempt to fetch FreeTDS source (or binary?) and build/install it in the gem subdir. If so, then the reason I see an ECONNRESET is because the outbound request for FreeTDS source/binary is being blocked by the firewall.

What do you think?

If so, the only fix I could suggest would be trapping the lowlevel failure to fetch and raising a clearer error: "Couldn't retrieve FreeTDS source/binary. You must install FreeTDS manually before continuing and use the --with-freetds-{dir,include,bin} options" (whatever the syntax actually is).

Thanks!


    /usr/local/bin/ruby extconf.rb
extconf.rb:14: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... yes
checking for dbanydatecrack() in -lsybdb... no
*** 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:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/bin/ruby
	--help
	--enable-lookup
	--disable-lookup
	--with-freetds-dir
	--without-freetds-dir
	--with-freetds-include
	--without-freetds-include=${freetds-dir}/include
	--with-freetds-lib
	--without-freetds-lib=${freetds-dir}/lib
	--with-sybdblib
	--without-sybdblib
	--with-sybdblib
	--without-sybdblib
	--enable-system-freetds
	--disable-system-freetds
	--enable-system-iconv
	--disable-system-iconv
	--enable-system-openssl
	--disable-system-openssl
	--enable-gnutls
	--disable-gnutls
	--enable-openssl
	--disable-openssl
/usr/local/lib/ruby/2.1.0/net/protocol.rb:153:in `read_nonblock': Connection
reset by peer (Errno::ECONNRESET)
	from /usr/local/lib/ruby/2.1.0/net/protocol.rb:153:in `rbuf_fill'
	from /usr/local/lib/ruby/2.1.0/net/protocol.rb:134:in `readuntil'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:1111:in `readline'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:290:in `getline'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:301:in `getmultiline'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:319:in `getresp'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:339:in `voidresp'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:249:in `block in connect'
	from /usr/local/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
	from /usr/local/lib/ruby/2.1.0/net/ftp.rb:247:in `connect'
	from /usr/local/lib/ruby/2.1.0/open-uri.rb:762:in `buffer_open'
	from /usr/local/lib/ruby/2.1.0/open-uri.rb:210:in `block in open_loop'
	from /usr/local/lib/ruby/2.1.0/open-uri.rb:208:in `catch'
	from /usr/local/lib/ruby/2.1.0/open-uri.rb:208:in `open_loop'
	from /usr/local/lib/ruby/2.1.0/open-uri.rb:149:in `open_uri'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:479:in
`block in download_file_ftp'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:491:in
`with_tempfile'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:460:in
`download_file_ftp'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:399:in
`download_file'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:50:in
`block in download'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in
`each'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:49:in
`download'
from
/usr/local/lib/ruby/gems/2.1.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:146:in
`cook'
	from extconf.rb:128:in `block in cook_and_activate'
	from extconf.rb:120:in `block in chdir_for_build'
	from extconf.rb:119:in `chdir'
	from extconf.rb:119:in `chdir_for_build'
	from extconf.rb:127:in `cook_and_activate'
	from extconf.rb:335:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/usr/local/lib/ruby/gems/2.1.0/gems/tiny_tds-1.1.0 for inspection.
Results logged to
/usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/tiny_tds-1.1.0/gem_make.out

An error occurred while installing tiny_tds (1.1.0), and Bundler cannot
continue.
Make sure that `gem install tiny_tds -v '1.1.0'` succeeds before bundling.```
@garethcokell
Copy link

I'm seeing the same issue, but not behind a firewall. Looks like the issue may be that the install is trying to download ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.tar.bz2, but ftp.freetds.org appears to be down currently.

@liquid1982
Copy link

Same issue here

@coderjoe
Copy link
Contributor

This is correct the failure above is because ftp.freetds.org is down. That problem can be tracked here: FreeTDS/freetds#101 (for lack of a better place).

If it doesn't come back reasonably soon maybe we'll have to see if we can fetch source versions from their github repo.

@ticktricktrack
Copy link

ticktricktrack commented Feb 16, 2017

You can use gem 'tiny_tds', git: 'https://github.com/ticktricktrack/tiny_tds.git', ref: 'd42287e5' now, I've hardcoded the fossies url instead of the ftp server.

@taganaka
Copy link

In the meanwhile looks like the vendor's ftp server is back

@coldnebo
Copy link
Author

Ah, thanks! I never thought to check the actual download url being up. 😅

@coldnebo
Copy link
Author

I'll go ahead and close this since I agree with @coderjoe that the original error was correct. I think the issue of alternate source is probably orthogonal, but feel free to reopen if you think there's another thing to fix here.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants