stringi icon indicating copy to clipboard operation
stringi copied to clipboard

unable to install stringi via http_proxy

Open christophergies opened this issue 1 year ago • 1 comments

Hello, I try to install AssetCorr wiche includes stringi via following cmd with a http_proxy:

/usr/bin/Rscript --slave --no-save --no-restore-history -e '
Sys.setenv(http_proxy="http://www-proxy3.XXXX.XXX.de:8080/")
install.packages(pkgs="AssetCorr", repos="http://ftp.fau.de/cran/")'

The called program leads to the following error message:

...
* installing *source* package stringi ...
** package stringi successfully unpacked and MD5 sums checked
** using staged installation
downloading the ICU data library (icudt)
output path: icu69/data/icu4c-69_1-data-bin-l.zip
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'

trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'

icudt download failed
Error: Stopping on error
In addition: Warning messages:
1: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
2: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
Execution halted
ERROR: configuration failed for package stringi
* removing /appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib/stringi
...

Since I can reach the URL with curl through the proxy, I don't understand the cause of the error message.

[radm@blbbdsasinst01 lib]$ curl -x http://www-proxy3.XXXX.XXX.de:8080 -L https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip -vvv > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* About to connect() to proxy www-proxy3.XXXX.XXX.de port 8080 (#0)
*   Trying 192.168.8.160...
* Connected to www-proxy3.XXXX.XXX.de (192.168.8.160) port 8080 (#0)
* Establish HTTP proxy tunnel to raw.githubusercontent.com:443
> CONNECT raw.githubusercontent.com:443 HTTP/1.1
> Host: raw.githubusercontent.com:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=*.github.io,O="GitHub, Inc.",L=San Francisco,ST=California,C=US
*       start date: Mar 18 00:00:00 2022 GMT
*       expire date: Mar 21 23:59:59 2023 GMT
*       common name: *.github.io
*       issuer: CN=DigiCert TLS RSA SHA256 2020 CA1,O=DigiCert Inc,C=US
> GET /gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip HTTP/1.1
> User-Agent: curl/7.29.0
> Host: raw.githubusercontent.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: keep-alive
< Content-Length: 11454999
< Cache-Control: max-age=300
< Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
< Content-Type: application/zip
< ETag: "abf1b6092a6dc67fdca9d1aefae011802d80a043f45ef7be6f92f1234363684f"
< Strict-Transport-Security: max-age=31536000
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< X-GitHub-Request-Id: ABEA:931D:27703A:297577:62F51416
< Accept-Ranges: bytes
< Date: Thu, 11 Aug 2022 15:17:00 GMT
< Via: 1.1 varnish
< X-Served-By: cache-muc13943-MUC
< X-Cache: HIT
< X-Cache-Hits: 0
< X-Timer: S1660231021.835723,VS0,VE0
< Vary: Authorization,Accept-Encoding,Origin
< Access-Control-Allow-Origin: *
< X-Fastly-Request-ID: 1d34be0a6d23628a3aeb200cdc43c7c12e52785f
< Expires: Thu, 11 Aug 2022 15:22:00 GMT
< Source-Age: 98
<
{ [data not shown]
100 10.9M  100 10.9M    0     0  14.4M      0 --:--:-- --:--:-- --:--:-- 14.4M
* Connection #0 to host www-proxy3.XXXX.XXX.de left intact

christophergies avatar Aug 11 '22 15:08 christophergies

How about:

http_proxy="http://www-proxy3.XXXX.XXX.de:8080/" /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages("...")'

?

gagolews avatar Aug 12 '22 01:08 gagolews

unfortunately this leads to the same error. Any other ideas?

[radm@blbbdsasinst01 ~]$ export R_LIBS_USER=/appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib
[radm@blbbdsasinst01 ~]$ export http_proxy="http://www-proxy3.XXXX.XXX.de:8080/"
 
[radm@blbbdsasinst01 ~]$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages(pkgs="stringi", repos="http://ftp.fau.de/cran/")'
Installing package into ‘/appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.fau.de/cran/src/contrib/stringi_1.7.8.tar.gz'
Content type 'application/x-gzip' length 8032287 bytes (7.7 MB)
==================================================
downloaded 7.7 MB
 
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /usr/lib64/R
checking for R... /usr/lib64/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu69/data
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 -std=gnu++11 accepts -g... yes
checking whether the C++ compiler supports the long long type... yes
checking whether the compiler implements namespaces... yes
checking whether the compiler supports the Standard Template Library... yes
checking whether std::map is available... yes
checking for pkg-config... /bin/pkg-config
checking with pkg-config for the system ICU4C... 50.2
checking for ICU4C >= 55... no
*** ICU4C 50.2 has been detected
*** Minimal requirements, i.e., ICU4C >= 55, are not met
*** Trying with 'standard' fallback flags
checking whether an ICU4C-based project can be built... yes
checking programmatically for sufficient U_ICU_VERSION_MAJOR_NUM... no
*** This version of ICU4C cannot be used.
*** Using the ICU 69 bundle.
checking whether we may compile src/icu69/common/putil.cpp... yes
checking whether we may compile src/icu69/i18n/number_affixutils.cpp... yes
checking whether alignof(std::max_align_t) is available... no
checking whether alignof(::max_align_t) is available... yes
checking whether the ICU data library can be downloaded... downloading the ICU data library (icudt)
output path: icu69/data/icu4c-69_1-data-bin-l.zip
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
 
trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
 
icudt download failed
Error: Stopping on error
In addition: Warning messages:
1: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
2: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
Execution halted
*** *********************************************************************
*** stringi cannot be built.
*** Failed to download the ICU data library (icudt). Stopping now.
*** For build environments that have no internet access,
*** see the INSTALL file for a workaround.
*** *********************************************************************
ERROR: configuration failed for package ‘stringi’
* removing ‘/appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib/stringi’
 
The downloaded source packages are in
        ‘/tmp/Rtmpodtjeu/downloaded_packages’
Warning message:
In install.packages(pkgs = "stringi", repos = "http://ftp.fau.de/cran/") :
  installation of package ‘stringi’ had non-zero exit status

christophergies avatar Aug 12 '22 07:08 christophergies

I just recalled that environment variables can be passed to install.packages via configure.vars, so maybe this one:

Rscript --vanilla -e 'install.packages("stringi", configure.vars="http_proxy=\"http://www-proxy3.XXXX.XXX.de:8080/\"")'

gagolews avatar Aug 12 '22 07:08 gagolews

hmmm unfortunately this leads also to the same error. Any other ideas? :-(

I already thought about downloading the file icu4c-69_1-data-bin-l.zip via wget and installing stringi with configure.vars="ICUDT_DIR=<PATH>". However, since it is an automated server installation, I get problems as soon as the URL of the icu4c file changes.

[radm@blbbdsasinst01 lib]$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages(pkgs="stringi", repos="http://ftp.fau.de/cran/", configure.vars="http_proxy=http://www-proxy3.XXXX.XXX.de:8080/")'
Installing package into ‘/appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.fau.de/cran/src/contrib/stringi_1.7.8.tar.gz'
Content type 'application/x-gzip' length 8032287 bytes (7.7 MB)
==================================================
downloaded 7.7 MB

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /usr/lib64/R
checking for R... /usr/lib64/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu69/data
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 -std=gnu++11 accepts -g... yes
checking whether the C++ compiler supports the long long type... yes
checking whether the compiler implements namespaces... yes
checking whether the compiler supports the Standard Template Library... yes
checking whether std::map is available... yes
checking for pkg-config... /bin/pkg-config
checking with pkg-config for the system ICU4C... 50.2
checking for ICU4C >= 55... no
*** ICU4C 50.2 has been detected
*** Minimal requirements, i.e., ICU4C >= 55, are not met
*** Trying with 'standard' fallback flags
checking whether an ICU4C-based project can be built... yes
checking programmatically for sufficient U_ICU_VERSION_MAJOR_NUM... no
*** This version of ICU4C cannot be used.
*** Using the ICU 69 bundle.
checking whether we may compile src/icu69/common/putil.cpp... yes
checking whether we may compile src/icu69/i18n/number_affixutils.cpp... yes
checking whether alignof(std::max_align_t) is available... no
checking whether alignof(::max_align_t) is available... yes
checking whether the ICU data library can be downloaded... downloading the ICU data library (icudt)
output path: icu69/data/icu4c-69_1-data-bin-l.zip
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'

trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'

icudt download failed
Error: Stopping on error
In addition: Warning messages:
1: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
2: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
  URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't resolve host name'
Execution halted
*** *********************************************************************
*** stringi cannot be built.
*** Failed to download the ICU data library (icudt). Stopping now.
*** For build environments that have no internet access,
*** see the INSTALL file for a workaround.
*** *********************************************************************
ERROR: configuration failed for package ‘stringi’
* removing ‘/appdata/r/tmp/ansible.3dmE1Obuild/harvest/lib/stringi’

The downloaded source packages are in
        ‘/tmp/Rtmpukcfro/downloaded_packages’
Warning message:
In install.packages(pkgs = "stringi", repos = "http://ftp.fau.de/cran/",  :
  installation of package ‘stringi’ had non-zero exit status

christophergies avatar Aug 12 '22 08:08 christophergies

I've solved the problem. Within configrre.vars I've to set https_proxy variable instead of http_proxy variable.

[radm@blbbdsasinst01 lib]$ /usr/bin/Rscript --slave --no-save --no-restore-history -e 'install.packages(pkgs="stringi", repos="http://ftp.fau.de/cran/", configure.vars="https_proxy=http://www-proxy3.XXXX.XXX.de:8080/")'

Thanks a lot supporting me!

christophergies avatar Aug 12 '22 08:08 christophergies

Nice, I don't think it's a documented solution even :)

gagolews avatar Aug 12 '22 08:08 gagolews

nice to know: It's not necessary to set https_proxy via configure.vars, it's also possible to export https_proxy to shell context.

christophergies avatar Aug 12 '22 10:08 christophergies