ECONREFUSED/ECONNRESET Problem

Hello guys, I have a huge problem. I have 5 phones connected on my Mac M1 with 16GB RAM through and USB HUB with is also powered to electricity and it connects the hub with an iphone 15 pro max type c cable to hub.. They all are supposed to run great but the problem is they randomly have ECONRESET ISSUES. What could be the reason for that?

Error is: An unknown server-side error ocurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED: 127.0.0.1:8103

[6a5b26f0][XCUITestDriver@5047] Matched ‘/actions’ to command name ‘performActions’
[6a5b26f0][XCUITestDriver@5047] Proxying [POST /actions] to [POST http://127.0.0.1:8104/session/7FC628D7-FAF2-4BF7-9DF9-4843BA195EDC/actions\] with body: {“actions”:[{“type”:“pointer”,“parameters”:{“pointerType”:“touch”},“id”:“touch”,“actions”:[{“type”:“pointerMove”,“duration”:250,“x”:182,“y”:545,“origin”:“viewport”},{“type”:“pointerDown”,“duration”:0,“button”:0},{“type”:“pause”,“duration”:100},{“type”:“pointerMove”,“duration”:250,“x”:179,“y”:297,“origin”:“viewport”},{“type”:“pointerUp”,“duration”:0,“button”:0}]}]}
[6a5b26f0][XCUITestDriver@5047] connect ECONNREFUSED 127.0.0.1:8104
[6a5b26f0][XCUITestDriver@5047] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8104
at JWProxy.command (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:359:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at XCUITestDriver.proxyCommand (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:100:35)
at XCUITestDriver.performActions (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/lib/commands/gesture.js:129:5)
[6a5b26f0][HTTP] ← POST /session/6a5b26f0-b0f3-4a79-9bb7-1d50f03f338e/actions 500 8 ms - 931
[6a5b26f0][HTTP] → POST /session/6a5b26f0-b0f3-4a79-9bb7-1d50f03f338e/actions {“actions”:[{“type”:“pointer”,“parameters”:{“pointerType”:“touch”},“id”:“touch”,“actions”:[{“type”:“pointerMove”,“duration”:250,“x”:182,“y”:545,“origin”:“viewport”},{“type”:“pointerDown”,“duration”:0,“button”:0},{“type”:“pause”,“duration”:100},{“type”:“pointerMove”,“duration”:250,“x”:179,“y”:297,“origin”:“viewport”},{“type”:“pointerUp”,“duration”:0,“button”:0}]}]}
[6a5b26f0][XCUITestDriver@5047] Calling AppiumDriver.performActions() with args: [[{“type”:“pointer”,“parameters”:{“pointerType”:“touch”},“id”:“touch”,“actions”:[{“type”:“pointerMove”,“duration”:250,“x”:182,“y”:545,“origin”:“viewport”},{“type”:“pointerDown”,“duration”:0,“button”:0},{“type”:“pause”,“duration”:100},{“type”:“pointerMove”,“duration”:250,“x”:179,“y”:297,“origin”:“viewport”},{“type”:“pointerUp”,“duration”:0,“button”:0}]}],“6a5b26f0-b0f3-4a79-9bb7-1d50f03f338e”]
[6a5b26f0][XCUITestDriver@5047] Executing command ‘performActions’
[6a5b26f0][XCUITestDriver@5047] Received the following W3C actions: [
{
“type”: “pointer”,
“parameters”: {
“pointerType”: “touch”
},
“id”: “touch”,
“actions”: [
{
“type”: “pointerMove”,
“duration”: 250,
“x”: 182,
“y”: 545,
“origin”: “viewport”
},
{
“type”: “pointerDown”,
“duration”: 0,
“button”: 0
},
{
“type”: “pause”,
“duration”: 100
},
{
“type”: “pointerMove”,
“duration”: 250,
“x”: 179,
“y”: 297,
“origin”: “viewport”
},
{
“type”: “pointerUp”,
“duration”: 0,
“button”: 0
}
]
}
]
[6a5b26f0][XCUITestDriver@5047] Preprocessed actions: [
{
“type”: “pointer”,
“parameters”: {
“pointerType”: “touch”
},
“id”: “touch”,
“actions”: [
{
“type”: “pointerMove”,
“duration”: 250,
“x”: 182,
“y”: 545,
“origin”: “viewport”
},
{
“type”: “pointerDown”,
“duration”: 0,
“button”: 0
},
{
“type”: “pause”,
“duration”: 100
},
{
“type”: “pointerMove”,
“duration”: 250,
“x”: 179,
“y”: 297,
“origin”: “viewport”
},
{
“type”: “pointerUp”,
“duration”: 0,
“button”: 0
}
]
}
]
[6a5b26f0][XCUITestDriver@5047] Matched ‘/actions’ to command name ‘performActions’

[6a5b26f0][XCUITestDriver@5047] Proxying [POST /actions] to [POST http://127.0.0.1:8104/session/7FC628D7-FAF2-4BF7-9DF9-4843BA195EDC/actions\] with body: {“actions”:[{“type”:“pointer”,“parameters”:{“pointerType”:“touch”},“id”:“touch”,“actions”:[{“type”:“pointerMove”,“duration”:250,“x”:182,“y”:545,“origin”:“viewport”},{“type”:“pointerDown”,“duration”:0,“button”:0},{“type”:“pause”,“duration”:100},{“type”:“pointerMove”,“duration”:250,“x”:179,“y”:297,“origin”:“viewport”},{“type”:“pointerUp”,“duration”:0,“button”:0}]}]}
[6a5b26f0][XCUITestDriver@5047] connect ECONNREFUSED 127.0.0.1:8104
[6a5b26f0][XCUITestDriver@5047] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: connect ECONNREFUSED 127.0.0.1:8104
at JWProxy.command (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:359:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at XCUITestDriver.proxyCommand (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:100:35)
at XCUITestDriver.performActions (/Users/willlost/.appium/node_modules/appium-xcuitest-driver/lib/commands/gesture.js:129:5)
[6a5b26f0][HTTP] ← POST /session/6a5b26f0-b0f3-4a79-9bb7-1d50f03f338e/actions 500 6 ms - 931.

I saw this happening to various cheap USB hubs, especially if one connects to many devices to them, so each device does not get enough power.

Consider the following requirements to a USB hub if you plan to use it on a regular basis to run automation on connected devices:

  • High quality components (industrial USB hubs preferable). Don’t save money one them
  • Prefer USB hubs with cooling. Consider putting them into a properly cooled server room otherwise (or maybe both). Overheating might be the source of many problems
  • Consider USB hubs with a separate power source. If the hub contains multiple ports make sure each connected device receives enough power
  • Consider USB3+ hubs. USB2 may be too slow to be used to transfer big data chunks and allow to deliver more power to connected devices. At the same time make sure connected devices support USB3 (many devices don’t, even recent iPhone models). Nevertheless, USB2 devices could still be connected to a USB3 hub.
  • Use high-quality USB cables with proper protection from radio interference and enough power/data throughput
1 Like

I have this. I hope im allowed to post links:

So there can’t be any issue different than the setup?

I use below for 2+ years with macMini m1 and m2. Have very few issues.

Ps just for sure add example of capabilities you use with phones and how you start appium servers.

1 Like

I start appium servers in terminal in different ports:

phone 1 wda port 8100 appium port 4723
phone 2 wda port 8101 appium port 4724
phone 3 wda port 8102 appium port 4725
phone 4 wda port 8103 appium port 4726
phone 5 wda port 8104 appium port 4727

3 phones work correctly, when I start inputting the 4th one and the 5th one they start having randomly errors.

I use similar logic. Just appium ports from 6001, wda from 6101. Have also video port but this is other story.