Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Exception: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, ..., adb, devices] exited with non-zero code 1 #84

Open
ziem opened this issue Jul 10, 2017 · 8 comments
Assignees

Comments

@ziem
Copy link

ziem commented Jul 10, 2017

Hi,
I decided to give composer a shot and unfortunately, I can't make it work.

After executing:

java -jar composer-0.2.3.jar --apk app/build/outputs/apk/app.apk --test-apk app/build/outputs/apk/app-androidTest.apk --test-package package --test-runner package.MultiDexAndroidJUnitRunner

I receive following errors:

[Mon Jul 10 09:14:25 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /.../2920001465450.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Mon Jul 10 09:14:25 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /.../2917665125786.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Mon Jul 10 09:14:25 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /...2919879561453.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Mon Jul 10 09:14:25 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /.../2919212779445.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Mon Jul 10 09:14:25 CEST 2017]: Error during getting connectedAdbDevices, error = java.lang.IllegalStateException: Process [script, -F, /.../2917033128684.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1
Exception in thread "main" java.lang.IllegalStateException: Process [script, -F, /.../2917033128684.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1
at com.gojuno.commander.os.ProcessesKt$process$1.call(Processes.kt:97)
at com.gojuno.commander.os.ProcessesKt$process$1.call(Processes.kt)
at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:72)
at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:32)
at rx.Observable.unsafeSubscribe(Observable.java:10256)
at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

To make sure that adb works fine, just before running composer, I executed:

adb devices

which printed:

List of devices attached
emulator-5554 device
010a625c2eaab236 device

echo $ANDROID_HOME

/usr/local/share/android-sdk

What am I doing wrong? How to fix it?

@ziem ziem changed the title Exception: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, ..., /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 Exception: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, ..., adb, devices] exited with non-zero code 1 Jul 10, 2017
@artem-zinnatullin
Copy link
Collaborator

artem-zinnatullin commented Jul 17, 2017 via email

@ziem
Copy link
Author

ziem commented Jul 18, 2017

I'm using Android Debug Bridge version 1.0.39 (Revision 3db08f2c6889-android) and Android SDK Tools version 26.0.2.

@artem-zinnatullin
Copy link
Collaborator

Can you please try /usr/local/share/android-sdk/platform-tools/adb devices && echo "Result of adb devices is $?" and post output here?

Thanks!

@ziem
Copy link
Author

ziem commented Jul 27, 2017

Yup:

/usr/local/share/android-sdk/platform-tools/adb devices && echo "Result of adb devices is $?"
List of devices attached
015d24a7f0481811 device
8fa40d7b086c0dea device

Result of adb devices is 0

@artem-zinnatullin
Copy link
Collaborator

Hmm, so it returns successful result code, can you try to launch Composer again please?

Maybe the error is gone now, sometimes (pretty rare though adb server needs to be restarted)

@ziem
Copy link
Author

ziem commented Jul 27, 2017

I added

/usr/local/share/android-sdk/platform-tools/adb devices && echo "Result of adb devices is $?"

to the jenkins job just before:

java -jar composer-0.2.3.jar
--apk $APK_FOLDER/....apk
--test-apk $APK_FOLDER/...-androidTest.apk
--test-package ...
--test-runner ...
--verbose-output true

but unfortunately error is still present. adb devices finishes with 0 but composer still fails 😕.

/usr/local/share/android-sdk/platform-tools/adb devices
List of devices attached
015d24a7f0481811 device
8fa40d7b086c0dea device

echo 'Result of adb devices is 0'
Result of adb devices is 0
java -jar composer-0.2.3.jar --apk app/build/outputs/apk/app.apk --test-apk app/build/outputs/apk/app-androidTest.apk --test-package com.example --test-runner com.example.runner.MultiDexAndroidJUnitRunner --verbose-output true

[Thu Jul 27 08:41:09 CEST 2017]: Args(appApkPath=app/build/outputs/apk/app.apk, testApkPath=app/build/outputs/apk/app-androidTest.apk, testPackage=com.example, testRunner=com.example.runner.MultiDexAndroidJUnitRunner, shard=true, outputDirectory=composer-output, instrumentationArguments=[], verboseOutput=true)
[Thu Jul 27 08:41:10 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469757400581070.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Thu Jul 27 08:41:10 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469759315389809.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Thu Jul 27 08:41:10 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469760256311015.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Thu Jul 27 08:41:10 CEST 2017]: runningEmulators: retrying java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469757814162375.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1 .
[Thu Jul 27 08:41:10 CEST 2017]: Error during getting connectedAdbDevices, error = java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469757628893264.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1
Exception in thread "main" java.lang.IllegalStateException: Process [script, -F, /Users/Shared/Jenkins/Home/workspace/Android app composer/1469757628893264.output, /usr/local/share/android-sdk/platform-tools/adb, devices] exited with non-zero code 1
at com.gojuno.commander.os.ProcessesKt$process$1.call(Processes.kt:97)
at com.gojuno.commander.os.ProcessesKt$process$1.call(Processes.kt)
at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:72)
at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:32)
at rx.Observable.unsafeSubscribe(Observable.java:10256)
at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@artem-zinnatullin
Copy link
Collaborator

Ah, so you're running Composer on macOS… In general it works on macOS, but looks like we're facing some corner case.

To debug it further we need to see output of adb invocation, Composer (and Swarmer) interacts with external tools like adb by invoking them and redirecting output to temporary files $WORKING_DIR/*.output but they're deleted on JVM exit.

You can try to catch them and send us back but that would be tricky since they're deleted on exit…

Or you can wait until we add an option to keep those files #91, but it'll take some time because.

@ziem
Copy link
Author

ziem commented Jul 28, 2017

Yes, I'm running it on macOS - I should've added it to my initial post.

I will try to somehow copy them. Thanks for your help.

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

No branches or pull requests

3 participants