Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android socket hang up #709

Closed
wilischan opened this issue Sep 28, 2017 · 6 comments
Closed

Android socket hang up #709

wilischan opened this issue Sep 28, 2017 · 6 comments

Comments

@wilischan
Copy link

wilischan commented Sep 28, 2017

  • Macaca Version:
    2.0.10

  • Macaca Doctor Logs:
    macaca-doctor version: 2.0.3

    Node.js checklist:

    node env: /usr/local/bin/node
    node version: v8.1.2

    iOS checklist:

    Xcode Command Line Tools is ready, version: 2347.
    xcodebuild version: 9.0
    iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy
    ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy
    carthage is installed, version: 0.23.0

    Android checklist:

    JAVA version is 1.8.0_131
    JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
    ANDROID_HOME is set to /Users/wilis/Library/Android/sdk
    Platforms is set to /Users/wilis/Library/Android/sdk/platforms/android-25
    ADB tool is set to /Users/wilis/Library/Android/sdk/platform-tools/adb
    gradle is installed, version: 3.5

    Installed driver list:

    android: 2.0.36
    ios: 2.0.24

  • Operate System:
    mac os

  • Programming Language:
    python

调试运行过程中,提示socket hang up
Error: socket hang up
at createHangUpError (_http_client.js:344:15)
at Socket.socketOnEnd (_http_client.js:436:23)
at emitNone (events.js:110:20)
at Socket.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1047:12)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)

@qwezxcjohnny
Copy link

proxy.js:55:14 [master] pid:3340 Proxy: /wd/hub/session/341226a8-58d9-4e94-8e16-f9113f35aab9/element/1/clear:POST to http://127.0.0.1:62925/wd/hub/session/341226a8-58d9-4e94-8e16-f9113f35aab9/element/1/clear:POST with body: {}
uiautomator-client.js:56:14 [master] pid:3340 INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: socket hang up
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
proxy.js:63:22 [master] pid:3340 UIAutomatorWD client proxy error with: Error: read ECONNRESET
responseHandler.js:56:12 [master] pid:3340 Send Error Respone to Client: Error: read ECONNRESET
responseHandler.js:62:14 [master] pid:3340 Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TCP.onread (net.js:568:26)

Error: read ECONNRESET
at exports._errnoException (util.js:1018:11)
at TCP.onread (net.js:568:26)

一样的

@HughLu
Copy link

HughLu commented Sep 29, 2017

@wilischan 我也遇见了这个问题,iosmonkey没法持续自动跑,只能跑10分钟左右,有解决方案不?谢谢!!!

@qichuan
Copy link
Collaborator

qichuan commented Oct 5, 2017

Fixed in UIAutomatorWD 1.0.44, please run npm i macaca-android -g to get the update.

@qichuan qichuan closed this as completed Oct 5, 2017
@wilischan
Copy link
Author

wilischan commented Oct 11, 2017

Thank you @qichuan , but after updating, I met a new issue:

device Info:
Device name: Honor 8 Lite
Android Version: 7.0

Error: Command failed: /Users/wilis/Library/Android/sdk/platform-tools/adb -s BKFDU17418007099 shell "pm install -r "/data/local/tmp/com.macaca.android.testing""
Failure [-26: Package com.macaca.android.testing new target SDK 18 doesn't support runtime permissions but the old target SDK 25 does.]

  at ChildProcess.exithandler (child_process.js:270:12)
  at emitTwo (events.js:125:13)
  at ChildProcess.emit (events.js:213:7)
  at maybeClose (internal/child_process.js:897:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)

[2017-10-11 10:56:36,152: ERROR/PoolWorker-2] Task app.messageMonitors.views.monitorsTask[1542e9b9-0fd0-4c45-bdf9-5af40cef7255] raised unexpected: HTTPError('500 Server Error: Internal Server Error for url: http://127.0.0.1:3456/wd/hub/session',)
Traceback (most recent call last):
File "/Users/wilis/env1/lib/python3.5/site-packages/celery/app/trace.py", line 367, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/wilis/env1/lib/python3.5/site-packages/celery/app/trace.py", line 622, in protected_call
return self.run(*args, **kwargs)
File "/Users/wilis/Job/ucnews-ci/app/messageMonitors/views.py", line 26, in monitorsTask
return notificationMonitor.main()
File "/Users/wilis/Job/ucnews-ci/ucnews_android_MessageMonitorTest/notificationMonitor.py", line 73, in main
interceptor.runTask("TestCase",self.config)
File "/Users/wilis/Job/ucnews-ci/interceptor.py", line 82, in runTask
function()
File "/Users/wilis/Job/ucnews-ci/ucnews_TestCase/TestCase.py", line 41, in start
Drivers(self.config).run(cases)
File "/Users/wilis/Job/ucnews-ci/ucnews_Public/Drivers.py", line 283, in run
self._run_cases(macaca_server.server_url(run.get_port()), devices ,run,cases)
File "/Users/wilis/Job/ucnews-ci/ucnews_Public/Drivers.py", line 126, in _run_cases
driver = self.caseinit(server_url, run)
File "/Users/wilis/Job/ucnews-ci/ucnews_Public/Drivers.py", line 154, in caseinit
driver.init()
File "/Users/wilis/env1/lib/python3.5/site-packages/macaca/util.py", line 145, in fluent_interface
ret = func(instance, *args, **kwargs)
File "/Users/wilis/env1/lib/python3.5/site-packages/macaca/webdriver.py", line 148, in init
}, False)
File "/Users/wilis/env1/lib/python3.5/site-packages/macaca/webdriver.py", line 66, in _execute
res = self.remote_invoker.execute(command, data)
File "/Users/wilis/env1/lib/python3.5/site-packages/macaca/remote_invoker.py", line 110, in execute
return self._request(method, url, body)
File "/Users/wilis/env1/lib/python3.5/site-packages/macaca/remote_invoker.py", line 145, in _request
res.raise_for_status()
File "/Users/wilis/env1/lib/python3.5/site-packages/requests/models.py", line 909, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:3456/wd/hub/session

@mijiawei
Copy link

遇到相似的问题,把Anroid API降回25可以使用。
不过又会经常遇上socket hang up的问题

proxy.js:63:22 [master] pid:89986  UIAutomatorWD client proxy error with: Error: socket hang up

@qichuan
Copy link
Collaborator

qichuan commented Dec 11, 2017

@wilischan for this issue
Failure [-26: Package com.macaca.android.testing new target SDK 18 doesn't support runtime permissions but the old target SDK 25 does.]

Please uninstall the old apps from your test device by the following commands

adb uninstall com.macaca.android.testing.test
adb uninstall com.macaca.android.testing

And run the test again.

@qichuan qichuan added the FAQ label Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants