selenium.WebDriverException: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up

I am executing Android test cases on windows using appium.
My browser is launching but failing to execute any test method.
and giving the error.

"org.openqa.selenium.WebDriverException: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up"

Hello guys, I have faced the same problem, but now I just find the reason & also the solution. I realized that the error occurred when I made a test case that contains both “close server session” & “open new server session” command. I Think when running that kind of test case, the two different appium sessions overlap with each other, and then the error occurred. So my solution to this problem was very simple because I just separated “close server session” & “open new server session” command into two different test case, and then boom, the error has not occurred until now

1 Like

Hi guys, I am using appium 1.15 and I am seeing this error lot. Please let
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: socket hang up
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘harry-MacBook-Pro.local’, ip: ‘fe80:0:0:0:1cb1:3438:fe25:3ed0%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.15.4’, java.version: ‘1.8.0_211’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: /Users/hpatel/Appium/Whistl…, appPackage: com.whistle.bolt, autoAcceptAlerts: true, autoGrantPermissions: true, databaseEnabled: false, desired: {app: /Users/hpatel/Appium/Whistl…, autoAcceptAlerts: true, autoGrantPermissions: true, deviceName: Samsung Galasxy S9, fullReset: false, locationServicesAuthorized: true, maxTypingFrequency: 10, noReset: true, platformName: android, platformVersion: 8.0.0, udid: 41414c3258543398}, deviceApiLevel: 28, deviceManufacturer: samsung, deviceModel: SM-G960U, deviceName: 41414c3258543398, deviceScreenDensity: 480, deviceScreenSize: 1080x2220, deviceUDID: 41414c3258543398, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, locationServicesAuthorized: true, maxTypingFrequency: 10, networkConnectionEnabled: true, noReset: true, pixelRatio: 3, platform: LINUX, platformName: Android, platformVersion: 9, statBarHeight: 72, takesScreenshot: true, udid: 41414c3258543398, viewportRect: {height: 2004, left: 0, top: 72, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: 82745f79-a93d-43c7-b51c-529798714b8f

Thank you . Even though i had server.start in beforesuite and server.stop in aftersuite , it was still creating an issue. Finally worked

-org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

hi i am seeing this issue even after having close session afterclass, start session beforeclass.
can anyone please help

Same error to me using Appium v1.22.3.

Fixed uninstalling UIAutomator2 driver before run Appium Server (will reinstall automatically).

adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test

WebDriverException can occur for several reasons including network connectivity issues, server-side issues, or problems with the Selenium WebDriver or AppiumDriver. A few possible resolutions are as follows:

  1. It may occur if the Appium Server cannot talk to the UIAutomator2 driver of the related Mobile Device. Stop the Appium Server and execute the following commands to remove the following packages (related to UIAutomator2 driver) from the mobile device or ADV:

        adb uninstall io.appium.uiautomator2.server
    
        adb uninstall io.appium.uiautomator2.server.test
    

    Afterwards, restart the server and execute the test Script. The Appium server will reinstall these packages into the connected mobile device automatically.

Note that the UiAutomator2 driver resides in the C:\Users\USER_NAME\.appium\node_modules
directory. The above command starting with adb uninstalls the io.appium.uiautomator2.server package and io.appium.uiautomator2.server.test package from the connected mobile device. They DO NOT remove the UiAutomator2 driver from the node_modules directory of the computer. To uninstall/remove the UiAutomator2 driver from the node_modules directory of the computer run the command npm uninstall appium-uiautomator2-driver.

  1. It may happen if the mobile device is full of data. Wipe Data from the Virtual Device or restart/reboot the actual device.

  2. The driver instance can crash if we try to initialize the driver (i.e. create an object of AppiumDriver or ChromeDriver, etc. ) inside a Constructor, in place of a method or @BeforeMethod, @BeforeClass, etc. So avoid instantiating driver instances inside a Constructor.