globus / globus-compute

Globus Compute: High Performance Function Serving for Science
https://www.globus.org/compute
Apache License 2.0
148 stars 47 forks source link

Clearer exceptions when a task is submitted to a bad endpoint #329

Closed yadudoc closed 3 years ago

yadudoc commented 3 years ago

Currently, if a task is submitted to a non-existent endpoint, you get the generic GlobusAPIError :

>       raise self.error_class(r)
E       globus_sdk.exc.GlobusAPIError: (500, 'Error', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n')

/home/yadu/anaconda3/envs/funcx_py3.6/lib/python3.6/site-packages/globus_sdk/base.py:552: GlobusAPIError

This is pending investigation of whether this causes the web-service to hang/crash.

Ryan confirms that a KeyError is raised when using the main branch.

Once fixed, using a bad endpoint should have the submit method return an exception, say NonExistentEndpoint.

knagaitsev commented 3 years ago

This is not fixed yet, just realized that with web service branch forwarder_rearch_update the confusing exception above still occurs.

It stems from unclear behavior of the authorize_endpoint function: https://github.com/funcx-faas/funcx-web-service/blob/429fdb46853180fb6bc32591dd9ebb16a591715b/funcx_web_service/authentication/auth.py#L106

It says it will just return False if the user is not authorized for the endpoint, but instead it sometimes throws an exception, causing confusion

knagaitsev commented 3 years ago

This was fixed by my error refactor: https://github.com/funcx-faas/funcX/pull/360