[R] R won't connect to the internet on SUSE Linux 8.1

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Tue Jul 29 17:12:20 CEST 2003


Luke, you are an absolute genius.

For anyone who is still interested (and I doubt anyone is ;-) for some reason in SUSE an environment variable "no_proxy" is set to localhost, as described below, and that prevents R from connecting to the internet.

Thank you everyone for your responses

Regards
Mick

-----Original Message-----
From: Luke Tierney [mailto:luke at stat.uiowa.edu]
Sent: 26 July 2003 16:40
To: michael watson (IAH-C)
Cc: 'James MacDonald '; 'R-help at stat.math.ethz.ch '
Subject: RE: [R] R won't connect to the internet on SUSE Linux 8.1


On the SuSE setup I have access to it seems that for whatever reason
the environment variable no_proxy is defined as 'localhost' in the
shell initialization files /etc/SuSEconfig/csh.cshrc and
/etc/SuSEconfig/profile.  This turns use of proxy's off in the R
internals.  See if you have it defined, and if so see if something
like

	(unset no_proxy; R)

in bash or

	(unsetenv no_proxy; R)

in tcsh handles proxies properly; it seems to for me.  When no_proxy
is not defined I get

	> Sys.putenv("http_proxy"="http://foo.bar.com")
	> download.file("http://blah.blah.net/foo.R", "bar.R")
	trying URL `http://blah.blah.net/foo.R'
	unable to resolve 'foo.bar.com'.
	Error in download.file("http://blah.blah.net/foo.R", "bar.R") : 
		cannot open URL `http://blah.blah.net/foo.R'

when proxy's are disabled by no_proxy being defined the "unable to
resolve..."  line is missing.

Best,

luke

On Sat, 26 Jul 2003, michael watson (IAH-C) wrote:

> :-))
> 
> Installing Bioconductor was how it all began, so I ended up doing what you suggested (in fact I downloaded just the packages I needed as in the full tar ball, rhdf5 wouldn't compile, probably as I don't have the right hdf5 installed but thats not a problem).
> 
> BUT it just bugged me that I couldn't get R to work, and unfortunately in my frustration I appear to have upset a few people - for this I deeply apologise.  IT still remains the case that, even with http_proxy set (and HTTP_PROXY set) i get the following results:
> 
> > update.packages()
> doesn't work :-(
> 
> > update.packages(method = "wget")
> works! :-D
> 
> > options(download.file.method = "wget")
> > update.packages()
> works! :-D
> 
> > options(download.file.method = "wget")
> > source("http://www.bioconductor.org/getBioC.R")
> doesn't work :-(
> 
> > download.file("http://www.bioconductor.org/getBioC.R", destfile = getBioC.R, method = "wget")
> > source("getBioC.R")
> > getBioC(method = "wget")
> the first two commands work fine, the last doesn't and bombs out with the usual "can't connect to the internet"
> 
> OK I now have Bioconductor installed by the traditional method of downloading via Netscape and installing .tar.gz's, so I am happy, and for the record I think R is a miraculous piece of software and a testament to the wonders of free, open-source development, as is Bioconductor, both of which make my job, and life, a WHOLE lot easier.  So I thank everyone on this list who has contributed to either or both :-D  But I can't be the only one who wouldn't be curious if the above sequence of events occurred on their system.... ;-)
> 
> Have a good weekend one and all :-D
> 
> M
> 
> 
> -----Original Message-----
> From: James MacDonald
> To: michael.watson at bbsrc.ac.uk; hb at maths.lth.se
> Cc: R-help at stat.math.ethz.ch
> Sent: 25/07/03 16:58
> Subject: RE: [R] R won't connect to the internet on SUSE Linux 8.1
> 
> HTTP_PROXY issues aside, if all you want to do is install Bioconductor,
> simply download the latest bioconductor_xx.tar.gz and use R CMD
> INSTALL.
> 
> Jim
> 
> 
> 
> James W. MacDonald
> Affymetrix and cDNA Microarray Core
> University of Michigan Cancer Center
> 1500 E. Medical Center Drive
> 7410 CCGC
> Ann Arbor MI 48109
> 734-647-5623
> 
> >>> "michael watson (IAH-C)" <michael.watson at bbsrc.ac.uk> 07/25/03
> 07:18AM >>>
> Hi Henrik
> 
> Thanks for your help, I really do appreciate it.
> 
> If I follow your instructions, R returns the value
> http://wwwcache.bbsrc.ac.uk:8080.  That is good and it means that
> indeed my http_proxy environment variable is set.
> 
> I have also added the lines
> 
> http_proxy=http://wwwcache.bbsrc.ac.uk:8080/
> HTTP_PROXY=http://wwwcache.bbsrc.ac.uk:8080/
> 
> both to .Renviron in my home directory, and to /usr/lib/R/etc/Renviron
> and /usr/lib/R/etc/Renviron.site.
> 
> All to no avail... R still doesn't try to connect through my proxy
> server.  
> 
> Please, I genuinely think this is a bug in R 1.7.1 on Suse Linux 8.1.
> 
> NOW, here is a little detail I have just discovered that PROVES my
> proxy is working.  
> 
> If I do:
> 
> update.packages(method="wget")
> 
> then everything works fine.... hmmmm, but I still have a problem as the
> command I really want to run is :
> 
> source("http://wwwbioconductor.org/getBioC.R")
> 
> and source() does not accept an option 'method="wget"'....
> 
> SO... is there a way in R that I can set it up such that ALL internet
> connections from within R use method="wget" ??
> 
> Thanks
> Mick
> 
> -----Original Message-----
> From: Henrik Bengtsson [mailto:hb at maths.lth.se] 
> Sent: 25 July 2003 11:25
> To: 'michael watson (IAH-C)'
> Cc: R-help at stat.math.ethz.ch 
> Subject: RE: [R] R won't connect to the internet on SUSE Linux 8.1
> 
> 
> Could it be that you have redefined the command R in your shell such
> that the http_proxy environment variable is set in one and R is
> running
> in another? (This is just a wild guess and I am myself only running
> WinXP.) What do you get if you do
> 
> % env http_proxy=http://wwwcache.bbsrc.ac.uk:8080/
> % R
> > Sys.getenv("http_proxy")
> 
> Also, have you considered setting http_proxy in ~/.Renviron (see
> ?.Renviron).
> 
> Cheers
> 
> Henrik Bengtsson
> Lund University
> 
> 
> > -----Original Message-----
> > From: r-help-bounces at stat.math.ethz.ch 
> > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of 
> > michael watson (IAH-C)
> > Sent: den 25 juli 2003 10:24
> > To: 'Prof Brian Ripley'
> > Cc: 'R-help at stat.math.ethz.ch' 
> > Subject: [R] R won't connect to the internet on SUSE Linux 8.1
> > 
> > 
> > Hi
> > 
> > Thanks once again for your help, I do appreciate it..... however....
> > 
> > Here is what I get with your test.... (under tcsh - i 
> > normally use bash, but I will keep everything the same)
> > 
> > users/mwatson> env http_proxy=http://wwwcache.bbsrc.ac.uk:8080/ R
> > 
> > >options(internet.info=0)
> > >update.packages()
> > trying URL `http://cran.r-project.org/src/contrib/PACKAGES' 
> > unable to connect to 'cran.r-project.org' on port 80
> > Error in download.file(url = paste(contriburl, "PACKAGES", 
> > sep = "/"), :
> > 	cannot open URL 'http://cran.r-project.org/src/contrib/PACKAGES'
> 
> > 
> > 
> > ... and THATS IT!  I don't get any "Using HTTP proxy ... " 
> > message at all, which appears to suggest that R, under SUSE 
> > Linux 8.1, is NOT PICKING up the http_proxy environment 
> > variable - this isn't something thats wrong with my proxy, 
> > that works with everything else - internet browsers, ftp 
> > clients, wget, instant messenger clients etc etc.  The 
> > problem is R, which isn't picking up that it needs to use the 
> > http_proxy environment variable.  And I apologise for being 
> > blunt, but that is an R problem, not a proxy problem!
> > 
> > Thanks for your help
> > 
> > Mick
> > 
> > 
> > -----Original Message-----
> > From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
> > Sent: 24 July 2003 16:56
> > To: michael watson (IAH-C)
> > Subject: RE: [R] Your proxy seems not to work with R (was R 
> > won't connect to the internet on Linux!)
> > 
> > 
> > When I do (under tcsh)
> > 
> > env http_proxy=http://wwwcache.bbsrc.ac.uk:8080/ R
> > > options(internet.info=0)
> > > update.packages()
> > trying URL `http://cran.r-project.org/src/contrib/PACKAGES' 
> > Using HTTP proxy http://wwwcache.bbsrc.ac.uk:8080 
> > 
> > it tries to connect to your proxy (as it says) and gets no 
> > response, which is not surprising from my site.  If you get 
> > the same, your proxy is probably not behaving in the standard 
> > way (since that has been tested by many users with standard
> proxies).
> > 
> > I've changed the emphasis of the subject line to one I feel is more 
> > equitable: many, many users have counter-evidence to your original 
> > assertion, which was rather arrogant.
> > 
> > On Thu, 24 Jul 2003, michael watson (IAH-C) wrote:
> > 
> > > Hello Professor
> > > 
> > > If you are suggesting that I am simply missing the 
> > "http://" part of 
> > > my cache URL, or that I am missing a trailing "/", then I 
> > pre-empted 
> > > this response and it still doesn't work.
> > 
> > I was suggesting that `simply' you were not reading the documentation
> 
> > correctly. 
> > 
> > > I have tried setting both http_proxy and HTTP_PROXY to all of:
> > 
> > I hope you set to *each* of these.  The first and third are 
> > documented to be incorrect, so using those was perverse.
> > 
> > > wwwcache.bbsrc.ac.uk:8080
> > > http://wwwcache.bbsrc.ac.uk:8080 
> > > wwwcache.bbsrc.ac.uk:8080/
> > > http://wwwcache.bbsrc.ac.uk:8080/ 
> > > 
> > > and I still get the same response - R cannot open the URL.
> > > 
> > > And yes, that is thw right proxy address, I copied it straight from
> 
> > > Netscape on the same computer, and Netscape connects to the 
> > internet 
> > > fine.
> > > 
> > > Thanks
> > > Mick
> > >  
> > > 
> > > -----Original Message-----
> > > From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
> > > Sent: 24 July 2003 13:17
> > > To: michael watson (IAH-C)
> > > Cc: 'R-help at stat.math.ethz.ch '
> > > Subject: Re: [R] R won't connect to the internet on Linux!
> > > 
> > > 
> > > On Thu, 24 Jul 2003, michael watson (IAH-C) wrote:
> > > 
> > > > OK, I really am struggling with this one!  Forgive me if 
> > I am being 
> > > > stupid....
> > > 
> > > > I am running R 1.7.1 on Suse Linux 8.1.  I connect to the 
> > internet 
> > > > through a proxy so I have:
> > > > 
> > > > IAHC-LINUX03:~ # echo $http_proxy
> > > > wwwcache.bbsrc.ac.uk:8080
> > > > IAHC-LINUX03:~ # echo $HTTP_PROXY
> > > > wwwcache.bbsrc.ac.uk:8080
> > > > 
> > > > just in case ;-)
> > > > 
> > > > SO, i go into R and I get:
> > > > 
> > > > > source("http://www.bioconductor.org/getBioC.R")
> > > > unable to connect to 'www.bioconductor.org' on port 80. Error in
> 
> > > > file(file, "r") : cannot open URL 
> > > > `http://www.bioconductor.org/getBioC.R' 
> > > > 
> > > > OK so is R just not picking up my proxy setting?
> > > 
> > > Your setting is wrong, so it is being ignored.  The help page says
> 
> > > quite explicitly
> > > 
> > >       The form of `"http_proxy"' should be 
> > `"http://proxy.dom.com/"' or
> > >      `"http://proxy.dom.com:8080/"' where the port defaults 
> > to `80' and
> > >      the trailing slash may be omitted.
> > > 
> > > > It seems to be trying
> > > > port 80 on something, and I have specifically set it to 
> > port 8080 in 
> > > > my environment variables.  As far as I can see I have 
> > followed the 
> > > > reference manual suggestion, so does anyone else have one?
> > > 
> > > The problem is in your seeing, it seems.
> > > 
> > > 
> > 
> > -- 
> > Brian D. Ripley,                  ripley at stats.ox.ac.uk 
> > Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> 
> > University of Oxford,             Tel:  +44 1865 272861 (self)
> > 1 South Parks Road,                     +44 1865 272866 (PA)
> > Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> > 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list 
> > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> > 
> > 
> >
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Luke Tierney
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
   Actuarial Science
241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu




More information about the R-help mailing list