AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
340 stars 102 forks source link

Use Device of ios real device is EADDRINUSE Error Message #1340

Open erdncyz opened 2 months ago

erdncyz commented 2 months ago

Hi Team,

when ı clicked use device for ios devices ı encounter EADDRINUSE message. This problem is new because this problem didn't yesterday.

My gist : https://gist.github.com/erdncyz/c707fb88f3eb1c08ae21b7021a50e383

Log messag : [DevCon Factory Device Farm] Requesting connection for device 00008030-001445A62E6A802E on local port 63209, device port 63209 [DevCon Factory Device Farm] Cached connections count: 0 [AppiumDriver@845b] Command 'createSession' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["device-farm"]. [AppiumDriver@845b] Encountered internal error running command: Error: listen EADDRINUSE: address already in use :::63209 at Server.setupListenHandle [as _listen2] (node:net:1898:16) at listenInCluster (node:net:1946:12) at Server.this [as listen] (node:net:2044:7) at k.step (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:71:13) at Generator.next () at /Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:8:9 at new Promise () at __awaiter (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:4:12) at k.iproxy (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:33:16) at b.generator (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:193:27) at Generator.next () at S (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/iProxy.js:5:48) [HTTP] <-- POST /wd/hub/session 500 8 ms - 600 [device-farm-main] Received error from remote node: {"message":"Request failed with status code 500","name":"AxiosError","stack":"AxiosError: Request failed with status code 500\n at settle (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/settle.js:19:12)\n at IncomingMessage.handleStreamEnd (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/node_modules/axios/lib/adapters/http.js:599:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at Axios.request (/Users/techqaautomation2/.appium/node_modules/appium-device-farm/node_modules/axios/lib/core/Axios.js:45:41)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http","fetch"],"transformRequest":[null],"transformResponse":[null],"timeout":260000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json","User-Agent":"axios/1.7.5","Content-Length":"1128","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"http://127.0.0.1:4723/wd/hub/session","data":"{\"capabilities\":{\"alwaysMatch\":{\"platformName\":\"iOS\",\"appium:automationName\":\"XCUITest\",\"appium:newCommandTimeout\":120,\"appium:udid\":\"00008030-001445A62E6A802E\",\"df:skipReport\":true,\"appium:mjpegServerPort\":63209,\"appium:waitForQuiescence\":false,\"appium:wdaEventloopIdleDelay\":0,\"appium:eventLoopIdleDelaySec\":0,\"appium:waitForIdleTimeout\":0,\"appium:settings\":{\"mjpegServerFramerate\":34,\"mjpegServerScreenshotQuality\":75,\"mjpegScalingFactor\":100,\"animationCoolOffTimeout\":0}},\"firstMatch\":[{}]},\"desiredCapabilities\":{\"platformName\":\"iOS\",\"appium:automationName\":\"XCUITest\",\"appium:newCommandTimeout\":120,\"appium:udid\":\"00008030-001445A62E6A802E\",\"df:skipReport\":true,\"appium:mjpegServerPort\":63209,\"appium:waitForQuiescence\":false,\"appium:wdaEventloopIdleDelay\":0,\"appium:eventLoopIdleDelaySec\":0,\"appium:waitForIdleTimeout\":0,\"appium:settings\":{\"mjpegServerFramerate\":34,\"mjpegServerScreenshotQuality\":75,\"mjpegScalingFactor\":100,\"animationCoolOffTimeout\":0},\"appium:usePreinstalledWDA\":true,\"appium:updatedWDABundleId\":\"com.facebook.WebDriverAgentRunner.xctrunner\",\"appium:updatedWDABundleIdSuffix\":\"\",\"df:portForward\":true}}"},"code":"ERR_BAD_RESPONSE","status":500} [HTTP] <-- POST /device-farm/api/dashboard/appiumSession 400 13 ms - 630 [HTTP] --> POST /device-farm/api/unblock {"udid":"00008030-001445A62E6A802E","host":"http://172.28.34.26:4723"} [device-farm-main] Received non-webdriver request with url /device-farm/api/unblock. So, not proxying it to downstream.

image image
erdncyz commented 2 months ago

Hi @saikrishna321 @SrinivasanTarget @sudharsan-selvaraj,

Can you help me please. ı still encounter this error.

Original error: listen EADDRINUSE: address already in use :::55191 !!

image

[AppiumDriver@260c] Appium v2.11.3 creating new XCUITestDriver (v7.26.0) session [AppiumDriver@260c] Checking BaseDriver versions for Appium and XCUITestDriver [AppiumDriver@260c] Appium's BaseDriver version is 9.11.3 [AppiumDriver@260c] XCUITestDriver's BaseDriver version is 9.11.3 [XCUITestDriver@aee5] [XCUITestDriver@aee5] Creating session with W3C capabilities: { "alwaysMatch": { "platformName": "ios", "df:liveVideo": true, "df:recordVideo": false, "df:saveDeviceLogs": false, "df:skipReport": false, "df:build": "TOD_IOS-LIVE-05-09-2024", "appium:bundleId": "com.digiturk.tod", "appium:automationName": "XCUITest", "appium:autoAcceptAlerts": "true", "appium:appiumVersion": "2.11.3", "appium:noReset": false, "appium:fullReset": false, "appium:clearSystemFiles": true, "appium:newCommandTimeout": 1800, "appium:udid": "00008030-001445A62E6A802E", "appium:deviceName": "iPhone 11 Pro", "appium:platformVersion": "16.0.3", "appium:wdaLocalPort": 55178, "appium:mjpegServerPort": 55179, "appium:usePreinstalledWDA": true, "appium:updatedWDABundleId": "com.facebook.WebDriverAgentRunner.xctrunner", "appium:updatedWDABundleIdSuffix": "" }, "firstMatch": [ {} ] } [XCUITestDriver@aee5] Capability 'autoAcceptAlerts' changed from string to boolean. This may cause unexpected behavior [XCUITestDriver@aee5] The following provided capabilities were not recognized by this driver: [XCUITestDriver@aee5] df:liveVideo [XCUITestDriver@aee5] df:recordVideo [XCUITestDriver@aee5] df:saveDeviceLogs [XCUITestDriver@aee5] df:skipReport [XCUITestDriver@aee5] df:build [XCUITestDriver@aee5] appiumVersion [a5daa2f6][XCUITestDriver@aee5] Session created with session id: a5daa2f6-915e-441a-a0c0-7361c3addd0a [a5daa2f6][XCUITest] Current user: 'techqaautomation2' [a5daa2f6][XCUITestDriver@aee5] Available real devices: 00008030-000425EC1E04802E, 00008030-001445A62E6A802E, 00008030-001E090C3686802E [a5daa2f6][XCUITestDriver@aee5] Creating iDevice object with udid '00008030-001445A62E6A802E' [a5daa2f6][XCUITestDriver@aee5] Determining device to run tests on: udid: '00008030-001445A62E6A802E', real device: true [a5daa2f6][XCUITestDriver@aee5] Normalized platformVersion capability value '16.0.3' to '16.0' [a5daa2f6][XCUITestDriver@aee5] Event 'xcodeDetailsRetrieved' logged at 1725548026380 (17:53:46 GMT+0300 (GMT+03:00)) [a5daa2f6][XCUITestDriver@aee5] Event 'appConfigured' logged at 1725548026380 (17:53:46 GMT+0300 (GMT+03:00)) [a5daa2f6][XCUITestDriver@aee5] Event 'resetStarted' logged at 1725548026380 (17:53:46 GMT+0300 (GMT+03:00)) [a5daa2f6][XCUITestDriver@aee5] Reset: running ios real device reset flow [a5daa2f6][XCUITestDriver@aee5] Event 'resetComplete' logged at 1725548026380 (17:53:46 GMT+0300 (GMT+03:00)) [a5daa2f6][XCUITestDriver@aee5] Using WDA path: '/Users/techqaautomation2/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent' [a5daa2f6][XCUITestDriver@aee5] Using WDA agent: '/Users/techqaautomation2/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj' [a5daa2f6][XCUITestDriver@aee5] The pyidevice tool is not present in PATH. Skipping crash logs collection for real devices. [a5daa2f6][XCUITestDriver@aee5] Event 'logCaptureStarted' logged at 1725548026494 (17:53:46 GMT+0300 (GMT+03:00)) [a5daa2f6][XCUITestDriver@aee5] Setting up real device [a5daa2f6][XCUITestDriver@aee5] No obsolete cached processes from previous WDA sessions listening on port 55178 have been found [a5daa2f6][DevCon Factory] Requesting connection for device 00008030-001445A62E6A802E on local port 55178, device port 55178 [a5daa2f6][DevCon Factory] Cached connections count: 0 [a5daa2f6][XCUITestDriver@aee5] {"code":"EADDRINUSE","errno":-48,"syscall":"listen","address":"::","port":55178} [a5daa2f6][DevCon Factory] Releasing connections for 00008030-001445A62E6A802E device on any port number

erdncyz commented 1 month ago

Hi team, I researched and talked to Kazu about this error and he made such a comment, I wanted to give you information so that it may be useful to you.

https://github.com/appium/appium-xcuitest-driver/issues/2470