Which sub component causes Connection refused error?

I’m testing several android apps on a google pixel 3a using appium java-client, one app after another. From time to time I get a Socket hung up or connection refused error

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'lap-thiara', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-34-generic', java.version: '11.0.11'

The question now is, how can I recover from such a crash or what is likely causing the crash? I already tried to uninstall appium app on the device and restarting the phone which didn’t do the trick. Also killing the appium node process on the computer doesn’t seem to help. Sometimes simply waiting helps to recover…but I’ve not yet recognized anything deterministic to do to get rid of the error.

Can anyone shed some light which process likely crashed and what to kill and restart or if the error comes from the phone or the computer.

This suggests to me that an old Appium process is still cleaning up. You could try ps aux | grep appium to see what processes are still running. Killing them might not be the best answer, but if you could hold off starting the new one until the older ones are done you might smooth out your automation runs.

sounds reasonable…do you maybe know some appium integrated way to wait for appium to completely finish?

I know of no Appium way to do this, but I wonder if a bash wait command could work for this? I’ve never done this, but it is what I would try:

thanks a lot! I’ll have a look.

OK it works now…process killing was just fine, but I by mistake tried to connect to the appium server port of the crashed instance and not the newly created one :weary:

once again…thanks @wreed

1 Like