R-ArcGIS / arcgisgeocode

Utilize public or private ArcGIS Geocoder Services from R. Provides reverse geocoding, candidate search, single address, and batch geocoding.
http://r.esri.com/arcgisgeocode/
Apache License 2.0
40 stars 6 forks source link

Intermittent cli progress bar errors #12

Closed oonuttlet closed 7 months ago

oonuttlet commented 7 months ago

Seemingly randomly, geocode_addresses() errors out with Error in cli::cli_progress_update(..., id = id) : Cannot find progress bar cli-117300-128

If I knew more about {cli} I'd try and include more info -- let me know if I can provide anything else for troubleshooting.

Traceback:

9: stop("Cannot find progress bar `", id, "`")  
8: cli::cli_progress_update(..., id = id)  
7: self$progress$update()  
6: (function (res)   
   {  
       self$progress$update()  
       body <- if (is.null(self$path))   
           res$content  
       else new_path(self$path)  
       resp <- new_response(method = req_method_get(self$req), url = res$url,   
           status_code = res$status_code, headers = as_headers(res$headers),   
           body = body, request = self$req)  
       resp <- cache_post_fetch(self$reqs, resp, path = self$paths)  
       self$resp <- tryCatch(resp_check_status(resp, error_call = self$error_call),   
           error = identity)  
       if (is_error(self$resp)) {  
           signal("", error = self$resp, class = "httr2_fail")  
       }  
   })(list(url =  "https://bcgisdata.baltimorecountymd.gov/arcgis/rest/services/Geocoders/CompositeGeocoder/GeocodeServer/geocodeAddresses?f=json",   
       status_code = 200L, type = "application/json; charset=UTF-8",   
       headers = as.raw(c(0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e,   
       0x31, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, 0x0a,   
       0x43, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x43, 0x6f, 0x6e, 0x74,   
    ...  
5: curl::multi_run(pool = pool)  
4: pool_cancel(pool, perfs)  
3: pool_run(pool, perfs, on_error = on_error)  
2: httr2::req_perform_parallel(all_reqs, on_error = "continue",   
       progress = .progress)  
1: geocode_addresses(address = df$LOC, city = df$COMMUNITY,   
       geocoder = baltco_composite)

R 4.3.3, arcgisgeocode 0.0.0.9003, cli 3.6.2

JosiahParry commented 7 months ago

This is an error with {cli} that I've seen occur with stale R sessions. What I would do is this:

1) restart your R session then 2) set .progress = FALSE in the function

The second thing will make sure that cli isn't used (so you wont get a pretty progress bar but you also wont get an error!)

Also, super awesome to see that you're using your own geocoding service!

oonuttlet commented 7 months ago

Thanks! I expected it was something in that vein.