appium: Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id

The problem

Appium tests started failing on Mac Mini few weeks ago (maybe months already) with last log error message:

Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/usr/local/Caskroom/android-sdk/3859397\,26.0.2/platform-tools/adb -P 5037 -s 5200fc8bf01b9441 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id

I tried to reinstall appium server, tried update to 1.8.1 and then also beta, but with no luck, still same issue. When the test fails with this error log, I can see com.appium.uiautomator2.server is still running in process list. Not sure if this may be the cause. Also I noticed, that if I run

adb -P 5037 -s 5200fc8bf01b9441 shell kill -9

with PID of that remaining uiautoamtor2 server manually after the test fails, I get permission denied error. I saw this command in logs, with the same permission denied error message. But I have no clue, why is it missing permissions and what I can do to fix it…

Environment

  • Appium version (or git revision) that exhibits the issue: 1.7.2, 1.8.1, 1.8.2 beta
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: ProductName: Mac OS X ProductVersion: 10.13.6 BuildVersion: 17G65
  • Node.js version (unless using Appium.app|exe):8.0.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Real
  • Appium CLI or Appium.app|exe: CLI

Details

I’m running the appium server with

appium --relaxed-security --log-timestamp

Link to Appium logs

https://gist.github.com/risinek/5f19ee4c7600a83cad1409da9e8e8bab

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16

Most upvoted comments

I resolved my issue by reinstalling appium.

For me the issue was resolved after tested phone restart.

How do you restart test phone when you are in CI GitHub action ? Is there another way?

For me the issue was resolved after tested phone restart.

Damn, that actually worked. Thanks!