cybergis / cybergis-compute-python-sdk

https://cybergis.github.io/cybergis-compute-python-sdk
Apache License 2.0
5 stars 7 forks source link

SDK Failing Silently if Hostname Not in Globus Configuration #42

Closed alexandermichels closed 1 year ago

alexandermichels commented 2 years ago

If the hostname isn't registered, the SDK will fail without giving any indication on the UI. The errors go to the log at the bottom of the lab interface. This needs to fail gracefully and give a better indication to the end-user.

The error is below:

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
File ~/.local/python3-0.9.0/lib/python3.8/site-packages/cybergis_compute_client/UI.py:600, in UI.onSubmitButtonClick.<locals>.on_click(change)
    598 data = self.get_data()
    599 if data['computing_resource'] != 'local_hpc':
--> 600     self.jupyter_globus = self.compute.get_user_jupyter_globus()
    601 if self.job['require_upload_data']:
    602     dataPath = self.uploadData['selector'].selected

File ~/.local/python3-0.9.0/lib/python3.8/site-packages/cybergis_compute_client/CyberGISCompute.py:537, in CyberGISCompute.get_user_jupyter_globus(self)
    530 def get_user_jupyter_globus(self):
    531     """
    532     Return the current job instance
    533 
    534     Returns:
    535          Job: Latest Job object instance
    536     """
--> 537     return self.client.request(
    538         'GET', '/user/jupyter-globus', {
    539             "jupyterhubApiToken": self.jupyterhubApiToken})

File ~/.local/python3-0.9.0/lib/python3.8/site-packages/cybergis_compute_client/Client.py:67, in Client.request(self, method, uri, body)
     65     if 'messages' in data:
     66         msg = str(data['messages'])
---> 67     raise Exception('server ' + self.url + uri + ' responded with error "' + data['error'] + msg + '"')
     69 return data

Exception: server cgjobsup-dev.cigi.illinois.edu:443/user/jupyter-globus responded with error "unknown host"
alexandermichels commented 1 year ago

Solved with most recent version. The error now shows in the cell output.