gpt4 book ai didi

java - 无法将命令代理到远程服务器。原始错误 : Error: read ECONNRESET

转载 作者:行者123 更新时间:2023-12-03 20:15:59 26 4
gpt4 key购买 nike

我无法运行之前运行的自动化脚本。当我尝试在新设备中运行相同的代码时,它工作正常。

Appium 服务器日志

[UiAutomator2] Running command: 'adb -s K3V4C18B16002502 shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' [UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online... [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [UiAutomator2] [UIAutomator2] android.util.AndroidException: INSTRUMENTATION_FAILED: io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner [debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner} [debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS: id=ActivityManagerService [debug] [UiAutomator2] [UIAutomator2] INSTRUMENTATION_STATUS_CODE: -1 [debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Instrument.run(Instrument.java:486) [debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.runInstrument(Am.java:194) [debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.onRun(Am.java:80) [debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.BaseCommand.run(BaseCommand.java:54) [debug] [UiAutomator2] [UIAutomator2] at com.android.commands.am.Am.main(Am.java:50) [debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) [debug] [UiAutomator2] [UIAutomator2] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:371) [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [JSONWP Proxy] Got an unexpected response: {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"} [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [JSONWP Proxy] Matched '/' to command name 'deleteSession' [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id [debug] [UiAutomator2] Resetting IME to 'com.touchtype.swiftkey/com.touchtype.KeyboardService' [debug] [ADB] Running '/Users/infotmt/Library/Android/sdk/platform-tools/adb -P 5037 -s K3V4C18B16002402 shell ime set com.touchtype.swiftkey/com.touchtype.KeyboardService' [debug] [ADB] Running '/Users/infotmt/Library/Android/sdk/platform-tools/adb -P 5037 -s K3V4C18B16002402 shell am force-stop eu.niko.smart.naswi.personalization' [debug] [Logcat] Stopping logcat capture [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running '/Users/infotmt/Library/Android/sdk/platform-tools/adb -P 5037 -s K3V4C18B16002402 forward --remove tcp:8200' [debug] [ADB] Device API level: 28 [UiAutomator2] Restoring hidden api policy to the device default configuration [debug] [ADB] Running '/Users/infotmt/Library/Android/sdk/platform-tools/adb -P 5037 -s K3V4C18B16002402 shell settings delete global hidden_api_policy_pre_p_apps' [debug] [ADB] Running '/Users/infotmt/Library/Android/sdk/platform-tools/adb -P 5037 -s K3V4C18B16002402 shell settings delete global hidden_api_policy_p_apps' [debug] [BaseDriver] Event 'newSessionStarted' logged at 1549963457849 (15:09:17 GMT+0545 (Nepal Time)) [debug] [W3C] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET [debug] [W3C] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:236:13) [HTTP] <-- POST /wd/hub/session 500 50913 ms - 532



Java 错误日志

org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Suban12.local', ip: 'fe80:0:0:0:486:de1:7ae1:b02d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_202' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:236:13) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Suban12.local', ip: 'fe80:0:0:0:486:de1:7ae1:b02d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_202' Driver info: driver.version: AndroidDriver

at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:95) at util.AppiumHelper.setupPersDriver(AppiumHelper.java:74) at test_cases.PersHelper.startPersAppReset(PersHelper.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:648) at org.testng.TestRunner.run(TestRunner.java:505) at org.testng.SuiteRunner.runTest(SuiteRunner.java:455) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415) at org.testng.SuiteRunner.run(SuiteRunner.java:364) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208) at org.testng.TestNG.runSuitesLocally(TestNG.java:1137) at org.testng.TestNG.runSuites(TestNG.java:1049) at org.testng.TestNG.run(TestNG.java:1017) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186) ... 38 more Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Suban12.local', ip: 'fe80:0:0:0:486:de1:7ae1:b02d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_202' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:236:13) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62) at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128) ... 43 more

最佳答案

我找到了这个问题的答案。解决办法是删除 io.appium.uiautomator2.server io.appium.uiautomator2.server.test 从设备。

  • 确保 appium 服务器没有执行。
  • 使用 USB 连接您的 android 设备,同时使用以下命令验证设备是否已正确连接:
    adb devices
  • 执行以下命令:
    adb uninstall io.appium.uiautomator2.server
    adb uninstall io.appium.uiautomator2.server.test
  • 启动 appium 服务器
  • 开始执行 appium 测试用例
  • 关于java - 无法将命令代理到远程服务器。原始错误 : Error: read ECONNRESET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54646837/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com