STF STF 启动成功后,总是 Connection closed,有没有人遇到相同情况或者有解决办法的

linpengcheng · 2017年12月11日 · 最后由 linpengcheng 回复于 2020年01月02日 · 2500 次阅读

在 mac 上安装好了 STF 后, 启动服务一些正常,但是每次都会在过了一段时间后就服务挂掉,不知道有没有人有相同的情况。
在链接正常的情况下,插拔手机设备也会报错 server 挂掉。
由于是第一次接触 stf 对于其内部的工作原理不是很了解。

安装的环境如下:

testdeMac-mini:~ test$ stf doctor
2017-12-11T04:27:11.794Z INF/cli:doctor 1190 [*] OS Arch: x64
2017-12-11T04:27:11.796Z INF/cli:doctor 1190 [*] OS Platform: darwin
2017-12-11T04:27:11.797Z INF/cli:doctor 1190 [*] OS Platform: 17.2.0
2017-12-11T04:27:11.797Z INF/cli:doctor 1190 [*] Using Node 8.1.4
2017-12-11T04:27:11.816Z INF/cli:doctor 1190 [*] Using ZeroMQ 4.2.2
2017-12-11T04:27:11.838Z INF/cli:doctor 1190 [*] Using GraphicsMagick 1.3.26
2017-12-11T04:27:11.839Z INF/cli:doctor 1190 [*] Using ProtoBuf 3.5.0
2017-12-11T04:27:11.842Z INF/cli:doctor 1190 [*] Using RethinkDB 2.3.6
2017-12-11T04:27:11.843Z INF/cli:doctor 1190 [*] Using ADB 1.0.39

日志如下:

2017-12-11T03:32:00.025Z INF/provider 834 [*] Providing all 4 device(s)
2017-12-11T03:32:21.990Z INF/auth-mock 835 [::ffff:127.0.0.1] Authenticated "lllll@163.com"
2017-12-11T03:38:02.708Z IMP/device:plugins:service 844 [G2W7N15209049445] Agent connection ended, attempting to relaunch
2017-12-11T03:38:02.708Z INF/device:plugins:service 844 [G2W7N15209049445] Launching service
2017-12-11T03:38:02.709Z INF/provider 834 [*] Lost device "G2W7N15209049445" (device)
2017-12-11T03:38:02.710Z IMP/device:plugins:service 844 [G2W7N15209049445] Service connection ended, attempting to relaunch
2017-12-11T03:38:02.710Z INF/provider 834 [*] Shutting down device worker "G2W7N15209049445"
2017-12-11T03:38:02.710Z INF/device:plugins:service 844 [G2W7N15209049445] Launching service
2017-12-11T03:38:02.711Z WRN/device:plugins:touch 844 [G2W7N15209049445] Shell keeping minitouch running ended unexpectedly
2017-12-11T03:38:02.712Z INF/device:plugins:touch 844 [G2W7N15209049445] Disconnecting from minitouch service
2017-12-11T03:38:02.713Z INF/provider 834 [*] Cleaning up device worker "G2W7N15209049445"
2017-12-11T03:38:02.714Z INF/provider 834 [*] Gracefully killing device worker "G2W7N15209049445"
2017-12-11T03:38:02.717Z FTL/util:lifecycle 844 [G2W7N15209049445] Forward shell ended; we shall share its fate
2017-12-11T03:38:02.719Z FTL/util:lifecycle 844 [G2W7N15209049445] Shutting down due to fatal error
2017-12-11T03:38:02.733Z INF/provider 834 [*] Device worker "G2W7N15209049445" has retired
2017-12-11T03:38:03.053Z FTL/util:lifecycle 846 [5eb2b636] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.054Z FTL/util:lifecycle 843 [0642f8d6f0ec9d1a] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.053Z FTL/util:lifecycle 845 [C4Y5T16810004018] Forward shell ended; we shall share its fate
2017-12-11T03:38:03.054Z FTL/util:lifecycle 846 [5eb2b636] Shutting down due to fatal error
2017-12-11T03:38:03.054Z FTL/util:lifecycle 843 [0642f8d6f0ec9d1a] Shutting down due to fatal error
2017-12-11T03:38:03.054Z FTL/util:lifecycle 845 [C4Y5T16810004018] Shutting down due to fatal error
2017-12-11T03:38:03.058Z FTL/util:lifecycle 834 [*] Tracker had an error Error: Connection closed
    at /usr/local/lib/node_modules/stf/node_modules/.2.11.0@adbkit/lib/adb/tracker.js:21:13
    at tryCatcher (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/util.js:26:23)
    at CatchFilter.doFilter (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/catch_filter.js:40:36)
    at CatchFilter.tryCatcher (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:503:31)
    at Promise._settlePromiseAt (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:577:18)
    at Promise._settlePromises (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/promise.js:693:14)
    at Async._drainQueue (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/usr/local/lib/node_modules/stf/node_modules/.2.9.34@bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
2017-12-11T03:38:03.067Z FTL/util:lifecycle 834 [*] Shutting down due to fatal error
2017-12-11T03:38:03.075Z FTL/cli:local 827 [*] Child process had an error ExitError: Exit code "1"
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
2017-12-11T03:38:03.075Z INF/cli:local 827 [*] Shutting down all child processes
2017-12-11T03:38:03.079Z INF/util:lifecycle 829 [app001] Winding down for graceful exit
2017-12-11T03:38:03.080Z INF/util:lifecycle 830 [dev001] Winding down for graceful exit
2017-12-11T03:38:03.080Z INF/util:lifecycle 831 [proc001] Winding down for graceful exit
2017-12-11T03:38:03.083Z INF/util:lifecycle 832 [proc002] Winding down for graceful exit
2017-12-11T03:38:03.085Z INF/util:lifecycle 833 [reaper001] Winding down for graceful exit
2017-12-11T03:38:03.086Z INF/util:lifecycle 835 [*] Winding down for graceful exit
2017-12-11T03:38:03.086Z INF/auth-mock 835 [*] Waiting for client connections to end
2017-12-11T03:38:03.088Z INF/util:lifecycle 836 [*] Winding down for graceful exit
2017-12-11T03:38:03.090Z INF/util:lifecycle 838 [*] Winding down for graceful exit
2017-12-11T03:38:03.090Z INF/util:lifecycle 837 [*] Winding down for graceful exit
2017-12-11T03:38:03.095Z WRN/db 838 [*] Connection closed
2017-12-11T03:38:03.096Z WRN/db 832 [proc002] Connection closed
2017-12-11T03:38:03.098Z WRN/db 833 [reaper001] Connection closed
2017-12-11T03:38:03.100Z WRN/db 831 [proc001] Connection closed
2017-12-11T03:38:03.102Z WRN/db 836 [*] Connection closed
2017-12-11T03:38:03.111Z WRN/db 837 [*] Connection closed
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 8 条回复 时间 点赞

请问你的问题解决了吗?

homer 回复

换成在 ubuntu 上安装就好了 mac 上的 adb 好像有问题
https://github.com/openstf/stf#requirements
Note that while Mac OS can be used for development, it doesn't provide a very reliable experience in production due to (presumed) bugs in ADB's Mac OS implementation. We use CoreOS but any Linux or BSD distribution should do fine.

linpengcheng 回复

ok,3Q,我也是在 mac 上安装的,遇到同样的问题

我在 ubantu 遇到这个报错了 识别不了我的 usb 连接的真机

段小兰 回复

你好 你的问题解决了嘛

我在 ubuntu 上遇到这个问题,发现是 adb 关闭了导致的,但是 adb 关闭的原因还没有找到

@linpengcheng 楼主,问题解决了没有?目前也遇到该问题, 我在 Ubuntu18.04

ConyFight 回复

现在用了 atx-server2

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册