Unable to publish junit test reports

Hi, I am using a multi stage pipeline on jenkins, junit plugin is publishing the test results but some time, post stage for publishing the test results fails making the build fail with error “No test report files were found. Configuration error”. So is there any way to solve this. And why this is happening.
Thank you.