R-ArcGIS / r-bridge-install

Install the R ArcGIS Tools
Apache License 2.0
188 stars 59 forks source link

Loading Arcgisbinding Issue #112

Closed Aspkin closed 1 year ago

Aspkin commented 1 year ago

Hi,

I am trying to get R-ArcGIS Bridge up and running but whenever I try load the 'arcgisbinding' package in R, I receive this error:

> library(arcgisbinding) Error: package or namespace load failed for ‘arcgisbinding’: package ‘arcgisbinding’ was installed before R 4.0.0: please re-install it

I am running ArcGIS Pro 3.0.2 and R 4.2.2 on a company computer. I have successfully installed the most recent 'arcgisbinding_1.0.1.244' package into R but just cannot seem to load it in. The following screenshot confirms that the package is installed in ArcGIS Pro but I also get the following error when I attempt to check package for updates:

InkedR-Arc Bridge Issue

I have browsed everywhere online for a solution to this but cannot seem to find anything. Any guidance on this issue would be much appreciated.

scdub commented 1 year ago

Can you provide the output of .libPaths() and SessionInfo() from R? It looks like perhaps the library locations are talking across versions and it is finding an older version of the arcgisbinding package elsewhere. I was able to resolve that URL, but we have had some intermittent reports of it not working, the site is actually backed by GitHub and it isn't clear the nature of the issue. You can try manually updating the package by starting an R session and running:

install.packages("arcgisbinding", repos="https://r.esri.com", type="win.binary")
Aspkin commented 1 year ago

Thanks for getting back to me @scdub, the outputs are below:

> .libPaths()

[1] "C:/Users/Aspkin/AppData/Local/R/win-library/4.2" "C:/Program Files/R/R-4.2.2/library"
> sessionInfo()

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.2 cli_3.4.1      tools_4.2.2

And when running the manual update code you provided, I receive the following error:

> install.packages("arcgisbinding", repos="https://r.esri.com", type="win.binary")

Installing package into ‘C:/Users/Aspkin/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository https://r.esri.com/bin/windows/contrib/4.2:
  cannot open URL 'https://r.esri.com/bin/windows/contrib/4.2/PACKAGES'
Warning in install.packages :
  package ‘arcgisbinding’ is not available as a binary package for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

These are also the only versions of R, Arcgis Pro and arcgisbinding I have installed on my computer.

scdub commented 1 year ago

OK, thanks for the details. It looks like the URL isn't being accessed correctly. It could be an R issue, something network related, or something with our redirects. Can you see if running this command downloads the package?

download.file("https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip", "arcgisbinding_1.0.1.300.zip")

Then getwd() to see where it was written (most likely into your %USERPROFILE%). If that also fails, can you try downloading https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip via your browser to see if that works? Once you have the package locally, you can use Packages > Install Packages from Local Files in default R or Tools > Install Packages > select Install From "Package Archive File" in RStudio.

Aspkin commented 1 year ago

Using the command returns this error which I suspect may be a company network issue:

> download.file("https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip", "arcgisbinding_1.0.1.300.zip")
trying URL 'https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip'
Error in download.file("https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip",  : 
  cannot open URL 'https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip'
In addition: Warning message:
In download.file("https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip",  :
  URL 'https://r.esri.com/bin/windows/contrib/4.2/arcgisbinding_1.0.1.300.zip': status was 'SSL connect error'

But it looks like I have managed to install and load the package using the download link instead and there are no issues with the working directory, output below:

> library(arcgisbinding)
> arc.check_product()
product: ArcGIS Pro (13.0.2.36056)
license: Advanced
version: 1.0.1.300 
> getwd()
[1] "C:/Users/Aspkin/Downloads/Stats"

If you don't mind me asking, is arcgisbinding 1.0.1.300 an unreleased version? Because previously, 1.0.1.244 was the most recent version I could find online.

scdub commented 1 year ago

OK, I think the SSL connect error is informative and means that R / Pro are connecting to the site correctly but having issues with TLS, but that is working fine from your browser. It may be related to configuration settings on secure sites within your organization, typically there is some difference between browsers and external clients. I'm glad we found a work around and can look further in terms of why it might be failing. For the package version, we released v300 in June of this year and it is public.

Aspkin commented 1 year ago

Amazing, thanks for all your help and enjoy the rest of your year :)