Experiencing unknown server-side error "Could not proxy command to remote server."
See original GitHub issueHi guys,
Working on a project that runs an End-to-End test on our application that is a Microsoft Word Addin. Essentially the application fires up Word with a particular document, then using Appium to interact with our application trying to verify certain scenarios are working etc.
Our problem is that we continue to run into the following exception during our run:
System.InvalidOperationException: 'An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:4724'
Occurs when the E2E test has been running for a bit.
I have a feeling the way I need to deal with this issue is to catch it and try and re-connect?
If you need any more information please let me know
Appium Server Log
[info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session/6674E9C9-76C6-4E82-957C-519037DC48EC/moveto HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: close [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 50 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {“element”:“42.199450”,“xoffset”:440,“yoffset”:75} [info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 200 OK [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 63 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {“sessionId”:“6674E9C9-76C6-4E82-957C-519037DC48EC”,“status”:0} [debug] [35m[WD Proxy][39m Got response with status 200: {“sessionId”:“6674E9C9-76C6-4E82-957C-519037DC48EC”,“status”:0} [info] [35m[WD Proxy][39m Replacing sessionId 6674E9C9-76C6-4E82-957C-519037DC48EC with 576b44e7-4687-426e-916d-b1f068ff02c0 [info] [35m[HTTP][39m [37m<-- POST /wd/hub/session/576b44e7-4687-426e-916d-b1f068ff02c0/moveto [39m[32m200[39m [90m17 ms - 63[39m [info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m–>[39m [37mPOST[39m [37m/wd/hub/session/576b44e7-4687-426e-916d-b1f068ff02c0/click[39m [info] [35m[HTTP][39m [90m{“button”:0}[39m [info] [35m[MJSONWP (576b44e7)][39m Driver proxy active, passing request on via HTTP proxy [debug] [35m[WD Proxy][39m Matched ‘/wd/hub/session/576b44e7-4687-426e-916d-b1f068ff02c0/click’ to command name ‘clickCurrent’ [debug] [35m[WD Proxy][39m Proxying [POST /wd/hub/session/576b44e7-4687-426e-916d-b1f068ff02c0/click] to [POST http://127.0.0.1:4724/wd/hub/session/6674E9C9-76C6-4E82-957C-519037DC48EC/click] with body: {“button”:0} [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session/6674E9C9-76C6-4E82-957C-519037DC48EC/click HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: close [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 12 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {“button”:0} [warn] [35m[BaseDriver][39m Shutting down because we waited 60 seconds for a command [debug] [35m[WinAppDriver][39m Deleting WinAppDriver session [debug] [35m[WinAppDriver][39m Deleting WinAppDriver server session [debug] [35m[WD Proxy][39m Matched ‘/’ to command name ‘deleteSession’ [debug] [35m[WD Proxy][39m Proxying [DELETE /] to [DELETE http://127.0.0.1:4724/wd/hub/session/5E6D0B6F-831C-47AD-9822-6CD25E12C9B9] with no body [warn] [35m[Appium][39m Closing session, cause was ‘New Command Timeout of 60 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’ [info] [35m[Appium][39m Removing session 115b55af-b9cd-4d80-8ae0-fd7f6ee17b9e from our master session list
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Ok so I think I have managed to get around this issue.
Essentially I am looping through a list of items on the app, and clicking them in turn. I was using a Thread.Sleep() after clicking to wait for the UI to catch up so I can validate the result. This seemed like it was throwing the communication out of sync with the Appium server. The way I am approaching it is to use Selenium Wait.Until() method.
So originally I was doing something like this:
However now doing this:
For now this seems to be working a treat. However I would still love to know if the “Could not proxy command…” is related to the use of the heavy handed Thread.Sleep(). Any insights?
Ignore this, just a case of RTFM in the ReadMe section of this repo. Was on Mobile before now back on laptop