Page 1 of 1

Error downloading CyAN data through R httr::GET

Posted: Tue Apr 25, 2023 6:57 pm America/New_York
by meg_amanatides
I am attempting to download CyAN data through R, following guidance posted here: https://wiki.earthdata.nasa.gov/display/EL/How+to+access+data+with+R.

The URL for the file I'm requesting is https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif. In R, I can run the following code with no error in R itself. However, the file it downloads is not the expected GeoTIFF, but instead a HTML that reads: ".:. ERROR .:. Ocean Biology Distributed Active Archive Center (OB.DAAC)
We are sorry, but an error has occurred. Please use the back button to return to the previous page".

R code (with "APPKEY" inserted instead of my actual application key):

set_config(config(followlocation=1,netrc=1,netrc_file=netrc_path,cookie=cookie_path,cookiefile=cookie_path,cookiejar=cookie_path))
httr::GET(url = 'https://oceandata.sci.gsfc.nasa.gov/ob/getfile/L2022001.L3m_DAY_CYAN_CI_cyano_CYAN_CONUS_300m_1_1.tif?appkey=[APPKEY]',
write_disk("C:/Users/Megan.Coffer/Downloads/test.tif", overwrite = TRUE))

Any guidance on what might be causing this error? I saw one other forum post with the same error, but the fix was a different URL which I don't know how to generate for this specific data.

Re: Error downloading CyAN data through R httr::GET

Posted: Wed May 03, 2023 2:05 pm America/New_York
by OB General Science - guoqingw
Hello,

We recently fixed a data access issue. Please try again and let us know if the problem persists.

Re: Error downloading CyAN data through R httr::GET

Posted: Wed May 03, 2023 4:32 pm America/New_York
by meg_amanatides
Thanks so much! Yes, it's working for me now.