# An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2

**URL:** <https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556>\
**Category:** Issues/Bugs\
**Created:** [February 1, 2022, 2:02pm UTC](https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556 "2022-02-01T14:02:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishore2789](https://discuss.appium.io/user_avatar/discuss.appium.io/kishore2789/32/9700_2.png) [@kishore2789](https://discuss.appium.io/u/kishore2789)\
**Post date:** [February 1, 2022, 2:02pm UTC](https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556/1 "2022-02-01T14:02:21Z")

</div>

Appium version: 1.22.2  
Java-client: 7.6.0  
TestNG: 7.4.0

When executing Tests in real device from TestNG.xml, always second test failed and reason for failure which I found in appium server is listed below.

**Appium Server Logs:**  
Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘POST /element’ cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details  
[W3C (f49c1652)] at UIA2Proxy.command (C:\Users\kiku01\AppData\Local\Programs\Appium Server GUI\resources\app\node\_modules\appium\node\_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:274:13)  
[W3C (f49c1652)] at processTicksAndRejections (internal/process/task\_queues.js:85:5)  
[HTTP] \<-- POST /wd/hub/session/f49c1652-a652-41f7-9ab7-5b5cec0f2319/element 500

**Logcat Logs**  
--------- beginning of crash  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: FATAL EXCEPTION: Instr: androidx.test.runner.AndroidJUnitRunner  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: Process: io.appium.uiautomator2.server, PID: 13074  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: java.lang.IllegalStateException: UiAutomation not connected, UiAutomation@6e1b0a[id=-1, flags=0]  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:1239)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at android.app.UiAutomation.disconnect(UiAutomation.java:296)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at android.app.Instrumentation.finish(Instrumentation.java:249)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at androidx.test.runner.MonitoringInstrumentation.finish(MonitoringInstrumentation.java:367)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at androidx.test.runner.AndroidJUnitRunner.finish(AndroidJUnitRunner.java:415)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:404)  
01-20 22:55:43.233 13074 13115 E AndroidRuntime: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2218)  
01-20 22:56:20.159 20464 20521 E AndroidRuntime: FATAL EXCEPTION: Instr: androidx.test.runner.AndroidJUnitRunner

Did anyone face similar issues?  
Help me with solution if you have any.

I have executed in Samsung and One Plus6, No luck am facing the same issues in both devices.

---

<div class="post-metadata">

**Author:** ![March\_baby](https://discuss.appium.io/user_avatar/discuss.appium.io/march_baby/32/8778_2.png) [@March\_baby](https://discuss.appium.io/u/March_baby)\
**Post date:** [February 17, 2022, 4:04pm UTC](https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556/2 "2022-02-17T16:04:55Z")

</div>

I am also facing the same issue…please let me know if you found any solution for the same.

---

<div class="post-metadata">

**Author:** ![kishore2789](https://discuss.appium.io/user_avatar/discuss.appium.io/kishore2789/32/9700_2.png) [@kishore2789](https://discuss.appium.io/u/kishore2789)\
**Post date:** [February 18, 2022, 9:40pm UTC](https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556/3 "2022-02-18T21:40:40Z")

</div>

Here the issue is without quiting the driver(driver.quit()) second test started to execute in the same session. When the second test get Android or appium driver object then there are two sessions exits and appium server unable to handle this case(since there are two sessions).

I handled in code to quit Android or Appium driver properly then start executing second test.

---

<div class="post-metadata">

**Author:** ![ds2540](https://discuss.appium.io/letter_avatar_proxy/v4/letter/d/6f9a4e/32.png) [@ds2540](https://discuss.appium.io/u/ds2540)\
**Post date:** [July 26, 2022, 6:09pm UTC](https://discuss.appium.io/t/an-unknown-server-side-error-occurred-while-processing-the-command-original-error-post-element-cannot-be-proxied-to-uiautomator2/35556/4 "2022-07-26T18:09:20Z")

</div>

Can you please share more details on what you did to quit Android or Appium driver
