Exception occurred while trying to close the client after that Appium goes on recording the video

Hi All,

Appium is getting stuck while starting the next recording chunk. Please find the logs below
[debug] [AndroidDriver] The overall screen recording duration is 182s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583996093333.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996093333.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996093333.mp4’
Exception occurred while trying to close the client
[debug] [AndroidDriver] The overall screen recording duration is 363s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583996274960.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996274960.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996274960.mp4’
[BaseDriver] Shutting down because we waited 300 seconds for a command
[debug] [UiAutomator2] Deleting UiAutomator2 session
[Appium] Closing session, cause was ‘New Command Timeout of 300 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session b897da02-833d-4d24-aa45-ee0c050ca7bc from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched ‘/’ to command name ‘deleteSession’
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:51550/wd/hub/session/0c244570-7e94-4c96-ae04-f5875e32d9dd] with no body
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“0c244570-7e94-4c96-ae04-f5875e32d9dd”,“value”:null}
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell am force-stop apps.rummycircle.com.mobilerummy’
[debug] [Instrumentation] .
[debug] [Instrumentation] Time: 453.248
[debug] [Instrumentation]
[debug] [Instrumentation] OK (1 test)
[debug] [Instrumentation] The process has exited with code 0
2020-03-12 12:29:20 INFO WebSocketMessageReceiver:35 - [NOT_YET_SET] - Server got closed , error code ‘1006’ and reason ‘Disconnected’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 51550
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L forward --remove tcp:51550’
[debug] [AndroidDriver] The overall screen recording duration is 544s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583996456227.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996456227.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996456227.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 726s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583996637618.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996637618.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996637618.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 907s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583996818974.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996818974.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583996818974.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 1089s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583997000409.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997000409.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997000409.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 1270s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583997181651.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997181651.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997181651.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 1451s so far
[debug] [AndroidDriver] Starting the next 180s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 180 /sdcard/1583997362937.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997362937.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997362937.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 1632s so far
[debug] [AndroidDriver] Starting the next 168s-chunk of screen recording in order to achieve 1800s total duration
[debug] [ADB] Building screenrecord process with the command line: adb -P 5037 -s HNB3KA2L shell screenrecord --time-limit 168 /sdcard/1583997544164.mp4
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997544164.mp4’
[debug] [ADB] Running ‘/Users/metali/Library/Android/sdk/platform-tools/adb -P 5037 -s HNB3KA2L shell ls /sdcard/1583997544164.mp4’
[debug] [AndroidDriver] The overall screen recording duration is 1802s so far
[debug] [AndroidDriver] There is no need to start the next recording chunk

There is exception “Exception occurred while trying to close the client”

why not to stop recording before driver quit?

@Aleksei how i will get to know when driver is quit?

it getting quit:

  1. automatically after idle. 60sec default. you can increase this time.
  2. when you do driver.quite() or close().