openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.4k stars 2.8k forks source link

Sharp B10 not working #1119

Open wolph opened 5 years ago

wolph commented 5 years ago

What is the issue or idea you have?

The installation of the STF software on the Sharp B10 ends up in an infinite loop:

stf-local_1  | 2019-10-23T23:44:58.786Z FTL/device 26538 [B10<some-unique-id>] Setup had an error Error: Service had an error: "Error: Not found; no service started."
stf-local_1  |     at /app/lib/units/device/plugins/service.js:101:23
stf-local_1  | From previous event:
stf-local_1  |     at /app/lib/units/device/plugins/service.js:76:14
stf-local_1  |     at runCallback (timers.js:672:20)
stf-local_1  |     at tryOnImmediate (timers.js:645:5)
stf-local_1  |     at processImmediate [as _immediateCallback] (timers.js:617:5)
stf-local_1  | 2019-10-23T23:44:58.787Z FTL/util:lifecycle 26538 [B10<some-unique-id>] Shutting down due to fatal error
stf-local_1  | 2019-10-23T23:44:58.791Z INF/provider 42 [*] Cleaning up device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:44:58.791Z ERR/provider 42 [*] Device worker "B10<some-unique-id>" died with code 1
stf-local_1  | 2019-10-23T23:44:58.791Z INF/provider 42 [*] Restarting device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:44:59.694Z INF/device:support:push 26550 [B10<some-unique-id>] Sending output to "tcp://127.0.0.1:7116"
stf-local_1  | 2019-10-23T23:44:59.697Z INF/device 26550 [B10<some-unique-id>] Preparing device
stf-local_1  | 2019-10-23T23:45:00.055Z INF/device:support:sub 26550 [B10<some-unique-id>] Receiving input from "tcp://127.0.0.1:7114"
stf-local_1  | 2019-10-23T23:45:00.056Z INF/device:support:sub 26550 [B10<some-unique-id>] Subscribing to permanent channel "*ALL"
stf-local_1  | 2019-10-23T23:45:00.120Z INF/device:support:properties 26550 [B10<some-unique-id>] Loading properties
stf-local_1  | 2019-10-23T23:45:00.176Z INF/device:support:sdk 26550 [B10<some-unique-id>] Supports SDK 24
stf-local_1  | 2019-10-23T23:45:00.176Z INF/provider 42 [*] Providing 1 of 2 device(s); waiting for "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:00.177Z INF/device:support:abi 26550 [B10<some-unique-id>] Supports ABIs arm64-v8a, armeabi-v7a, armeabi
stf-local_1  | 2019-10-23T23:45:00.285Z INF/device:resources:minicap 26550 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/bin/minicap" as "/data/local/tmp/minicap"
stf-local_1  | 2019-10-23T23:45:00.286Z INF/device:resources:minicap 26550 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/lib/android-24/minicap.so" as "/data/local/tmp/minicap.so"
stf-local_1  | 2019-10-23T23:45:00.421Z INF/device:resources:service 26550 [B10<some-unique-id>] Checking whether we need to install STFService
stf-local_1  | 2019-10-23T23:45:01.478Z INF/device:resources:service 26550 [B10<some-unique-id>] Running version check
stf-local_1  | 2019-10-23T23:45:02.562Z INF/device:resources:service 26550 [B10<some-unique-id>] STFService up to date
stf-local_1  | 2019-10-23T23:45:02.564Z INF/device:plugins:service 26550 [B10<some-unique-id>] Launching agent
stf-local_1  | 2019-10-23T23:45:03.758Z INF/device:plugins:service 26550 [B10<some-unique-id>] Launching service
stf-local_1  | 2019-10-23T23:45:03.794Z INF/device:plugins:service 26550 [B10<some-unique-id>] Agent says: "Listening on @stfagent"
stf-local_1  | 2019-10-23T23:45:03.795Z INF/device:plugins:service 26550 [B10<some-unique-id>] Agent says: "InputClient started"
stf-local_1  | 2019-10-23T23:45:04.786Z FTL/device 26550 [B10<some-unique-id>] Setup had an error Error: Service had an error: "Error: Not found; no service started."
stf-local_1  |     at /app/lib/units/device/plugins/service.js:101:23
stf-local_1  | From previous event:
stf-local_1  |     at /app/lib/units/device/plugins/service.js:76:14
stf-local_1  |     at runCallback (timers.js:672:20)
stf-local_1  |     at tryOnImmediate (timers.js:645:5)
stf-local_1  |     at processImmediate [as _immediateCallback] (timers.js:617:5)
stf-local_1  | 2019-10-23T23:45:04.787Z FTL/util:lifecycle 26550 [B10<some-unique-id>] Shutting down due to fatal error
stf-local_1  | 2019-10-23T23:45:04.792Z INF/provider 42 [*] Cleaning up device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:04.793Z ERR/provider 42 [*] Device worker "B10<some-unique-id>" died with code 1
stf-local_1  | 2019-10-23T23:45:04.793Z INF/provider 42 [*] Restarting device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:05.680Z INF/device:support:push 26562 [B10<some-unique-id>] Sending output to "tcp://127.0.0.1:7116"
stf-local_1  | 2019-10-23T23:45:05.683Z INF/device 26562 [B10<some-unique-id>] Preparing device
stf-local_1  | 2019-10-23T23:45:06.044Z INF/device:support:sub 26562 [B10<some-unique-id>] Receiving input from "tcp://127.0.0.1:7114"
stf-local_1  | 2019-10-23T23:45:06.046Z INF/device:support:sub 26562 [B10<some-unique-id>] Subscribing to permanent channel "*ALL"
stf-local_1  | 2019-10-23T23:45:06.113Z INF/device:support:properties 26562 [B10<some-unique-id>] Loading properties
stf-local_1  | 2019-10-23T23:45:06.174Z INF/device:support:sdk 26562 [B10<some-unique-id>] Supports SDK 24
stf-local_1  | 2019-10-23T23:45:06.175Z INF/device:support:abi 26562 [B10<some-unique-id>] Supports ABIs arm64-v8a, armeabi-v7a, armeabi
stf-local_1  | 2019-10-23T23:45:06.302Z INF/device:resources:minicap 26562 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/bin/minicap" as "/data/local/tmp/minicap"
stf-local_1  | 2019-10-23T23:45:06.303Z INF/device:resources:minicap 26562 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/lib/android-24/minicap.so" as "/data/local/tmp/minicap.so"
stf-local_1  | 2019-10-23T23:45:06.444Z INF/device:resources:service 26562 [B10<some-unique-id>] Checking whether we need to install STFService
stf-local_1  | 2019-10-23T23:45:07.761Z INF/device:resources:service 26562 [B10<some-unique-id>] Running version check
stf-local_1  | 2019-10-23T23:45:08.966Z INF/device:resources:service 26562 [B10<some-unique-id>] STFService up to date
stf-local_1  | 2019-10-23T23:45:08.968Z INF/device:plugins:service 26562 [B10<some-unique-id>] Launching agent
stf-local_1  | 2019-10-23T23:45:10.167Z INF/device:plugins:service 26562 [B10<some-unique-id>] Launching service
stf-local_1  | 2019-10-23T23:45:10.179Z INF/provider 42 [*] Providing 1 of 2 device(s); waiting for "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:10.182Z INF/device:plugins:service 26562 [B10<some-unique-id>] Agent says: "Listening on @stfagent"
stf-local_1  | 2019-10-23T23:45:10.187Z INF/device:plugins:service 26562 [B10<some-unique-id>] Agent says: "InputClient started"
stf-local_1  | 2019-10-23T23:45:11.229Z FTL/device 26562 [B10<some-unique-id>] Setup had an error Error: Service had an error: "Error: Not found; no service started."
stf-local_1  |     at /app/lib/units/device/plugins/service.js:101:23
stf-local_1  | From previous event:
stf-local_1  |     at /app/lib/units/device/plugins/service.js:76:14
stf-local_1  |     at runCallback (timers.js:672:20)
stf-local_1  |     at tryOnImmediate (timers.js:645:5)
stf-local_1  |     at processImmediate [as _immediateCallback] (timers.js:617:5)
stf-local_1  | 2019-10-23T23:45:11.230Z FTL/util:lifecycle 26562 [B10<some-unique-id>] Shutting down due to fatal error
stf-local_1  | 2019-10-23T23:45:11.235Z INF/provider 42 [*] Cleaning up device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:11.235Z ERR/provider 42 [*] Device worker "B10<some-unique-id>" died with code 1
stf-local_1  | 2019-10-23T23:45:11.235Z INF/provider 42 [*] Restarting device worker "B10<some-unique-id>"
stf-local_1  | 2019-10-23T23:45:12.151Z INF/device:support:push 26574 [B10<some-unique-id>] Sending output to "tcp://127.0.0.1:7116"
stf-local_1  | 2019-10-23T23:45:12.155Z INF/device 26574 [B10<some-unique-id>] Preparing device
stf-local_1  | 2019-10-23T23:45:12.509Z INF/device:support:sub 26574 [B10<some-unique-id>] Receiving input from "tcp://127.0.0.1:7114"
stf-local_1  | 2019-10-23T23:45:12.510Z INF/device:support:sub 26574 [B10<some-unique-id>] Subscribing to permanent channel "*ALL"
stf-local_1  | 2019-10-23T23:45:12.573Z INF/device:support:properties 26574 [B10<some-unique-id>] Loading properties
stf-local_1  | 2019-10-23T23:45:12.632Z INF/device:support:sdk 26574 [B10<some-unique-id>] Supports SDK 24
stf-local_1  | 2019-10-23T23:45:12.632Z INF/device:support:abi 26574 [B10<some-unique-id>] Supports ABIs arm64-v8a, armeabi-v7a, armeabi
stf-local_1  | 2019-10-23T23:45:12.738Z INF/device:resources:minicap 26574 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/bin/minicap" as "/data/local/tmp/minicap"
stf-local_1  | 2019-10-23T23:45:12.739Z INF/device:resources:minicap 26574 [B10<some-unique-id>] Installing "/app/node_modules/minicap-prebuilt/prebuilt/arm64-v8a/lib/android-24/minicap.so" as "/data/local/tmp/minicap.so"
stf-local_1  | 2019-10-23T23:45:12.883Z INF/device:resources:service 26574 [B10<some-unique-id>] Checking whether we need to install STFService
stf-local_1  | 2019-10-23T23:45:13.929Z INF/device:resources:service 26574 [B10<some-unique-id>] Running version check
stf-local_1  | 2019-10-23T23:45:15.352Z INF/device:resources:service 26574 [B10<some-unique-id>] STFService up to date
stf-local_1  | 2019-10-23T23:45:15.354Z INF/device:plugins:service 26574 [B10<some-unique-id>] Launching agent
stf-local_1  | 2019-10-23T23:45:16.596Z INF/device:plugins:service 26574 [B10<some-unique-id>] Agent says: "Listening on @stfagent"
stf-local_1  | 2019-10-23T23:45:16.606Z INF/device:plugins:service 26574 [B10<some-unique-id>] Launching service
stf-local_1  | 2019-10-23T23:45:16.611Z INF/device:plugins:service 26574 [B10<some-unique-id>] Agent says: "InputClient started"

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row.

Yes, other devices work fine

B10<some-unique-id>       device usb:1-2 product:SH-A01 model:SH_A01 device:SH-A01 transport_id:6

Please provide the steps to reproduce the issue.

Connect the phone

What is the expected behavior?

A fully connected phone

Do you see errors or warnings in the stf local output? If so, please paste them or the full log here.

See the output above

Please run stf doctor and paste the output here.

·
2019-10-23T23:53:15.951Z INF/cli:doctor 57050 [*] OS Arch: x64                                                                                                                                                                                                                  │·····················································································································································
2019-10-23T23:53:15.952Z INF/cli:doctor 57050 [*] OS Platform: linux                                                                                                                                                                                                            │·····················································································································································
2019-10-23T23:53:15.953Z INF/cli:doctor 57050 [*] OS Platform: 4.4.0-128-generic                                                                                                                                                                                                │·····················································································································································
2019-10-23T23:53:15.953Z INF/cli:doctor 57050 [*] Using Node 8.10.0                                                                                                                                                                                                             │·····················································································································································
2019-10-23T23:53:15.964Z INF/cli:doctor 57050 [*] Using ZeroMQ 4.2.5                                                                                                                                                                                                            │·····················································································································································
2019-10-23T23:53:15.977Z INF/cli:doctor 57050 [*] Using GraphicsMagick 1.3.28                                                                                                                                                                                                   │·····················································································································································
2019-10-23T23:53:15.977Z INF/cli:doctor 57050 [*] Using ProtoBuf 3.0.0                                                                                                                                                                                                          │·····················································································································································
2019-10-23T23:53:15.977Z ERR/cli:doctor 57050 [*] ADB version cannot be detected                                                                                                                                                                                                │·····················································································································································
2019-10-23T23:53:15.978Z INF/cli:doctor 57050 [*] Using RethinkDB 2.3.7~0bionic  

I should note that I'm running mostly from docker so I'm not sure if the info above is useful. But adb works both locally and in the dockers

issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

wolph commented 5 years ago

A little more info for convenience :)

# adb shell pm list package -3

package:jp.co.cyberagent.stf
package:io.appium.settings
package:io.appium.uiautomator2.server
package:com.google.ar.lens
package:com.google.android.instantapps.supervisor
package:io.appium.uiautomator2.server.test

I can provide a full list, but it's a stock install from Sharp with (as far as I can see) no funky security features enabled. No viru scanners or anything. The STF app is installed and has all permissions I can give it.

The device works perfectly with appium but I want to add it to an STF server for easier usage.

Reinstalling the STF app has no effect. There are no auto-launch settings available anywhere.

And I don't have any install monitoring enabled either: https://github.com/Genymobile/gnirehtet/issues/3#issuecomment-291652499

wolph commented 5 years ago

I've found a workaround. After booting I can open an ADB shell directly from the server where STF is running and enter the following commands:

am start -n jp.co.cyberagent.stf/.IdentityActivity
am startservice  -n jp.co.cyberagent.stf/.Service

Since that only works up to a reboot, it's far from a fix though.

wolph commented 5 years ago

It looks like the issue exists on some other phones as well: https://github.com/nikosch86/stf-poc/blob/master/fix-lava-iris.txt