Skip to content
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

error in noaa_stageX functions #16

Closed
jmzobitz opened this issue May 14, 2024 · 6 comments
Closed

error in noaa_stageX functions #16

jmzobitz opened this issue May 14, 2024 · 6 comments

Comments

@jmzobitz
Copy link

running
weather <- noaa_stage1()

I get the following error message:
Error in (function (anonymous, access_key, secret_key, session_token, : Cannot call fs___S3FileSystem__create(). See https://arrow.apache.org/docs/r/articles/install.html for help installing Arrow C++ libraries.

relevant R versions:

  • R version 4.4
  • arrow version 15.0.1

Searching the web for help wasn't useful - I don't know if this is related to my local install.

Thanks for any insight!

@cboettig
Copy link
Collaborator

@jmzobitz thanks for the report! Looks like your local install of arrow was built without support for S3. Did the instructions linked in the error message above (https://arrow.apache.org/docs/r/articles/install.html) provide any help?

Can you let us know the output of sessionInfo()?

@jmzobitz
Copy link
Author

jmzobitz commented May 15, 2024 via email

@cboettig
Copy link
Collaborator

@jmzobitz interesting! Support for Mac's arm based chips has been tricky historically, but CRAN should have Mac arm binaries available that should have support for S3 built in. However, sometimes things still go pear-shaped, especially so soon after the annual release of the new version of R last month.

Did you install arrow using install.packages() ? Can you try reinstalling with that? Note that if asked if you want to install from source (it will sometimes say something about a newer version being available from source), make sure you choose the answer "no". (This message is meaningless to many users, who figure the safe choice is "yes" -- poor UI design! building from source requires you have all the libraries installed).

Can you also just double-check that in your current setup, S3 is not present by confirming that the following returns FALSE:

arrow::arrow_with_s3()

@jmzobitz
Copy link
Author

jmzobitz commented May 15, 2024 via email

@cboettig
Copy link
Collaborator

@jmzobitz right, sorry I didn't word that well. By 'answer "no"' to install from source I meant that you do want to install the prebuilt binary directly from CRAN, which should have S3 support built in.

I think the install from source is the reason you don't have s3 support. building arrow from source with support for all the options is rather complex, as detailed in the docs. https://arrow.apache.org/docs/r/articles/install.html#dependencies-for-s3-and-gcs-support. much easier to install the prebuilt binary.

@jmzobitz
Copy link
Author

Finally found success! 🎉

Thanks for helping me (1) understand the error message (especially since my error message was outside of the package) and (2) pointing me to helpful resources. For posterity, I am going to record the steps that worked in case others have similar issues (working on a Macbook M2 chip). Happy to make additional edits if these aren't correct or delete if way off topic.

Homerew

  • Install homebrew
  • In a terminal window, install curl, cmake, and openssl (brew install curl cmake openssl) LINK

Path correction

Homebrew installed some packages not in the main path, so I had to edit my ~/.zshrc file:

  • export PATH="/opt/homebrew/bin:$PATH"
  • export PATH="/opt/homebrew/opt/curl/bin:$PATH"
  • export PATH="/opt/homebrew/opt/openssl/bin:$PATH"
  • Determine where openssl is saved: echo $(brew --prefix openssl) yielded /opt/homebrew/opt/openssl@3
  • From there, create and edit an .R file so R can locate where openssl and libcurl are located:
  • In a terminal: mkdir -p ~/.R (to make the .R directory)
  • create the file with touch ~/.R/Makevars
  • In the terminal add the correct path with echo LDFLAGS=-L/usr/local/opt/openssl@3/lib > ~/.R/Makevars && echo CPPFLAGS=-I/usr/local/opt/openssl@3/include >> ~/.R/Makevars

Install arrow from source in R:

  • Make sure when arrow is installed it builds support for AWS S3: Sys.setenv("ARROW_S3"="ON")
  • Determine the location of the source package on CRAN:
  • packageurl <- "https://cran.r-project.org/src/contrib/arrow_15.0.1.tar.gz"
  • Install the package: install.packages(packageurl, repos=NULL, type="source")

Installation took a while, but was successful when done!

Thanks again,
John

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

2 participants