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

Database not found #18

Closed
ptpell77 opened this issue Jun 3, 2021 · 16 comments
Closed

Database not found #18

ptpell77 opened this issue Jun 3, 2021 · 16 comments

Comments

@ptpell77
Copy link

ptpell77 commented Jun 3, 2021

I'm having trouble pulling data using the wind.dl command. R v. 4.0.2 and rWInd

Getting the following error after it starts the process.

ERROR: database not found. Please, check server
connection, date or geographical ranges
Error in .f(yyyy = .l[[1L]][[i]], mm = .l[[2L]][[i]], dd = .l[[3L]][[i]], :
object 'tmp' not found

@jabiologo
Copy link
Owner

Hi @ptpell77 , could you provide an example code?

@ptpell77
Copy link
Author

ptpell77 commented Jun 3, 2021

times <- expand.grid(yyyy = 2015, mm = 1:12, dd = c(1, 15), tt = 12)
wd <- pmap(times, wind.dl, lon1 = -120, lon2 = -90, lat1 = 30, lat2 = 50)

@jabiologo
Copy link
Owner

hi @ptpell77 ;

I've just run your code and everything was well; Sometimes the server is down and it comes back in some hours (or days). Please, run it again and let me know. Thanks

times <- expand.grid(yyyy = 2015, mm = 1:12, dd = c(1, 15), tt = 12)
library(rWind)
wd <- pmap(times, wind.dl, lon1 = -120, lon2 = -90, lat1 = 30, lat2 = 50)
[1] "2015-01-01"
[1] "2015-01-01 12:00:00 downloading..."
[1] "2015-02-01"
[1] "2015-02-01 12:00:00 downloading..."
[1] "2015-03-01"
[1] "2015-03-01 12:00:00 downloading..."
[1] "2015-04-01"
[1] "2015-04-01 12:00:00 downloading..."
[1] "2015-05-01"
[1] "2015-05-01 12:00:00 downloading..."
[1] "2015-06-01"
[1] "2015-06-01 12:00:00 downloading..."
[1] "2015-07-01"
[1] "2015-07-01 12:00:00 downloading..."
[1] "2015-08-01"
[1] "2015-08-01 12:00:00 downloading..."
[1] "2015-09-01"
[1] "2015-09-01 12:00:00 downloading..."
[1] "2015-10-01"
[1] "2015-10-01 12:00:00 downloading..."
[1] "2015-11-01"
[1] "2015-11-01 12:00:00 downloading..."
[1] "2015-12-01"
[1] "2015-12-01 12:00:00 downloading..."
[1] "2015-01-15"
[1] "2015-01-15 12:00:00 downloading..."
[1] "2015-02-15"
[1] "2015-02-15 12:00:00 downloading..."
[1] "2015-03-15"
[1] "2015-03-15 12:00:00 downloading..."
[1] "2015-04-15"
[1] "2015-04-15 12:00:00 downloading..."
[1] "2015-05-15"
[1] "2015-05-15 12:00:00 downloading..."
[1] "2015-06-15"
[1] "2015-06-15 12:00:00 downloading..."
[1] "2015-07-15"
[1] "2015-07-15 12:00:00 downloading..."
[1] "2015-08-15"
[1] "2015-08-15 12:00:00 downloading..."
[1] "2015-09-15"
[1] "2015-09-15 12:00:00 downloading..."
[1] "2015-10-15"
[1] "2015-10-15 12:00:00 downloading..."
[1] "2015-11-15"
[1] "2015-11-15 12:00:00 downloading..."
[1] "2015-12-15"
[1] "2015-12-15 12:00:00 downloading..."

@ptpell77
Copy link
Author

ptpell77 commented Jun 4, 2021

For whatever reason, I am not able to connect on my local wifi. I will try with a VPN or other network. Thanks!

@ptpell77 ptpell77 closed this as completed Jun 4, 2021
@ptpell77
Copy link
Author

ptpell77 commented Jun 7, 2021

I'm still unable to connect and download data, even on a different wifi network. Do you have any suggestions? Thanks and sorry for the trouble.

@ptpell77 ptpell77 reopened this Jun 8, 2021
@ptpell77
Copy link
Author

ptpell77 commented Jun 8, 2021

I have tried this on several other systems, including a computing cluster, getting the same errror: >

library(rWind)
times <- expand.grid(yyyy = 2015, mm = 1:12, dd = c(1, 12), tt = 12)
wd <- pmap(times, wind.dl, lon1 = -120, lon2 = -90, lat1 = 30, lat2 = 50)
[1] "2015-01-01"
[1] "2015-01-01 12:00:00 downloading..."
ERROR: database not found. Please, check server
connection, date or geographical ranges
Error in .f(yyyy = .l[[1L]][[i]], mm = .l[[2L]][[i]], dd = .l[[3L]][[i]], :
object 'tmp' not found

@ptpell77
Copy link
Author

I have replicated this issue on several other servers and R platforms.
Linux, R 3.6.0, successful
Linux, R 4.0.2, failed
Mac, R 4.0.5, successful
Mac, R.4.1.0, failed

@jabiologo
Copy link
Owner

Hi @ptpell77 , can you print your sessionInfo() ?

I'm in a Linux machine using R 4.1.0, which is the the latest release (2021-05-18). Could you update your R version?

@ptpell77
Copy link
Author

R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] rWind_1.1.6 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.6 purrr_0.3.4 readr_1.4.0 tidyr_1.1.3 tibble_3.1.2 ggplot2_3.3.3
[10] tidyverse_1.3.1 gdistance_1.3-6 Matrix_1.3-3 igraph_1.2.6 raster_3.4-10 sp_1.4-5

@jabiologo
Copy link
Owner

Could you please let me know the result of:

wind.dl(2015,2,12,0,-10,5,35,45)

@ptpell77
Copy link
Author

wind.dl(2015,2,12,0,-10,5,35,45)
[1] "2015-02-12"
[1] "2015-02-12 downloading..."
ERROR: database not found. Please, check server
connection, date or geographical ranges
Error in wind.dl(2015, 2, 12, 0, -10, 5, 35, 45) : object 'tmp' not found

@jabiologo
Copy link
Owner

Ok, let's try the next:
wind.dl(2015,2,12,0,0,10,35,45)
This is slightly different from the previous one, but I bet you will get the error. The function simply wraps this date and locations (lat and lon) into a URL. Let's try the follow (which is what the function is doing internally, very simple)

mm_c <- 2
dd_c <- 12
tt_c <- 0
lat1 <- 35
lat2 <- 45
lon1 <- 0
lon2 <- 10

url_dir <- paste("https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.csv?ugrd10m[(", 
                 yyyy_c, "-", mm_c, "-", dd_c, "T", tt_c, ":00:00Z)][(", 
                 lat1, "):(", lat2, ")][(", lon1, "):(", lon2, 
                 ")],vgrd10m[(", yyyy_c, "-", mm_c, "-", dd_c, 
                 "T", tt_c, ":00:00Z)][(", lat1, "):(", lat2, 
                 ")][(", lon1, "):(", lon2, ")]&.draw=vectors&.vars=longitude|latitude|ugrd10m|vgrd10m&.color=0x000000", 
                 sep = "")`

Now, if you type url_dir you should get:
[1] "https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.csv?ugrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)],vgrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)]&.draw=vectors&.vars=longitude|latitude|ugrd10m|vgrd10m&.color=0x000000"
If you copy-paste this URL and copy-paste in a browser you will get the CSV file with the data. Could you please do this to confirm that you have internet access through this URL?

In the next step, the function simply call to this URL and download the CSV in a right format:
tmp <- read.csv(url_dir, header = FALSE, skip = 2, stringsAsFactors = FALSE)
If you are getting an error when running this chunk your machine is not able to connect with pae-paha.pacioos server. There could be many reasons, but this is not related with rWind (it is working in my machine right now and I've never have this error before from other users???)
If it is running and you type tmp you will get the data:
V1 V2 V3 V4 V5
1 2015-02-12T00:00:00Z 35.0 0.0 -1.26000000 2.7800000
2 2015-02-12T00:00:00Z 35.0 0.5 -0.13000000 3.1699998
3 2015-02-12T00:00:00Z 35.0 1.0 -0.57000000 2.7200000
4 2015-02-12T00:00:00Z 35.0 1.5 0.24000000 2.4600000
5 2015-02-12T00:00:00Z 35.0 2.0 1.02000000 1.7600000
6 2015-02-12T00:00:00Z 35.0 2.5 -0.04000000 2.3100000
7 2015-02-12T00:00:00Z 35.0 3.0 -0.55000000 1.9000000
8 2015-02-12T00:00:00Z 35.0 3.5 -0.37000000 2.0300000
9 2015-02-12T00:00:00Z 35.0 4.0 0.35000000 2.3799999
...

Please, let me know where do you get the error. Thanks for reporting.

Javi

@ptpell77
Copy link
Author

Thanks very much for your help. I am able to download the data using the manual link generation (from paste), and from the copy- paste option.

However, trying to run the line: tmp <- read.csv(url_dir, header = FALSE, skip = 2, stringsAsFactors = FALSE) generates:
URL 'https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.csv?ugrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)],vgrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)]&.draw=vectors&.vars=longitude|latitude|ugrd10m|vgrd10m&.color=0x000000': status was 'SSL peer certificate or SSH remote key was not OK'Error in file(file, "rt") :
cannot open the connection to 'https://pae-paha.pacioos.hawaii.edu/erddap/griddap/ncep_global.csv?ugrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)],vgrd10m[(2015-2-12T0:00:00Z)][(35):(45)][(0):(10)]&.draw=vectors&.vars=longitude|latitude|ugrd10m|vgrd10m&.color=0x000000'

p.s. Your example above requires: yyyy_c<- 2015

@jabiologo
Copy link
Owner

p.s. Your example above requires: yyyy_c<- 2015

Sorry about this! And yeah... definitively is not an rWind problem and I think I cannot help you... have you check the error "SSL peer certificate or SSH remote key was not OK" ? It seems you have problems with the certificates https://stackoverflow.com/questions/14192837/ssl-peer-certificate-or-ssh-remote-key-was-not-ok OR rust-lang/cargo#1420 for example...

@KayleighMu
Copy link

Hello Javi,

I'm trying to download wind data from rWind using Wind.dl to run example code from https://github.com/matthewkling/windscape

But I am running into the same issues as this user in 2021.
Once I've run your example code here "#18 (comment)", and generated a URL in R, or if I click on the URL in that comment I get this error from the pae-paha site:

Error {
code=404;
message="Not Found: Your query produced no matching results. Query error: For variable=ugrd10m axis#0=time Constraint="[(2015-2-12T0:00:00Z)]": Start="2015-2-12T0:00:00Z" is less than the axis minimum=2022-12-01T12:00:00Z (and even 2022-12-01T10:30:00Z).";
}

This makes me think that it isn't a problem with connecting to database, but am unsure how to fix. I've tried accessing with a few different wifi connections and have rebooted R a few times. I'm on version 4.2.2. on a Mac OS High sierra 10.13.4.

Thank you for your time.

Kayleigh.

@mlauragonzalez23
Copy link

Hello.
I'm having the same issues as Kayleigh. I've tried to run the example code of windscape (https://github.com/matthewkling/windscape), and rWind (https://rdrr.io/cran/rWind/f/README.md), but I'm not able to download the data. Also when I tried to manually generate the url_dir, the same error code=404 appeared in the link.
Could you solve this issue?
Thanks a lot

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

4 participants