Seeing error on terminal with serve run

How severe does this issue affect your experience of using Ray?

  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.

Hi,
When I run serve run on the CLI and there is a bug in my code. It’ll inform me that the deployment fails but not why it fails.

serve run --host="0.0.0.0" attribute_prediction_api.app:work_api
2022-11-10 08:38:28,012.INFO scripts.py:294 -- Deploying from import path: "attribute_prediction_api.app:work_api".                                                                                                                                  

.....

RuntimeError: Deployment AttributePredictionAPI is UNHEALTHY: The Deployment constructor failed 3 times in a row. See logs for details.

If I look at the logs, there are so many of them and I perhaps don’t know where to look specifically. That could be one learning point for me.

But I was wondering, how do I actually make it display on the terminal itself why it didn’t work. It would be great to get instant feedback on the terminal.

If it helps, my error was treating a ray actor as a normal object in the deployment constructor

@serve.deployment(route_prefix="/")
@serve.ingress(app)
class AttributePredictionAPI:
    def __init__(self, ..):
        self.predictor = Predictor(arg1) # <---------- this should have been Predictor.remote(arg1)


Hi @rabraham , this is great feedback! I agree it would be more convenient to see the traceback instead of just “See logs for details.” Do you mind filing an enhancement request on the Ray Github?

1 Like