The solution is to check the app on the device, and make sure that it is trusted, then run your automation.
The issue occurs when a connection is attempted to reach the cloud, but is blocked by your local proxy or firewall rules.
First step is to see if you can connect to your mobile cloud and open a device, from your desktop web browser of choice. If it passes, then the issue is most likely the security of your company and the IDE being used (Eclipse/IntelliJ/UFT/xFramium/etcetera)
Second step will be more challenging. In order to troubleshoot this issue, please put your IDE into debug mode. You will need to step through each step in debug mode, which should give the details of the API command that is failing.
Most reasons for this issue are an incorrect URL to the cloud (example: trying to use <yourLab>.perfecto.com instead of <yourLab>.perfectomobile.com). Please check your constructor and ensure that the host variable is set properly
String host = mycloud.perfectomobile.com;
AppiumDriver driver = new AppiumDriver(new URL("https://" + host + "/nexperience/perfectomobile/wd/hub"), capabilities);
Additional Notes IRT on this Error:
The error message is misleadingvery generic. It could also be caused by other reasons i.e. device is offline, etcetera.