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

can't open the streamlit example #57

Open
angelodai1 opened this issue Sep 5, 2024 · 1 comment
Open

can't open the streamlit example #57

angelodai1 opened this issue Sep 5, 2024 · 1 comment

Comments

@angelodai1
Copy link

No description provided.

@chrieke
Copy link
Owner

chrieke commented Sep 5, 2024

Thanks! Restarted, available again in a few minutes. Is a frequent problem due to the many visitors, must be sometimes someone is hitting a config that multiple times brings it down so after a while streamlit shuts it down for good I think.

This time caught this error in the logs multiple times, will see what can be done at some point:

Thanks for the report!

Error
────────────────────── Traceback (most recent call last) ───────────────────────

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru  

  nner/script_runner.py:584 in _run_script                                      

                                                                                

  /mount/src/prettymapp/streamlit-prettymapp/app.py:171 in <module>             

                                                                                

    168 β”‚   except GeoCodingError as e:                                         

    169 β”‚   β”‚   st.error(f"ERROR: {str(e)}")                                    

    170 β”‚   β”‚   st.stop()                                                       

  ❱ 171 β”‚   df = st_get_osm_geometries(aoi=aoi)                                 

    172 β”‚   config = {                                                          

    173 β”‚   β”‚   "aoi_bounds": aoi.bounds,                                       

    174 β”‚   β”‚   "draw_settings": draw_settings,                                 

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/caching/  

  cache_utils.py:168 in wrapper                                                 

                                                                                

    165 β”‚                                                                       

    166 β”‚   @functools.wraps(info.func)                                         

    167 β”‚   def wrapper(*args, **kwargs):                                       

  ❱ 168 β”‚   β”‚   return cached_func(*args, **kwargs)                             

    169 β”‚                                                                       

    170 β”‚   # Give our wrapper its `clear` function.                            

    171 β”‚   # (This results in a spurious mypy error that we suppress.)         

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/caching/  

  cache_utils.py:199 in __call__                                                

                                                                                

    196 β”‚   β”‚   β”‚   with spinner(message, _cache=True):                         

    197 β”‚   β”‚   β”‚   β”‚   return self._get_or_create_cached_value(args, kwargs)   

    198 β”‚   β”‚   else:                                                           

  ❱ 199 β”‚   β”‚   β”‚   return self._get_or_create_cached_value(args, kwargs)       

    200 β”‚                                                                       

    201 β”‚   def _get_or_create_cached_value(                                    

    202 β”‚   β”‚   self, func_args: tuple[Any, ...], func_kwargs: dict[str, Any]   

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/caching/  

  cache_utils.py:224 in _get_or_create_cached_value                             

                                                                                

    221 β”‚   β”‚   β”‚   return self._handle_cache_hit(cached_result)                

    222 β”‚   β”‚   except CacheKeyNotFoundError:                                   

    223 β”‚   β”‚   β”‚   pass                                                        

  ❱ 224 β”‚   β”‚   return self._handle_cache_miss(cache, value_key, func_args, fu  

    225 β”‚                                                                       

    226 β”‚   def _handle_cache_hit(self, result: CachedResult) -> Any:           

    227 β”‚   β”‚   """Handle a cache hit: replay the result's cached messages, an  

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/caching/  

  cache_utils.py:280 in _handle_cache_miss                                      

                                                                                

    277 β”‚   β”‚   β”‚   with self._info.cached_message_replay_ctx.calling_cached_f  

    278 β”‚   β”‚   β”‚   β”‚   self._info.func, self._info.allow_widgets               

    279 β”‚   β”‚   β”‚   ):                                                          

  ❱ 280 β”‚   β”‚   β”‚   β”‚   computed_value = self._info.func(*func_args, **func_kw  

    281 β”‚   β”‚   β”‚                                                               

    282 β”‚   β”‚   β”‚   # We've computed our value, and now we need to write it ba  

    283 β”‚   β”‚   β”‚   # along with any "replay messages" that were generated dur  

                                                                                

  /mount/src/prettymapp/streamlit-prettymapp/utils.py:24 in                     

  st_get_osm_geometries                                                         

                                                                                

     21 )                                                                       

     22 def st_get_osm_geometries(aoi):                                         

     23 β”‚   """Wrapper to enable streamlit caching for package function"""      

  ❱  24 β”‚   df = get_osm_geometries(aoi=aoi)                                    

     25 β”‚   return df                                                           

     26                                                                         

     27                                                                         

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/prettymapp/osm.py:71 in     

  get_osm_geometries                                                            

                                                                                

    68 β”‚   β”‚   aoi: Polygon geometry query boundary.                            

    69 β”‚   """                                                                  

    70 β”‚   tags = get_osm_tags()                                                

  ❱ 71 β”‚   df = features_from_polygon(polygon=aoi, tags=tags)                   

    72 β”‚   df = cleanup_osm_df(df, aoi)                                         

    73 β”‚   return df                                                            

    74                                                                          

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/osmnx/features.py:349 in    

  features_from_polygon                                                         

                                                                                

     346 β”‚   response_jsons = _overpass._download_overpass_features(polygon, t  

     347 β”‚                                                                      

     348 β”‚   # create GeoDataFrame from the downloaded data                     

  ❱  349 β”‚   return _create_gdf(response_jsons, polygon, tags)                  

     350                                                                        

     351                                                                        

     352 def features_from_xml(filepath, polygon=None, tags=None, encoding="ut  

                                                                                

  /home/adminuser/venv/lib/python3.11/site-packages/osmnx/features.py:489 in    

  _create_gdf                                                                   

                                                                                

     486 β”‚   # ensure we got some node/way data back from the server request(s  

     487 β”‚   if len(geometries) == 0:  # pragma: no cover                       

     488 β”‚   β”‚   msg = "No data elements in server response. Check log and que  

  ❱  489 β”‚   β”‚   raise InsufficientResponseError(msg)                           

     490 β”‚                                                                      

     491 β”‚   # remove untagged elements from the final dict of geometries       

     492 β”‚   utils.log(f"{len(geometries)} geometries created in the dict")     

────────────────────────────────────────────────────────────────────────────────

InsufficientResponseError: No data elements in server response. Check log and 

query location/tags.

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

2 participants