Description
When the Oozie client tries to connect to the server and fails the error message is not always helpful.
$ oozie jobs -oozie http://thisisawrongurl Error: IO_ERROR : java.io.IOException: Error while connecting Oozie server. No of retries = 1. Exception = thisisawrongurl
A few examples with more helpful error messages:
$ oozie jobs -oozie http://localhost:11001 Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ]. Trying after 1 sec. Retry count = 1 Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ]. Trying after 2 sec. Retry count = 2 Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ]. Trying after 4 sec. Retry count = 3 Connection exception has occurred [ java.net.ConnectException Connection refused (Connection refused) ]. Trying after 8 sec. Retry count = 4 Error: IO_ERROR : java.io.IOException: Error while connecting Oozie server. No of retries = 4. Exception = Connection refused (Connection refused) $ oozie jobs -oozie http://localhost:11000/oozietypo Error: IO_ERROR : java.io.IOException: Error while connecting Oozie server. No of retries = 1. Exception = Could not authenticate, Authentication failed, status: 404, message: Not Found
It is not enought to print out the getMessage() of the Exception, we should also print out the full stack trace in the ConnectionRetriableClient class.