Skip to main content
cdsw_user_23432
Gold ⭐️
April 26, 2023
Solved

CDSW Jobs are shown as "Success" when python code throws an Exception

We have several CDSW jobs set up where we call a python script with a main() function which is called via

 

if __name__ ==  "__main__":

    main()

 

Our problem is that these jobs are erronously shown as "Success" even if the python code throws an Exception.

 

How can we set up our CDSW such that these jobs are correctly shown as "Failure"?

cdsw_user_23432
Gold ⭐️
May 22, 2023

Thank you for your reply, which made me take a closer look at which exceptions were handled unexpectedly and I found that the use of rich.traceback.install() in one of the scripts messed up the return status of the CDSW Job.

The issue was solved by removing rich.traceback.install() from the code, which is only cosmetic anyhow

6 replies

DianaTorres
Community Manager
Community Manager
April 26, 2023

@cdsw_user_23432 Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our CDSW experts @Gopinath and @Mike  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
cdsw_user_23432
Gold ⭐️
May 8, 2023

Hi @DianaTorres , any updates on this?

Translate
cdsw_user_23432
Gold ⭐️
April 27, 2023

Thank you @DianaTorres .

I'm looking forward to hearing back from your team

Translate
Gopinath
Gold ⭐️⭐️
Gold ⭐️⭐️
May 8, 2023

seems to be a gap in the exception handling.  Could you please share the actual script snippet for analysis.

Translate
cdsw_user_23432
cdsw_user_23432AuthorAnswer
Gold ⭐️
May 22, 2023

Thank you for your reply, which made me take a closer look at which exceptions were handled unexpectedly and I found that the use of rich.traceback.install() in one of the scripts messed up the return status of the CDSW Job.

The issue was solved by removing rich.traceback.install() from the code, which is only cosmetic anyhow

Translate
cjervis
Community Manager
Community Manager
May 22, 2023

Congratulations on resolving the issue @cdsw_user_23432. Please use the "Accept as Solution" button to mark the reply that resolved the issue for you. It helps others in a similar situation find assistance in the future. 

Translate
Keep the questions coming