Appium server closes unexpectedly when trying to inspect the element


I am using appium version 1.8.2. When I am trying to find element(usually by xpath), but getting below error:
and also when i try to inspect the element via Appium Desktop, it is closes unexpectedly.

There was no error logs

Can anyone please tell me what needs to be done