Error: Chromedriver create session did not work

Could not launch Browser on Android 4.4.2 in the emulator. Here is the log. The main error is:

2014-09-14 18:26:37:477 - error: Chromedriver create session did not work. Status was 200 and body was {“sessionId”:“13e411c1389f8bb5f6ccd85d91523f2e”,“status”:21,“value”:{“message”:“timeout: Adb command timed out after 30 seconds\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.4 x86_64)”}}

How can I fix that?

Was trying to use Google APIs image and just Android 4.4.2 image — nothing helps.

OS X 10.9.4, Appium 1.2.2.

All logs:

2014-09-14 18:26:04:431 - info: [debug] 1 device(s) connected
2014-09-14 18:26:04:432 - info: [debug] 1 emulator(s) connected
2014-09-14 18:26:04:432 - info: [debug] Sending telnet command to device: avd name
2014-09-14 18:26:04:432 - info: [debug] Getting running emulator port

2014-09-14 18:26:04:434 - info: [debug] Socket connection to device created
2014-09-14 18:26:04:434 - info: [debug] Socket connection to device ready
2014-09-14 18:26:04:435 - info: [debug] Telnet command got response: API19_X86_Phone
2014-09-14 18:26:04:435 - info: [debug] Found emulator API19_X86_Phone in port 5554
2014-09-14 18:26:04:435 - info: [debug] Setting device id to emulator-5554
2014-09-14 18:26:04:436 - info: [debug] Waiting until emulator is ready
2014-09-14 18:26:04:436 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “getprop init.svc.bootanim”
2014-09-14 18:26:04:457 - info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
2014-09-14 18:26:04:458 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 wait-for-device
2014-09-14 18:26:04:476 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “echo ‘ready’”

2014-09-14 18:26:04:498 - info: [debug] Starting logcat capture
2014-09-14 18:26:04:517 - info: [debug] Pushing unlock helper app to device…
2014-09-14 18:26:04:518 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 install “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk”

2014-09-14 18:26:05:224 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “dumpsys window”

2014-09-14 18:26:05:272 - info: [debug] Writing dumpsys output to /Applications/Appium.app/Contents/Resources/node_modules/appium/.dumpsys.log

2014-09-14 18:26:05:273 - info: Unlocking screen
2014-09-14 18:26:05:273 - info: [debug] Screen is locked, trying to unlock

2014-09-14 18:26:05:274 - info: [debug] Getting device API level
2014-09-14 18:26:05:274 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “getprop ro.build.version.sdk”

2014-09-14 18:26:05:305 - info: [debug] Device is at API Level 19
2014-09-14 18:26:05:305 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock”

2014-09-14 18:26:06:313 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “dumpsys window”

2014-09-14 18:26:06:349 - info: [debug] Writing dumpsys output to /Applications/Appium.app/Contents/Resources/node_modules/appium/.dumpsys.log

2014-09-14 18:26:06:351 - info: [debug] Screen is unlocked, continuing
2014-09-14 18:26:06:351 - info: [debug] Forwarding system:4724 to device:4724
2014-09-14 18:26:06:351 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 forward tcp:4724 tcp:4724

2014-09-14 18:26:06:370 - info: [debug] Pushing appium bootstrap to device…
2014-09-14 18:26:06:372 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 push “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar” /data/local/tmp/

2014-09-14 18:26:06:428 - info: Starting App
2014-09-14 18:26:06:428 - info: [debug] Attempting to kill all ‘uiautomator’ processes
2014-09-14 18:26:06:428 - info: [debug] Getting all processes with ‘uiautomator’
2014-09-14 18:26:06:429 - info: [debug] executing: “/Users/arikon/projects/sdk/android/platform-tools/adb” -s emulator-5554 shell “ps ‘uiautomator’”

2014-09-14 18:26:06:459 - info: [debug] No matching processes found
2014-09-14 18:26:06:459 - info: [debug] Running bootstrap
2014-09-14 18:26:06:460 - info: [debug] spawning: /Users/arikon/projects/sdk/android/platform-tools/adb -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap

2014-09-14 18:26:06:505 - info: [debug] [UIAUTOMATOR STDOUT] WARNING: linker:
2014-09-14 18:26:06:506 - info: [debug] [UIAUTOMATOR STDOUT] libdvm.so
2014-09-14 18:26:06:506 - info: [debug] [UIAUTOMATOR STDOUT] has text relocations. This is wasting memory and is a security risk. Please fix.

2014-09-14 18:26:06:535 - info: [debug] [UIAUTOMATOR STDOUT] WARNING: linker:
2014-09-14 18:26:06:536 - info: [debug] [UIAUTOMATOR STDOUT] libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.

2014-09-14 18:26:06:653 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1

2014-09-14 18:26:06:654 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
2014-09-14 18:26:06:654 - info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
2014-09-14 18:26:06:654 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
2014-09-14 18:26:06:654 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
2014-09-14 18:26:06:655 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
2014-09-14 18:26:06:655 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
2014-09-14 18:26:06:655 - info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
2014-09-14 18:26:06:660 - info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
2014-09-14 18:26:06:663 - info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
2014-09-14 18:26:06:663 - info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
2014-09-14 18:26:06:667 - info: [debug] [BOOTSTRAP] [debug] Loading json…
2014-09-14 18:26:06:668 - info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
2014-09-14 18:26:06:669 - info: [debug] [BOOTSTRAP] [debug] Client connected
2014-09-14 18:26:06:670 - info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
2014-09-14 18:26:06:670 - info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
2014-09-14 18:26:06:670 - info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
2014-09-14 18:26:06:671 - info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“/data”,“status”:0}
2014-09-14 18:26:06:671 - info: [debug] dataDir set to: /data
2014-09-14 18:26:06:671 - info: [debug] Creating Chrome session

2014-09-14 18:26:06:685 - info: [debug] Set chromedriver binary as: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/chromedriver/mac/chromedriver
2014-09-14 18:26:06:686 - info: [debug] Ensuring Chromedriver exists
2014-09-14 18:26:06:686 - info: [debug] Killing any old chromedrivers, running: ps -ef | grep /Applications/Appium.app/Contents/Resources/node_modules/appium/build/chromedriver/mac/chromedriver | grep -v grep |grep -e ‘–port=9515$’ | awk ‘{ print $2 }’ | xargs kill -15

2014-09-14 18:26:06:729 - info: [debug] Successfully cleaned up old chromedrivers
2014-09-14 18:26:06:729 - info: [debug] Spawning chromedriver with: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/chromedriver/mac/chromedriver
2014-09-14 18:26:06:767 - info: [debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267517) on port 9515
Only local connections are allowed.
2014-09-14 18:26:06:768 - info: [debug] Making http request with opts: {“url”:“http://127.0.0.1:9515/wd/hub/session",“method”:“POST”,“json”:{“sessionId”:null,“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:"emulator-5554”}}}}

2014-09-14 18:26:37:477 - error: Chromedriver create session did not work. Status was 200 and body was {“sessionId”:“13e411c1389f8bb5f6ccd85d91523f2e”,“status”:21,“value”:{“message”:“timeout: Adb command timed out after 30 seconds\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.4 x86_64)”}}

2014-09-14 18:26:37:477 - info: [debug] Cleaning up appium session

2014-09-14 18:26:37:478 - error: Failed to start an Appium session, err was: Error: Did not get session redirect from Chromedriver

2014-09-14 18:26:37:479 - info: [debug] Error: Did not get session redirect from Chromedriver
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/chromedriver.js:220:12)
at Request._callback (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:116:5)
at Request.self.callback (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/request/request.js:121:22)
at Request.emit (events.js:98:17)
at Request. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/request/request.js:985:14)
at Request.emit (events.js:117:20)
at IncomingMessage. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/request/request.js:936:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickDomainCallback (node.js:463:13)
2014-09-14 18:26:37:479 - info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Did not get session redirect from Chromedriver)”,“origValue”:“Did not get session redirect from Chromedriver”},“sessionId”:null}

May be this correlates with issue: https://github.com/appium/appium/issues/2841

@arikon

I had the same problem with the chromedriver version provided by appium.
Try using chromedriver v2.3 .
It worked for me. Also remove the chromedriver.exe from task manager if present.

Cheers

@Ram & @arikon

How does one override the ChromeDriver version provided by Appium? I’m running into similar issue with ChromeDriver and Appium 1.2.2 (reference Chrome not reachable error)

@rstagner

Go to this folder and replace the chromedriver in the respective folder of your operating system there with whichever version you want

—> Appium\node_modules\appium\build\chromedriver\

Hi,
I have also run into same issue on MAc 10.9.5 running Nexus 10 Genymotion emulator with Android version 4.4.4.

I am using Downloaded Appium app version : 1.3.1
Can some one explain in more detail how do we solve this.

JFYI - same issue been tracked here as well - https://code.google.com/p/chromedriver/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Pri%20Owner%20Summary&groupby=&sort=&id=845

Hi @RamS - Is there any other way to skip this issue??

Hi @PRABU90,
I could get my current test case working with Appium upgrade to 1.3.1 and Java client to 1.6.3
Not sure if this has solved the main problem. Once I start working more on WebView, I will get clear picture. I will keep u posted on my findings.

Hi @Ram:
This issue gets resolved when i updated with latest chromedriver(v2.12). I’m also using the Appium v1.3.1 and java client v1.6.1. I can able to access the webviews in my hybrid application.

1 Like

Hi Ram ,
Can u please send me steps how to resolve this issue.can u please give briefly info if possible

@Jagatheskmp Is this sufficient information?

Sorry.I am new to appium chromedriver(v2.12) this is device chrome driver or system.i am confusing here.i am using Appium v1.3.1

Hi prabu,
Can u please give steps to update chromedriver.

@Jagatheskmp

You can download the most recent version here:
https://sites.google.com/a/chromium.org/chromedriver/downloads

Put it in your appium/build/chromedriver directory.

Hi Mason,
Thanks a lot…I have downloaded chrome driver…where i can find the path appium/build/chromedriver

It’ll be wherever Appium is installed on your machine and that depends on your OS. You could try searching for a directory called “chromedriver”.

Hi Mason/Ram,
Thanks you very much…working fine now…

1 Like

Hi Mason/Ram,
I am not getting webview context in android version 4.3.Can u please give me solution for this.

Please give me solution for the above