[R-sig-Geo] terra/GDAL error reading file from http inside docker container

Olivier Leroy |eroy@o|| @end|ng |rom gm@||@com
Mon May 30 10:09:56 CEST 2022


Hello,

I had some trouble with the web and docker in my university because we are
still using proxies (it needs to be set up for every image).  It could be
that.

Good luck !


Olivier Leroy

Le lun. 30 mai 2022 à 09:59, Mathias Moser <matmoser using wu.ac.at> a écrit :

> Could be a certificate issue, have you tried replacing https with http in
> your
> link? Or, alternatively set,
>
> > library(terra)
> > setGDALconfig("GDAL_HTTP_UNSAFESSL", "YES")
>
> If that does not help, you could start debugging by enabling verbose curl
> logging,
>
> > setGDALconfig("CPL_CURL_VERBOSE", "YES")
>
>
> A list of other possible options is here [1]. setGDALconfig is however not
> available in the 1.5.21 version you are using, you need to install dev
> version
> first,
>
> > devtools::install_github("rspatial/terra")
>
> Best wishes,
>
> Mathias
>
> [1] https://trac.osgeo.org/gdal/wiki/ConfigOptions
>
>
> On Mon, 2022-05-30 at 16:50 +1000, Roozbeh Valavi wrote:
> > Hi all,
> >
> > I try to read raster files using a URL from within a docker container.
> > I can easily read the same file with terra package from my system (both
> > Windows and Ubuntu), but when try reading the same file within a docker
> > container it runs to an error.
> >
> > *The  R code for reading the raster file hosted on a public AWS S3
> bucket.*
> >
> > terra::rast("
> >
> https://s3-ap-southeast-2.amazonaws.com/silo-open-data/daily/max_temp/2018/20180103.max_temp.tif
> > ")
> >
> > *Error:*
> > Error: [rast] cannot open file:
> >
> https://s3-ap-southeast-2.amazonaws.com/silo-open-data/daily/max_temp/2018/20180103.max_temp.tif
> > In addition: Warning message:
> > An error occurred while creating a virtual connection to the DAP
> > server:Error while reading the URL:
> >
> https://s3-ap-southeast-2.amazonaws.com/silo-open-data/daily/max_temp/2018/20180103.max_temp.tif.ver
> > .
> > The OPeNDAP server returned the following message:
> > Not Found: The data source or server could not be found.
> >         Often this means that the OPeNDAP server is missing or needs
> > attention.
> >         Please contact the server administrator. (GDAL error 1)
> >
> >
> > *System info of docker container:*
> > R version 4.2.0
> > GDAL 3.0.4
> > terra 1.5.21
> > DISTRIB_ID=Ubuntu
> > DISTRIB_RELEASE=20.04
> > DISTRIB_CODENAME=focal
> > DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
> >
> > * libgdal-dev* is installed in the docker container.
> >
> > *System info of my local system:*
> > R version 4.2.0
> > GDAL 3.3.2
> > terra 1.5.21
> > DISTRIB_ID=Ubuntu
> > DISTRIB_RELEASE=20.04
> > DISTRIB_CODENAME=focal
> > DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
> >
> > I appreciate any help.
> >
> > Kind regards,
> > Roozbeh
> >
> > Roozbeh Valavi
> > The Quantitative & Applied Ecology Group <http://qaeco.com/>
> > School of Ecosystem and Forest Sciences,
> > The University of Melbourne, VIC 3010, Australia
> > *Mobile*: +61 423 283 238 | *Twitter*: @ValaviRoozbeh |
> > *Researchgate <https://www.researchgate.net/profile/Roozbeh_Valavi>*
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Olivier Leroy
Docteur Géographie et Environnement
06.18.37.18.08

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list