Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't start session Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Dor-B\AppData\Local\Temp\espresso-server-emulator-5554'. #898

Open
Dor-bl opened this issue Aug 9, 2023 · 2 comments

Comments

@Dor-bl
Copy link

Dor-bl commented Aug 9, 2023

Trying to start the session with appium 2.0.1 using Espresso driver v2.25.0

LOGS:

`[debug] [Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-espresso-driver
[AppiumDriver@ace2] Appium v2.0.1 creating new EspressoDriver (v2.25.0) session
[AppiumDriver@ace2] Checking BaseDriver versions for Appium and EspressoDriver
[AppiumDriver@ace2] Appium's BaseDriver version is 9.3.16
[AppiumDriver@ace2] EspressoDriver's BaseDriver version is 9.3.16
[debug] [EspressoDriver@5cc5] Creating session with W3C capabilities: {
[debug] [EspressoDriver@5cc5]   "alwaysMatch": {
[debug] [EspressoDriver@5cc5]     "platformName": "Android",
[debug] [EspressoDriver@5cc5]     "appium:app": "C:\\Users\\Dor-B\\AppData\\Local\\Temp\\ApiDemos-debug.apk",
[debug] [EspressoDriver@5cc5]     "appium:automationName": "Espresso",
[debug] [EspressoDriver@5cc5]     "appium:deviceName": "Android Emulator",
[debug] [EspressoDriver@5cc5]     "appium:forceEspressoRebuild": true
[debug] [EspressoDriver@5cc5]   },
[debug] [EspressoDriver@5cc5]   "firstMatch": [
[debug] [EspressoDriver@5cc5]     {}
[debug] [EspressoDriver@5cc5]   ]
[debug] [EspressoDriver@5cc5] }
[EspressoDriver@5cc5] The following capabilities were provided, but are not recognized by Appium:
[EspressoDriver@5cc5]   deviceName
[EspressoDriver@5cc5 (7a0c6d04)] Session created with session id: 7a0c6d04-00ec-4432-9ecf-cbf7c2b272d2
[ADB] Using 'adb.exe' from 'E:\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'E:\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[debug] [ADB] Setting device id to emulator-5554
[BaseDriver] Using local app 'C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk'
[debug] [ADB] Checking app cert for C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk
[ADB] Using 'apksigner.jar' from 'E:\Android\Sdk\build-tools\34.0.0-rc1\lib\apksigner.jar'
[debug] [ADB] Starting apksigner: 'E:\\Program Files\\Java\\jdk-17.0.1\\bin\\java.exe' -Xmx1024M -Xss1m -jar E:\\Android\\Sdk\\build-tools\\34.0.0-rc1\\lib\\apksigner.jar verify --print-certs C:\\Users\\Dor-B\\AppData\\Local\\Temp\\ApiDemos-debug.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: 39574adf47ea32d5c831fdfbbf53610f7bfed038da756c057b1593609e364b74
[debug] [ADB] Signer #1 certificate SHA-1 digest: 160d66dd08ab9e3a0a565c9828647b6a14c5b34a
[debug] [ADB] Signer #1 certificate MD5 digest: ffab052b334140ba00f3fb5ae73ad92f
[debug] [ADB]
[ADB] 'C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk' is signed with a non-default certificate
[ADB] Using 'zipalign.exe' from 'E:\Android\Sdk\build-tools\34.0.0-rc1\zipalign.exe'
[debug] [ADB] C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing 'C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk' with default cert
[debug] [ADB] Starting apksigner: 'E:\\Program Files\\Java\\jdk-17.0.1\\bin\\java.exe' -Xmx1024M -Xss1m -jar E:\\Android\\Sdk\\build-tools\\34.0.0-rc1\\lib\\apksigner.jar sign --key C:\\Users\\Dor-B\\.appium\\node_modules\\appium-espresso-driver\\node_modules\\appium-adb\\keys\\testkey.pk8 --cert C:\\Users\\Dor-B\\.appium\\node_modules\\appium-espresso-driver\\node_modules\\appium-adb\\keys\\testkey.x509.pem C:\\Users\\Dor-B\\AppData\\Local\\Temp\\ApiDemos-debug.apk
[EspressoDriver@5cc5 (7a0c6d04)] EspressoDriver version: 2.25.0
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 30
[ADB] Getting device platform version
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 11
[debug] [ADB] Device API level: 30
[EspressoDriver@5cc5 (7a0c6d04)] Relaxing hidden api policy
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: 'io.appium.android.apis'
[ADB] Main activity name: 'io.appium.android.apis.ApiDemos'
[debug] [AndroidDriver] Parsed package and activity are: io.appium.android.apis/io.appium.android.apis.ApiDemos
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('5.1.0' >= '5.1.0')
[debug] [ADB] There is no need to install/upgrade 'C:\Users\Dor-B\.appium\node_modules\appium-espresso-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [Logcat] Starting logs capture with command: E:\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global animator_duration_scale'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global transition_animation_scale'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings get global window_animation_scale'
[debug] [EspressoDriver@5cc5 (7a0c6d04)] Window animation is already disabled
[debug] [EspressoDriver@5cc5 (7a0c6d04)] Forwarding Espresso Server port 6791 to 8301
[debug] [ADB] Forwarding system: 8301 to device: 6791
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8301 tcp:6791'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Getting package info for 'io.appium.android.apis'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis'
[debug] [ADB] The version name of the installed 'io.appium.android.apis' is greater or equal to the application version name ('4.1.1' >= '4.1.1')
[debug] [ADB] There is no need to install/upgrade 'C:\Users\Dor-B\AppData\Local\Temp\ApiDemos-debug.apk'
[AndroidDriver] Performing fast reset on 'io.appium.android.apis'
[debug] [ADB] Getting install status for io.appium.android.apis
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm path io.appium.android.apis'
[debug] [ADB] 'io.appium.android.apis' is installed
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.android.apis'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm clear io.appium.android.apis'
[debug] [AndroidDriver] Performed fast reset on the installed 'io.appium.android.apis' application (stop and clear)
[debug] [EspressoDriver@5cc5 (7a0c6d04)] 'forceEspressoRebuild' capability is enabled
[EspressoDriver@5cc5 (7a0c6d04)] Building espresso server in 'C:\Users\Dor-B\AppData\Local\Temp\espresso-server-emulator-5554'
[debug] [EspressoDriver@5cc5 (7a0c6d04)] The build folder root could be customized by changing the 'tmpDir' capability
[debug] [EspressoDriver@5cc5 (7a0c6d04)] Deleting espresso session
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys activity services io.appium.settings/.recorder.RecorderService'
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.android.apis'
[debug] [Logcat] Stopping logcat capture
[EspressoDriver@5cc5 (7a0c6d04)] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [ADB] Removing forwarded port socket connection: 8301
[debug] [ADB] Running 'E:\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8301'
[debug] [AppiumDriver@ace2] Event 'newSessionStarted' logged at 1691618994998 (01:09:54 GMT+0300 (שעון ישראל (קיץ)))
[debug] [AppiumDriver@ace2] Encountered internal error running command: A new session could not be created. Details: EBUSY: resource busy or locked, rmdir 'C:\Users\Dor-B\AppData\Local\Temp\espresso-server-emulator-5554'. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[debug] [AppiumDriver@ace2] Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Dor-B\AppData\Local\Temp\espresso-server-emulator-5554'. Check https://github.com/appium/appium-espresso-driver#troubleshooting regarding advanced session startup troubleshooting.
[HTTP] <-- POST /session 500 26549 ms - 588
[HTTP]
[HTTP] --> GET /status
[HTTP] {}
[debug] [AppiumDriver@ace2] Calling AppiumDriver.getStatus() with args: []
[debug] [AppiumDriver@ace2] Responding to client with driver.getStatus() result: {"build":{"version":"2.0.1"}}
[HTTP] <-- GET /status 200 8 ms - 39`
@KazuCocoa
Copy link
Member

I haven't seen such an error, but probably another task was taking C:\Users\Dor-B\AppData\Local\Temp\espresso-server-emulator-5554...?
Usually gradle task runs to build the espresso server, but maybe something locked the resource. Potentially Win env specific(?)

@Dor-bl
Copy link
Author

Dor-bl commented Aug 10, 2023

@KazuCocoa could be related?
I see this once the appium server start:

`[Appium] Attempting to load driver espresso...
[debug] [Appium] Requiring driver at C:\Users\Dor-B\.appium\node_modules\appium-espresso-driver
(node:37164) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants