Getting 500 error "ECONNRESET"

When I run a basic Appium test I’m getting this error log:

[UiAutomator2] Starting UIAutomator2 server 3.5.1
[UiAutomator2] Using UIAutomator2 server from ‘/Users/ajohnson1/.nvm/versions/node/v9.0.0/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v3.5.1.apk’ and test from ‘/Users/ajohnson1/.nvm/versions/node/v9.0.0/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“instrument”,"-w",“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got an unexpected response: {“code”:“ECONNRESET”}
[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[WD Proxy] Got an unexpected response: {“code”:“ECONNRESET”}

The message in Terminal is:
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session.

I’m using Appium version 1.13.0, uiautomator2, testing an Android virtual device created using Android studio. Have you seen this problem before?

@andy1

i was also facing same issue in my office network.
issue resolved after changing to different n/w.
don’t know exact cause

Update: I believe this error was happening as a result of running Android Q on my virtual device. I didn’t get this error on devices running Android Pie.