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

Bug report #35

Open
1 task done
youngbullt opened this issue Dec 9, 2024 · 0 comments
Open
1 task done

Bug report #35

youngbullt opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@youngbullt
Copy link

youngbullt commented Dec 9, 2024

🪲

  • I have checked that this issue has not already been reported.

Bug summary

I get a certificate error when I try to run demo_texas.py after following the directions in README.md (on Windows).

Code for reproduction

  1. Open git bash terminal.
  2. cd plug/standalone
  3. docker-compose up
  4. Open another git bash terminal
  5. docker-compose exec client jupyter lab --port=10000 --no-browser --ip=0.0.0.0 --allow-root
  6. Open http://127.0.0.1:10000/lab/tree/Untitled1.ipynb in chrome
  7. Click Notebook->Python3 (ipykernel)
  8. enter "import demo_texas"
  9. Hit the play icon (triangle).

Actual outcome

The run terminated with an error.

The output produced by the above code, which may be a screenshot, console output, etc.

# If applicable, paste the console output here

Transferring ScenarioList.csv from local_fs
ScenarioList.csv.2 not found on local machine
--> Begin: Existing Study
Nothing yet
<-- End: Existing Study
--> Begin: Available profiles
---------------------------------------------------------------------------
ServiceRequestError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import demo_texas

File /plug/demo_texas.py:10
      7 scenario = Scenario()
      8 print(scenario.state.name)
---> 10 scenario.set_grid(interconnect="Texas")
     12 scenario.set_name("test", "comp_" + str(uuid4()))
     13 scenario.set_time("2016-01-01 00:00:00", "2016-01-01 03:00:00", "1H")

File /usr/local/lib/python3.8/site-packages/powersimdata/scenario/create.py:140, in Create.set_grid(self, grid_model, interconnect, **kwargs)
    132 """Sets grid builder.
    133 
    134 :param str grid_model: name of grid model. Default is *'usa_tamu'*.
    135 :param str/list interconnect: name of interconnect(s). Default is *'USA'*.
    136 :param \\*\\*kwargs: optional parameters used to instantiate a Grid object.
    137 """
    138 scenario_table = self._scenario_list_manager.get_scenario_table()
--> 140 self.builder = get_builder(
    141     grid_model,
    142     interconnect,
    143     scenario_table,
    144     **kwargs,
    145 )
    147 self.exported_methods |= self.builder.exported_methods
    149 self._scenario_info["grid_model"] = self.builder.grid_model

File /usr/local/lib/python3.8/site-packages/powersimdata/scenario/create.py:462, in get_builder(grid_model, interconnect, table, **kwargs)
    459 check_model(grid_model)
    460 model2builder = {"usa_tamu": FromCSV, "hifld": FromCSV, "europe_tub": FromPyPSA}
--> 462 return model2builder[grid_model](grid_model, interconnect, table, **kwargs)

File /usr/local/lib/python3.8/site-packages/powersimdata/scenario/create.py:366, in FromCSV.__init__(self, grid_model, interconnect, table, **kwargs)
    364 self._profile_input = ProfileInput()
    365 self.print_existing_study()
--> 366 self.print_available_profile()
    368 self.set_base_grid()
    369 self.set_change_table()

File /usr/local/lib/python3.8/site-packages/powersimdata/scenario/create.py:375, in FromCSV.print_available_profile(self)
    373 print("--> Begin: Available profiles")
    374 for p in ["demand", "hydro", "solar", "wind"]:
--> 375     possible = self.get_base_profile(p)
    376     if len(possible) != 0:
    377         print("%s: %s" % (p, " | ".join(possible)))

File /usr/local/lib/python3.8/site-packages/powersimdata/scenario/create.py:394, in FromCSV.get_base_profile(self, kind)
    388 def get_base_profile(self, kind):
    389     """Return available base profiles.
    390 
    391     :param str kind: one of *'demand'*, *'hydro'*, *'solar'*, *'wind'*.
    392     :return: (*list*) -- available version for selected profile kind.
    393     """
--> 394     return self._profile_input.get_profile_version(self.grid_model, kind)

File /usr/local/lib/python3.8/site-packages/powersimdata/input/profile_input.py:88, in ProfileInput.get_profile_version(self, grid_model, kind)
     85 def _callback(fs):
     86     return get_profile_version(fs, grid_model, kind)
---> 88 return self.data_access.get_profile_version(_callback)

File /usr/local/lib/python3.8/site-packages/powersimdata/data_access/data_access.py:141, in DataAccess.get_profile_version(self, callback)
    134 """Returns available raw profile from blob storage or local disk
    135 
    136 :param callable callback: a function taking a fs instance that returns the
    137     available profiles on that fs
    138 :return: (*list*) -- available profile version.
    139 """
    140 bfs = get_blob_fs("profiles")
--> 141 blob_version = callback(bfs)
    142 local_version = callback(self.local_fs)
    143 return list(set(blob_version + local_version))

File /usr/local/lib/python3.8/site-packages/powersimdata/input/profile_input.py:86, in ProfileInput.get_profile_version.<locals>._callback(fs)
     85 def _callback(fs):
---> 86     return get_profile_version(fs, grid_model, kind)

File /usr/local/lib/python3.8/site-packages/powersimdata/input/profile_input.py:30, in get_profile_version(_fs, grid_model, kind)
     20 """Returns available raw profile from the given filesystem
     21 
     22 :param fs.base.FS _fs: filesystem instance
   (...)
     27 :return: (*list*) -- available profile version.
     28 """
     29 _fs = _fs.makedirs(f"raw/{grid_model}", recreate=True)
---> 30 matching = [f for f in _fs.listdir(".") if kind in f]
     32 # Don't include demand flexibility profiles as possible demand profiles
     33 if kind == "demand":

File /usr/local/lib/python3.8/site-packages/fs/wrapfs.py:149, in WrapFS.listdir(self, path)
    147 _fs, _path = self.delegate_path(path)
    148 with unwrap_errors(path):
--> 149     dir_list = _fs.listdir(_path)
    150 return dir_list

File /usr/local/lib/python3.8/site-packages/fs/azblob/blob_fs_v2.py:117, in BlobFSV2.listdir(self, path)
    115     raise errors.DirectoryExpected(path)
    116 paths = self.client.get_paths(path, recursive=False)
--> 117 return [p["name"].split("/")[-1] for p in paths]

File /usr/local/lib/python3.8/site-packages/fs/azblob/blob_fs_v2.py:117, in <listcomp>(.0)
    115     raise errors.DirectoryExpected(path)
    116 paths = self.client.get_paths(path, recursive=False)
--> 117 return [p["name"].split("/")[-1] for p in paths]

File /usr/local/lib/python3.8/site-packages/azure/core/paging.py:128, in ItemPaged.__next__(self)
    126 if self._page_iterator is None:
    127     self._page_iterator = itertools.chain.from_iterable(self.by_page())
--> 128 return next(self._page_iterator)

File /usr/local/lib/python3.8/site-packages/azure/core/paging.py:76, in PageIterator.__next__(self)
     74     raise StopIteration("End of paging")
     75 try:
---> 76     self._response = self._get_next(self.continuation_token)
     77 except AzureError as error:
     78     if not error.continuation_token:

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_list_paths_helper.py:150, in PathPropertiesPaged._get_next_cb(self, continuation_token)
    148 def _get_next_cb(self, continuation_token):
    149     try:
--> 150         return self._command(
    151             self.recursive,
    152             continuation=continuation_token or None,
    153             path=self.path,
    154             max_results=self.results_per_page,
    155             upn=self.upn,
    156             cls=return_headers_and_deserialized_path_list)
    157     except HttpResponseError as error:
    158         process_storage_error(error)

File /usr/local/lib/python3.8/site-packages/azure/core/tracing/decorator.py:78, in distributed_trace.<locals>.decorator.<locals>.wrapper_use_tracer(*args, **kwargs)
     76 span_impl_type = settings.tracing_implementation()
     77 if span_impl_type is None:
---> 78     return func(*args, **kwargs)
     80 # Merge span is parameter is set, but only if no explicit parent are passed
     81 if merge_span and not passed_in_parent:

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_generated/operations/_file_system_operations.py:730, in FileSystemOperations.list_paths(self, recursive, request_id_parameter, timeout, continuation, path, max_results, upn, **kwargs)
    727 request = _convert_request(request)
    728 request.url = self._client.format_url(request.url)  # type: ignore
--> 730 pipeline_response = self._client._pipeline.run(  # type: ignore # pylint: disable=protected-access
    731     request, stream=False, **kwargs
    732 )
    734 response = pipeline_response.http_response
    736 if response.status_code not in [200]:

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:211, in Pipeline.run(self, request, **kwargs)
    203 pipeline_request = PipelineRequest(
    204     request, context
    205 )  # type: PipelineRequest[HTTPRequestType]
    206 first_node = (
    207     self._impl_policies[0]
    208     if self._impl_policies
    209     else _TransportRunner(self._transport)
    210 )
--> 211 return first_node.send(pipeline_request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

    [... skipping similar frames: _SansIOHTTPPolicyRunner.send at line 71 (2 times)]

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/policies/_redirect.py:153, in RedirectPolicy.send(self, request)
    151 redirect_settings = self.configure_redirects(request.context.options)
    152 while retryable:
--> 153     response = self.next.send(request)
    154     redirect_location = self.get_redirect_location(response)
    155     if redirect_location and redirect_settings['allow']:

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_shared/policies.py:532, in StorageRetryPolicy.send(self, request)
    530             self.sleep(retry_settings, request.context.transport)
    531             continue
--> 532         raise err
    533 if retry_settings['history']:
    534     response.context['history'] = retry_settings['history']

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_shared/policies.py:506, in StorageRetryPolicy.send(self, request)
    504 while retries_remaining:
    505     try:
--> 506         response = self.next.send(request)
    507         if is_retry(response, retry_settings['mode']):
    508             retries_remaining = self.increment(
    509                 retry_settings,
    510                 request=request.http_request,
    511                 response=response.http_response)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_shared/policies.py:304, in StorageResponseHook.send(self, request)
    299 upload_stream_current = request.context.get('upload_stream_current') or \
    300     request.context.options.pop('upload_stream_current', None)
    301 response_callback = request.context.get('response_callback') or \
    302     request.context.options.pop('raw_response_hook', self._response_callback)
--> 304 response = self.next.send(request)
    305 will_retry = is_retry(response, request.context.options.get('mode'))
    306 if not will_retry and download_stream_current is not None:

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:71, in _SansIOHTTPPolicyRunner.send(self, request)
     69 _await_result(self._policy.on_request, request)
     70 try:
---> 71     response = self.next.send(request)
     72 except Exception:  # pylint: disable=broad-except
     73     _await_result(self._policy.on_exception, request)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/_base.py:103, in _TransportRunner.send(self, request)
     93 def send(self, request):
     94     """HTTP transport send method.
     95 
     96     :param request: The PipelineRequest object.
   (...)
     99     :rtype: ~azure.core.pipeline.PipelineResponse
    100     """
    101     return PipelineResponse(
    102         request.http_request,
--> 103         self._sender.send(request.http_request, **request.context.options),
    104         context=request.context,
    105     )

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_shared/base_client.py:332, in TransportWrapper.send(self, request, **kwargs)
    331 def send(self, request, **kwargs):
--> 332     return self._transport.send(request, **kwargs)

File /usr/local/lib/python3.8/site-packages/azure/storage/filedatalake/_shared/base_client.py:332, in TransportWrapper.send(self, request, **kwargs)
    331 def send(self, request, **kwargs):
--> 332     return self._transport.send(request, **kwargs)

File /usr/local/lib/python3.8/site-packages/azure/core/pipeline/transport/_requests_basic.py:360, in RequestsTransport.send(self, request, **kwargs)
    357     error = ServiceRequestError(err, error=err)
    359 if error:
--> 360     raise error
    361 if _is_rest(request):
    362     from azure.core.rest._requests_basic import RestRequestsTransportResponse

ServiceRequestError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

### Expected outcome
The demo should run to completion.

### Environment
Please specify your platform and versions of the relevant libraries you are using:
* Windows 11 Enterprise 22H2
* git revision (run `git rev-parse origin/HEAD`): 4e58495acda959ac08f6cae19f3001889c28ceca
* Python version (if applicable): 3.8 on docker
* Jupyter version (if applicable): JupyterLab 3.5.1
* Julia version (if applicable):
* Other libraries:

### Additional context
Add any other context about the problem here.
The same steps work in Linux.
@youngbullt youngbullt added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants