DeviceFarmer / stf

Control and manage Android devices from your browser.
https://devicefarmer.github.io
Other
3.51k stars 496 forks source link

20~30 minutes after connecting to the stf device...?If there is no mouse or keyboard input, stf terminate #748

Closed QA-Jihyun closed 10 months ago

QA-Jihyun commented 10 months ago

I'm trying to use stf on mac.

rethinkdb --bind all

sudo /usr/libexec/slapd -h ldap://111.222.333.444 -d 50

sudo stf local --port 8100 --public-ip 111.222.333.444 --auth-type ldap --auth-options '["--ldap-url","ldap://111.222.333.444","--ldap-search-dn","dc=test,dc=com","--ldap-bind-dn","cn=admin,dc=test,dc=com","--ldap-bind-credentials","!@test34","--ldap-search-field","email","--ldap-username-field","email"]'

20 minutes after connecting to the stf device...? 30 minutes..? If there is no mouse or keyboard input, stf terminates.

stf log like is

'''

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. (/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 '''

QA-Jihyun commented 10 months ago

same '''stf local'''

mit4ever commented 10 months ago

Do you use Docker? The best way is to use on linux.

denis99999 commented 10 months ago

@QA-Jihyun , look at --group-timeout option, default value is 15 mn

QA-Jihyun commented 10 months ago

@QA-Jihyun , look at --group-timeout option, default value is 15 mn

@denis99999 tx! 'stf local' Your solution is perfect.

but... 'stf local --auth-ldap' is same result(15min shutdown....)

image

After executing stf, 'TimeoutOverflowWarning' continues to appear in the log. This is something that can't be helped, right?

QA-Jihyun commented 10 months ago

@denis99999 Saving screenshots fails in Android 12 and Android 13. Do you know why? need a nginx? or android permission denied?(rooting?)

https://github.com/DeviceFarmer/stf/issues/745

hanseul-Choi commented 10 months ago

what is your mac os version?

Sometimes older mac os versions cause problems.

QA-Jihyun commented 10 months ago

what is your mac os version?

Sometimes older mac os versions cause problems.

i'm mac : sonoma / 14.2.1(23C71)

QA-Jihyun commented 10 months ago

@hanseul-Choi STF가 LDAP와 연결된 후에도 15분 후 셧다운되는 문제는 해결되었습니다. 하지만 스크린샷 저장 문제는 npm install/npm link문제로 추측하고 있습니다. ㅜ (npm install 시 '23 vulnerabilities (16 moderate, 4 high, 3 critical)' 발생....)

답변 주셔서 감사합니다.

denis99999 commented 10 months ago

@QA-Jihyun

After executing stf, 'TimeoutOverflowWarning' continues to appear in the log. This is something that can't be helped, right?

The value you provided is too big, you must provide a value in seconds, for example 36000 (10 hours) is generally good to reserve a device for a work day!

Saving screenshots fails in Android 12 and Android 13. Do you know why?

It works fine in Android 12+, perhaps you have a file permission issue in your STF host..

And please communicate in English only!

QA-Jihyun commented 10 months ago

@QA-Jihyun

After executing stf, 'TimeoutOverflowWarning' continues to appear in the log. This is something that can't be helped, right?

The value you provided is too big, you must provide a value in seconds, for example 36000 (10 hours) is generally good to reserve a device for a work day!

Saving screenshots fails in Android 12 and Android 13. Do you know why?

It works fine in Android 12+, perhaps you have a file permission issue in your STF host..

And please communicate in English only!

eng ok.. sorry

Can you guide me how to setup stf host in mac?

mit4ever commented 10 months ago

@QA-Jihyun

Why do not you try docker + ubuntu

I tried it on mac for a long time but encountered many problems, don't try to optimize it on mac

Thanks

QA-Jihyun commented 10 months ago

Why do not you try docker + ubuntu

I tried it on mac for a long time but encountered many problems, don't try to optimize it on mac

Thanks

i tried vm ubuntu.. but install fail(fatal error)

And I'm thinking of setting up iOS stf on Mac soon.

denis99999 commented 10 months ago

Can you guide me how to setup stf host in mac?

Mac OS is not officially supported, you should rather use Linux and Docker rather than trying to build STF, it all works fine following the instructions in the README.md and DEVELOPMENT.md documentation

QA-Jihyun commented 10 months ago

Can you guide me how to setup stf host in mac?

Mac OS is not officially supported, you should rather use Linux and Docker rather than trying to build STF, it all works fine following the instructions in the README.md and DEVELOPMENT.md documentation

very sad...

After checking several issues and questions, I know that Mac is not supported. But I'm up for the challenge...

denis99999 commented 10 months ago

After checking several issues and questions, I know that Mac is not supported. But I'm up for the challenge...

I mean it is not recommended in production mode (but it works, I use it sometimes in test mode), and if you want to deploy STF on Mac I recommend you to use Docker images of STF (for ARM or x86_64 architectures) which work well!

QA-Jihyun commented 10 months ago

denis99999

thank you MAC An error that appears to be a dependency issue in docker has been resolved. However, when connecting stf and android using wifi and adb connect, commands (touch, etc.) are very slow, so I think I will have to solve this part. Thanks again!