architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
196 stars 65 forks source link

Failed in creating scenario #3668

Open xie-haonan opened 2 weeks ago

xie-haonan commented 2 weeks ago

Describe the bug

1abe08c8703fb7883dbb4d010018dc1 When creating a scenario, here follows the detailed information:

urllib3.exceptions.SSLError: TLS/SSL connection has been closed (EOF) (_ssl.c:1131)

The above exception was the direct cause of the following exception:

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)')))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\adapters.py", line 667, in send
    resp = conn.urlopen(
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\urllib3\util\retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='overpass-api.de', port=443): Max retries exceeded with url: /api/status (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\_overpass.py", line 131, in _get_overpass_pause
    response = requests.get(
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\requests\adapters.py", line 694, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='overpass-api.de', port=443): Max retries exceeded with url: /api/status (Caused by ProxyError('Unable to connect to proxy', SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1131)'))))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\interfaces\dashboard\api\project.py", line 177, in post
    cea.api.zone_helper(config)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\api.py", line 60, in __call__
    self._runner.__call__(*args, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\api.py", line 38, in script_runner
    script_module.main(config)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\datamanagement\zone_helper.py", line 599, in main
    zone_helper(locator, config)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\datamanagement\zone_helper.py", line 350, in zone_helper
    zone_df = polygon_to_zone(buildings_floors, buildings_floors_below_ground, buildings_height,
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\datamanagement\zone_helper.py", line 502, in polygon_to_zone
    shapefile = osmnx.features_from_polygon(polygon=poly['geometry'].values[0], tags={"building": True})
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\features.py", line 336, in features_from_polygon
    return _create_gdf(response_jsons, polygon, tags)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\features.py", line 427, in _create_gdf
    for response_json in response_jsons:
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\_overpass.py", line 352, in _download_overpass_features
    yield _overpass_request(data={"data": query_str})
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\_overpass.py", line 386, in _overpass_request
    this_pause = _get_overpass_pause(settings.overpass_endpoint)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\osmnx\_overpass.py", line 141, in _get_overpass_pause
    utils.log(f"Unable to query {url}, got status {response.status_code}", level=lg.ERROR)
UnboundLocalError: local variable 'response' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\flask\app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\flask_restx\api.py", line 402, in wrapper
    resp = resource(*args, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\flask\views.py", line 109, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\flask_restx\resource.py", line 41, in dispatch_request
    resp = meth(*args, **kwargs)
  File "C:\Users\99664\Documents\CityEnergyAnalyst\dependencies\micromamba\envs\cea\lib\site-packages\cea\interfaces\dashboard\api\project.py", line 187, in post
    raise Exception(f'{tool}_helper: {e}') from e
Exception: zone_helper: local variable 'response' referenced before assignment

Expected behaviour This is my first time with CEA and I want to have a successful utilization.

Screenshots 1abe08c8703fb7883dbb4d010018dc1If

Hardware (please complete the following information):

reyery commented 2 weeks ago

Based on the error message, there seems to be some issue with an external library connecting to the api fetching the building geometries (could be some issues with the internet connecting to it). I am wondering if you are able to access this endpoint from your browser: https://overpass-api.de/api/status .

If you see a response on the browser, could you try running using CEA again and let us know if it still works.

xie-haonan commented 2 weeks ago

Thank and I can access this endpoint. 46268c32399e3476a98c477b74f781d

xie-haonan commented 2 weeks ago

The scenario creating doesn't work. image