-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[grid][java] fix node-docker #13789
[grid][java] fix node-docker #13789
Conversation
Fixed: SeleniumHQ/docker-selenium#2175 Exception in thread "Thread-0" java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.grid.node.Node.getStatus()" because "this.node" is null Signed-off-by: Viet Nguyen Duc <[email protected]>
PR Description updated to latest commit (5fa0497)
|
PR Review
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, let me double-check again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Fixed exception: Caused by: java.lang.IllegalArgumentException: non-positive contentLength: 0 Signed-off-by: Viet Nguyen Duc <[email protected]>
@diemol, you're right! I just added another check for case length = 0. However a new exception raised 03:16:58.799 DEBUG [SocketTube$InternalWriteSubscriber$WriteSubscription.requestMore] - [JdkHttpClient-0-3] [2s 314ms] SocketTube(3) write: requesting more...
03:16:58.799 DEBUG [SocketTube.debugState] - [JdkHttpClient-0-3] [2s 314ms] SocketTube(3) leaving requestMore: Reading: [ops=1, demand=1, stopped=false], Writing: [ops=0, demand=1]
03:16:58.799 DEBUG [Http1Response.lambda$readBody$2] - [JdkHttpClient-0-4] [2s 314ms] Http1Response(id=9, PlainHttpConnection(SocketTube(3))) Finished reading body: READING_BODY
03:16:58.799 DEBUG [Http1Response$ClientRefCountTracker.tryRelease] - [JdkHttpClient-0-4] [2s 315ms] Http1Response(id=9, PlainHttpConnection(SocketTube(3))) Operation finished: decrementing ref count for jdk.internal.net.http.HttpClientImpl@acc583f(1)
03:16:58.799 DEBUG [Http1AsyncReceiver.flush] - [JdkHttpClient-0-4] [2s 315ms] Http1AsyncReceiver(SocketTube(3)) Delegate done: 0
03:16:58.799 DEBUG [Http1AsyncReceiver.flush] - [JdkHttpClient-0-4] [2s 315ms] Http1AsyncReceiver(SocketTube(3)) Got 0 bytes for delegate null
03:16:58.802 DEBUG [JdkHttpClient.execute0] - Ending request (POST) /v1.41/images/create in 955ms
03:16:58.804 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=42c110f68b0f6e860fa[2109](https://github.com/NDViet/docker-selenium/actions/runs/8625419739/job/23641993212#step:11:2110)4b7b20804, spanId=c68458144c455fce, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=null, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.36.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=httpclient.execute, kind=INTERNAL, startEpochNanos=1712719017847168436, endEpochNanos=1712719018804416290, attributes=AttributesMap{data={span.kind=client, http.target=/v1.41/images/create, http.status_code=404, http.method=POST}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=ERROR, description=Kind: NOT_FOUND Description:}, hasEnded=true}
03:16:58.804 INFO [PullImage.apply] - Have response from server
03:16:58.805 ERROR [Bootstrap.runMain] - Error during execution
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.grid.Bootstrap.runMain(Bootstrap.java:77)
at org.openqa.selenium.grid.Bootstrap.main(Bootstrap.java:70)
Caused by: org.openqa.selenium.grid.config.ConfigException: java.lang.reflect.InvocationTargetException
at org.openqa.selenium.grid.config.MemoizedConfig.getClass(MemoizedConfig.java:119)
at org.openqa.selenium.grid.node.config.NodeOptions.getNode(NodeOptions.java:181)
at org.openqa.selenium.grid.node.httpd.NodeServer.createHandlers(NodeServer.java:126)
at org.openqa.selenium.grid.node.httpd.NodeServer.asServer(NodeServer.java:185)
at org.openqa.selenium.grid.node.httpd.NodeServer.execute(NodeServer.java:247)
at org.openqa.selenium.grid.TemplateGridCommand.lambda$configure$4(TemplateGridCommand.java:122)
at org.openqa.selenium.grid.Main.launch(Main.java:83)
at org.openqa.selenium.grid.Main.go(Main.java:56)
at org.openqa.selenium.grid.Main.main(Main.java:41)
... 6 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.grid.config.ClassCreation.callCreateMethod(ClassCreation.java:51)
at org.openqa.selenium.grid.config.MemoizedConfig.lambda$getClass$4(MemoizedConfig.java:104)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
at org.openqa.selenium.grid.config.MemoizedConfig.getClass(MemoizedConfig.java:99)
... 14 more
Caused by: org.openqa.selenium.docker.DockerException: manifest for selenium/standalone-chrome:trunk-20240410 not found: manifest unknown: manifest unknown
at org.openqa.selenium.docker.v1_41.PullImage.apply(PullImage.java:76)
at org.openqa.selenium.docker.v1_41.V141Docker.getImage(V141Docker.java:79)
at org.openqa.selenium.docker.Docker.lambda$getImage$0(Docker.java:50)
at java.base/java.util.Optional.map(Unknown Source)
at org.openqa.selenium.docker.Docker.getImage(Docker.java:50)
at org.openqa.selenium.grid.node.docker.DockerOptions.lambda$loadImages$5(DockerOptions.java:259)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Exception in thread "Thread-0" java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.grid.node.Node.getStatus()" because "this.node" is null
at org.openqa.selenium.grid.node.httpd.NodeServer.lambda$new$0(NodeServer.java:78)
at java.base/java.lang.Thread.run(Unknown Source) |
Does the error come from trying to pull an image that does not exist?
|
@diemol, there is something wrong with the test configs on CI. I just updated it, now tests passed - https://github.com/NDViet/docker-selenium/actions/runs/8632690937/job/23663997230 |
@diemol can we count on a hotfix to 4.19 release? Or do we have to wait for 4.20 for this fix? |
4.20 is coming next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @VietND96!
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Fix: SeleniumHQ/docker-selenium#2175
RCA: regression issue belongs to #13647
Types of changes
Checklist
Type
bug_fix
Description
RemoteNode.java
by adding a null check forstatus.getNodeId()
before comparing it with the current node ID. This ensures the node status check does not fail whenstatus.getNodeId()
is null.Changes walkthrough
RemoteNode.java
Prevent NullPointerException in RemoteNode Status Check
java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java
status.getNodeId()
before comparing node IDs toprevent NullPointerException.