Hi
Thanks for reaching out to Microsoft Q&A.
This is a spark error. Please see the below link, it has explained with settings that has to be done for avoiding this error.
"livy.server.session.timeout":"10h" -- addresses errors from long-running Spark tasks in a Jupyter/EMR notebook that die after an hour of execution:
An error was encountered:
Invalid status code '400' from https://xxx.xx.x.xxx:18888/sessions/0/statements/20 with error payload: "requirement failed: Session isn't active." [reference]
Please Upvote and Accept as answer if the reply was helpful, this will be helpful to other community members.