[🐛 Bug]: Node can't connect to Grid hub from version 4.14.0 (Error checking service status http://localhost:4723/status)
What happened?
From version 4.14.0 node can't connect to hub ( checked on 4.10, 4.13 ,4.14.0, 4.14.1, 4.16.1, selenium-server-4.17.0-SNAPSHOT). it works on 4.13 and below.
from browser run link "http://localhost:4723/status"- {"value":{"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1"}}}
node window result:
.@ Grid % java -jar selenium-server-4.16.1.jar node --config node4.toml
15:48:48.216 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
15:48:48.220 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
15:48:48.268 INFO [UnboundZmqEventBus.
How can we reproduce the issue?
java version "21.0.2" (same with "20.0.2")
grid - 4.16.1 (also checked selenium-server-4.17.0-SNAPSHOT, and 4.15)
Appium v2.4.1
1. Run hub "sudo java -jar selenium-server-4.16.1.jar hub"
2. Run node "java -jar selenium-server-4.16.1.jar node --config node4.toml"
# node4.toml
[server]
port = 5557
[node]
detect-drivers = false
[relay]
# Default Appium/Cloud server endpoint
url = "http://localhost:4723"
status-endpoint = "/status"
configs = ["1", "{\"platformName\": \"Android\", \"appium:platformVersion\": \"13\", \"appium:deviceName\": \"Pixar 5а\", \"appium:automationName\": \"UiAutomator2\"}",
"1", "{\"platformName\": \"Android\", \"appium:platformVersion\": \"13\", \"appium:deviceName\": \"Pixar 4\", \"appium:automationName\": \"UiAutomator2\"}"]
Relevant log output
____._____@_________ Grid % java -jar selenium-server-4.16.1.jar node --config node4.toml
15:48:48.216 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
15:48:48.220 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
15:48:48.268 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://0.0.0.0:4442 and tcp://0.0.0.0:4443
15:48:48.289 INFO [UnboundZmqEventBus.<init>] - Sockets created
15:48:49.295 INFO [UnboundZmqEventBus.<init>] - Event bus ready
15:48:49.393 INFO [NodeServer.createHandlers] - Reporting self as: http://192.168.1.144:5557
15:48:49.403 INFO [NodeOptions.getSessionFactories] - Detected 10 available processors
15:48:49.411 INFO [RelayOptions.getSessionFactories] - Adding relay configs for http://localhost:4723
15:48:49.415 INFO [RelayOptions.lambda$getSessionFactories$1] - Mapping Capabilities {appium:automationName: UiAutomator2, appium:deviceName: Pixar 5а, appium:platformVersion: 13, platformName: ANDROID}, 1 times
15:48:49.415 INFO [RelayOptions.lambda$getSessionFactories$1] - Mapping Capabilities {appium:automationName: UiAutomator2, appium:deviceName: Pixar 4, appium:platformVersion: 13, platformName: ANDROID}, 1 times
15:48:49.437 INFO [Node.<init>] - Binding additional locator mechanisms: relative
15:48:49.509 INFO [NodeServer$1.start] - Starting registration process for Node http://192.168.1.144:5557
15:48:49.510 INFO [NodeServer.execute] - Started Selenium node 4.16.1 (revision 9b4c83354e): http://192.168.1.144:5557
15:48:49.620 WARN [RelaySessionFactory.isServiceUp] - Error checking service status http://localhost:4723/status. java.io.IOException: HTTP/1.1 header parser received no bytes
15:48:49.621 ERROR [NodeServer$1.lambda$start$1] - Node is not alive: http://192.168.1.144:5557 is DOWN
Operating System
Mac os 14.2.1
Selenium version
4.16.1
What are the browser(s) and version(s) where you see this issue?
appium
What are the browser driver(s) and version(s) where you see this issue?
2.4.1
Are you using Selenium Grid?
4.16.1
@VitaliiPivtorak, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
If the issue is a question, add the I-question label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-* label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer label.
Thank you!
Why is http://localhost:4723/ returning that error?
@VitaliiPivtorak can you please check that?
Why is http://localhost:4723/ returning that error?
I am running hub and node on same Mac and use url = "http://localhost:4723" in toml file. Without any changes it works on version 4.13.0
@VitaliiPivtorak can you please check that?
I have checked new version 4.17.0, and replace localhost with ip address in toml file problem the same:
@ Grid % java -jar selenium-server-4.17.0.jar node --config node4.toml
12:58:58.609 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
12:58:58.612 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
12:58:58.663 INFO [UnboundZmqEventBus.
OK, might be related to the JDK 11 HTTP client.
@VitaliiPivtorak im getting same issue by using 4.13 version also.
@VitaliiPivtorak im getting same issue by using 4.13 version also.
Same toml file only change grid version (for hub and node run) is working:
@_ Grid % java -jar selenium-server-4.13.0.jar node --config node4.toml
10:41:19.765 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
10:41:19.768 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
10:41:19.823 INFO [UnboundZmqEventBus.
I think I have seen a similar issue with a relay node in between Appium and a Grid Hub, the /status check fails despite all hosted endpoints being reachable with other HTTP tools. I asked the User Group about this, that thread has a few common details to the above reports: https://groups.google.com/g/selenium-users/c/WZB5G6hbug0/m/33OP2JTIAAAJ
I'm having the exact issue using the latest hub & node version 4.17 in docker
Appium /status returns the correct result when I ping it with curl from within node container
No luck with SE_JAVA_OPTS="-Djdk.httpclient.keepalive.timeout=10" recommended here
Also running into this issue. Running selenium 4.16.1, openjdk 21.0.1. Also tried running the relay server on a different machine same error as OP.
18:00:50.851 WARN [RelaySessionFactory.isServiceUp] - Error checking service status http://(host_name):11000/status. java.io.IOException: HTTP/1.1 header parser received no bytes 18:00:51.824 WARN [RelaySessionFactory.isServiceUp] - Error checking service status http://(host_name):11000/status. java.io.IOException: HTTP/1.1 header parser received no bytes
EDIT: Downgrading to selenium 4.13.0 fixed the problem like OP suggested (Only downgraded the relay server, the hub still running 4.16.1).
Still getting this error even tho i tried to downgrade to selenium 4.13.0 07:18:13.244 WARN [RelaySessionFactory.isServiceUp] - Error checking service status http://(host_name)4723/status. java.io.IOException: HTTP/1.1 header parser received no bytes
Hello guys, I have the same issue. Downgrading Appium also resolves the problem.
I also faced the same issue using selenium-server (grid) version 4.16.1 and 4.18.1. but after downgrading the seleium-server(grid) to 4.13.0 working fine without any issue
in my case I'm using appium version 2.5.1, windows as an OS, and openjdk 11.0.2 working properly by using http://localhost:4723 or http://{localIpAddress}:4723 at config.toml
When is this getting fixed?
We have no timeline for this, as this issue currently stands in a low-priority area. If you wish to help, please feel free to comment on your approach, and we will help you when you send a PR. Thanks!
Please fix it.
Same issue for me. its only working for the appium version 2.3.0 or below. Anything above 2.3.0 appium version it is not working. If we downgrade the appium to 2.3.0 or less it is working for any of the selenium grid 4 version. seems fix is required from appium versioning side not from selenium grid 4 side. This is getting issue for us, we cannot use the latest appium version. We stuck with appium 2.3.0 or below . Please fix it.
@mykola-mokhnach do you know what you folks changed in the Appium server to cause this?
@mykola-mokhnach do you know what you folks changed in the Appium server to cause this?
We did not so any changes. However, I've seen a similar exception (java.io.IOException: HTTP/1.1 header parser received no bytes) before when the standard java HTTP client tries to connect to a running Express server. The solution was to enforce HTTP1_1 on the client.
@mykola-mokhnach @diemol Issue still exist, Let me re-phrase the exact issue again.
Problem statement: Not able to connect to selenium grid.Error checking service status http://XXXXXXX. java.io.IOException: HTTP/1.1 header parser received no byte
When it is occurring: Only with appium version higher than 2.3.0, There is no issue with connecting with selenium grid if the appium version is 2.3.0 or lower, I tried connecting with appium 2.3.0/lower appium version with selenium grid latest 4.19.1 there is no issue.
Somebody needs to dig out the issue from appium server side not from the selenium grid side.
@mykola-mokhnach @diemol Please let us know the steps or commands to enforce HTTP1_1 on the client, Will it solve this issue ?
Hi @mykola-mokhnach , i too am getting this issue, even when following the basic appium grid example https://appium.io/docs/en/2.0/guides/grid/ .
I have the following installed:
- OS: OSX Sonoma 14.4.1
- Appium version: 2.5.3
- Selenium grid version: selenium-server-4.19.1.jar
Below is the appium config i'm using:
server:
port: 4723
use-drivers:
- xcuitest
default-capabilities:
wdaLocalPort: 8100
mjpegServerPort: 9100
mjpegScreenshotUrl: "http://localhost:9100"`
Below is the node config i'm using:
[server]
port = 5555
[node]
detect-drivers = false
[relay]
url = "http://localhost:4723"
status-endpoint = "/status"
configs = [
"1", "{\"platformName\": \"android\", \"appium:platformVersion\": \"10\", \"appium:deviceName\": \"Samsung SM-G988\", \"appium:automationName\": \"uiautomator2\"}"
]
When firing up Appium it seems ok:
The hub also seems ok:
When firing up the node I get this:
As @vinodverma9171 mentioned, if you can provide instructions on how to enforce HTTP1_1 on the client that would be appreciated.
@bassani2014 Yes that is ongoing issue , we wanted to know how we can enforce the http1_1 ? Just a work around if you downgrade your appium to 2.3.0 or less you won’t see this issue. But we will not be able to use latest appium at all. @mykola-mokhnach Please advise . In this scenario nobody will be able to use the latest appium at all. It’s blocker for everybody to use latests appium version.
Via PR #13849, I have tried to add a config to enforce the protocol version in HttpClient config used in relay. TOML config looks like
[server]
port = 5555
[node]
detect-drivers = false
[relay]
url = "http://localhost:4723"
status-endpoint = "/status"
protocol-version = "HTTP/1.1"
configs = [
"1", "{\"platformName\": \"android\", \"appium:platformVersion\": \"10\", \"appium:deviceName\": \"Samsung SM-G988\", \"appium:automationName\": \"uiautomator2\"}"
]
A quick test looks like
@VietND96 Above suggested solution did not work for me , it is the same issue.
@vinodverma9171, that is a new implementation, and wait for merging in the PR. My above demo with a dev package was built locally. You can try a preview by downloading this server jar (since GH limit attachment 33MB)
As a possible workaround from the server side that might improve the HTTP/2 interoperability I could only see the enablement of https. See https://github.com/appium/appium/blob/master/packages/appium/docs/en/guides/tls.md for more details.
Sorry for bringing this up again. But has anyone tried to actually run a test against this? Adding "protocol-version" worked for adding a relay node, but the same error happened again when running a test against it. I tried this out in v4.20.0, btw.
Looks like the same code that create client in isServiceUp() is needed in the apply() function above too. I can try to take care of this and make a pr.