Inconsistent behavior between two rstudio sessions

I feel like I'm going crazy. I've been having this simple osmdata query failing over and over again, so I opened a separate rstudio project to make a reprex, and over there it works fine. I've cleared the workspace, cleared the output, restarted the session, and it still fails. Created a new markdown in the failing session, did a copy and paste from the reprex, and it still fails. I am at my wits end. Here is the code, and the two different responses I get running it:


googlecrs <- "EPSG:4326" # lat long

big_streets <- 
  osmdata::getbb(place_name = "Houston") %>% 
  osmdata::opq()%>% # Build query
  osmdata::add_osm_feature(key = "highway", 
                  value = c("motorway", 
                            )) %>% # select the big roads

knitr::opts_chunk$set(echo = TRUE)

Failing session:

Issuing query to Overpass API ...
! HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
  1. ... %>% osmdata::osmdata_sf(quiet = FALSE)
  2. osmdata::osmdata_sf(., quiet = FALSE)
  3. osmdata:::fill_overpass_data(obj, doc, quiet = quiet)
  4. osmdata:::overpass_query(...)
  5. osmdata::overpass_status(quiet)
  6. httr2::req_perform(req)
  7. base::tryCatch(...)
  8. base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10. value[[3L]](cond)

Successful session:

Issuing query to Overpass API ...
Announced endpoint:
Query complete!
converting OSM data to sf format

Typically, the act of reporting led to the answer. I went in and manually deleted the .RData and .RHistory files, restarted the session, and now it is all good. I assume that the .RData must have gotten corrupted in some weird and wonderful way.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.