-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I regularly encountered the same error while using getRad::get_vpts in a shiny app developed to flag rain contaminations in the European weather radar data:
# download the data of a radar, from the Aloft repository, in folder "baltrad" for the period of interest
vpts_raw <- get_vpts(radar = wantRadar,
datetime = wantInterTime,
source = "baltrad")"Listening on http://127.0.0.1:3807
Warning: Error in get_vpts: ℹ In index: 1.
Caused by error in httr2::req_perform_parallel():
! Failed to perform HTTP request.
Caused by error:
! Timeout was reached [aloftdata.s3-eu-west-1.amazonaws.com]:
Connection timed out after 10001 milliseconds
82:
81: signalCondition
80: signal_abort
79: rlang::abort
78: cli::cli_abort
77:
76: signalCondition
75: signal_abort
74: cnd_signal
73: httr2::req_perform_parallel
72: fetch_from_url_raw
68: read_vpts_from_url
59: get_vpts_aloft
58: .f
54: map_
53: purrr::map
50: get_vpts
49: server [#4]
3: runApp
2: print.shiny.appobj
1:
Error in get_vpts(radar = wantRadar, datetime = wantInterTime, source = "baltrad") :
ℹ In index: 1.
Caused by error in httr2::req_perform_parallel():
! Failed to perform HTTP request.
Caused by error:
! Timeout was reached [aloftdata.s3-eu-west-1.amazonaws.com]:
Connection timed out after 10001 milliseconds"
Unfortunately, I can't provide a replicable example as it sometimes works the first time and sometimes I get this error. When this happens, I resend the command (several times) and it finally works. The problem arises when looping through several radars/years and loading data iteratively for specific periods. If the connection to Aloft fails, then the whole loop crashes. Is there a way to force get_vpts to retry the connection if this error appears, and/or modify the connection time threshold after which the request is considered failed (to avoid the entire loop crashing)?