error: Cannot open cookies file
-
- Posts: 2
- Joined: Sun Dec 03, 2023 3:41 pm America/New_York
error: Cannot open cookies file
I am trying to download the products Tair_f_inst and Rainf_f_tavg of GLDAS (3/12/2023 4:15 EST). First, I downloaded a link list using the Data Access option (Subset/Get Data) of Giovanni. I get the name of the files to save in my computer from the list (subset_GLDAS_NOAH025_M_2.1_20231203_200550_.csv). I am using the wget method to download the files and include the next line for extra argument of download.file function, extra = paste('--load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies --user=', NASA_user, ' --password=', NASA_pw, ' --content-disposition', sep = "")
However, I get the next error: Cannot open cookies file '~/.urs_cookies': No such file or directory
Error in download.file(url = url, destfile = paste(save_directory_path, :
'wget' call had nonzero exit status
Here is my code in R, and I am using R-4.0.5 with Windows 11
NASA_user <- 'xxx'
NASA_pw <- 'yyy'
list = read.csv("D:/clases/UDES/scripts/nasa/script_month/subset_GLDAS_NOAH025_M_2.1_20231203_200550_.csv", sep=",", header=FALSE, stringsAsFactors=FALSE)
directory_save <- "D:/clases/UDES/scripts/nasa/"
first_position_name_list = 144
last_position_name_list = 157
save_directory_path <- directory_save
x <- length(list[,1])
name<- c(1:x)
for(i in (1:x)){
url = list[i,1]
name[i] <- substr(list[i,1], first_position_name_list, last_position_name_list)
download.file(url = url,
destfile = paste(save_directory_path, name[i] , sep = ""),
method = 'wget',
extra = paste('--load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies --user=', NASA_user, ' --password=', NASA_pw, ' --content-disposition', sep = ""))
}
Here is the head of the list:
1 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200701.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200701.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
2 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200702.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200702.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
3 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200703.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200703.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
4 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200704.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200704.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
5 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200705.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200705.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
6 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200706.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200706.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
However, I get the next error: Cannot open cookies file '~/.urs_cookies': No such file or directory
Error in download.file(url = url, destfile = paste(save_directory_path, :
'wget' call had nonzero exit status
Here is my code in R, and I am using R-4.0.5 with Windows 11
NASA_user <- 'xxx'
NASA_pw <- 'yyy'
list = read.csv("D:/clases/UDES/scripts/nasa/script_month/subset_GLDAS_NOAH025_M_2.1_20231203_200550_.csv", sep=",", header=FALSE, stringsAsFactors=FALSE)
directory_save <- "D:/clases/UDES/scripts/nasa/"
first_position_name_list = 144
last_position_name_list = 157
save_directory_path <- directory_save
x <- length(list[,1])
name<- c(1:x)
for(i in (1:x)){
url = list[i,1]
name[i] <- substr(list[i,1], first_position_name_list, last_position_name_list)
download.file(url = url,
destfile = paste(save_directory_path, name[i] , sep = ""),
method = 'wget',
extra = paste('--load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies --user=', NASA_user, ' --password=', NASA_pw, ' --content-disposition', sep = ""))
}
Here is the head of the list:
1 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200701.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200701.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
2 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200702.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200702.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
3 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200703.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200703.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
4 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200704.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200704.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
5 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200705.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200705.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
6 https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2FGLDAS%2FGLDAS_NOAH025_M.2.1%2F2007%2FGLDAS_NOAH025_M.A200706.021.nc4&FORMAT=bmV0Q0RGLw&VARIABLES=Rainf_f_tavg%2CTair_f_inst&SERVICE=L34RS_LDAS&LABEL=GLDAS_NOAH025_M.A200706.021.nc4.SUB.netCDF&VERSION=1.02&DATASET_VERSION=2.1&SHORTNAME=GLDAS_NOAH025_M&BBOX=-6.224%2C-82.441%2C14.87%2C-65.742
Tags:
-
- User Services
- Posts: 198
- Joined: Wed Sep 25, 2019 9:35 am America/New_York
- Been thanked: 1 time
Re: error: Cannot open cookies file
Hello,
Our GLDAS data and subject matter experts will examine your question and formulate a reply shortly.
Top
Our GLDAS data and subject matter experts will examine your question and formulate a reply shortly.
Top
-
- User Services
- Posts: 198
- Joined: Wed Sep 25, 2019 9:35 am America/New_York
- Been thanked: 1 time
Re: error: Cannot open cookies file
The error you reported has now been resolved. Please try your request again and let us know if you have questions.
Best Regards,
Best Regards,
-
- Posts: 2
- Joined: Sun Dec 03, 2023 3:41 pm America/New_York
Re: error: Cannot open cookies file
Hello,
Unfortunately, I get the same error (Error in download.file(url = url, destfile = paste(save_directory_path, :
'wget' call had nonzero exit status) when I try to download the files using the script I shared with you. Previously, I did not tell you that I am using wget version 1.19.4.
I appreciate it a lot if you could help me to solve the problem.
Best regards,
Juan
Unfortunately, I get the same error (Error in download.file(url = url, destfile = paste(save_directory_path, :
'wget' call had nonzero exit status) when I try to download the files using the script I shared with you. Previously, I did not tell you that I am using wget version 1.19.4.
I appreciate it a lot if you could help me to solve the problem.
Best regards,
Juan
-
- User Services
- Posts: 198
- Joined: Wed Sep 25, 2019 9:35 am America/New_York
- Been thanked: 1 time
Re: error: Cannot open cookies file
Please resubmit your request to Data Access option (Subset/Get Data) for an
updated link list and try downloading the files with your script again. Let us
know if you have additional questions.
updated link list and try downloading the files with your script again. Let us
know if you have additional questions.