You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "YHaoNan (via GitHub)" <gi...@apache.org> on 2026/04/02 06:43:34 UTC

[I] [Bug] [Zeta] getJobInfoJson throws a NullPointerException [seatunnel]

YHaoNan opened a new issue, #10695:
URL: https://github.com/apache/seatunnel/issues/10695

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### What happened
   
   A NullPointerException occurs when retrieving details of a failed task.
   
   NOTE: I have DISABLED the persistence of job metrics of finished tasks through hazelcast config file.
   
   I guess the `finishedJobMetrics` objects return by `nodeEngine` is null. The problem is solved after I added these lines.
   
   ```diff
   
           } else if (finishedJobState != null) {
               // 已结束:从历史 IMAP 取指标与 DAG,拼成同一结构的 JSON
               JobMetrics finishedJobMetrics =
                       (JobMetrics)
                               nodeEngine
                                       .getHazelcastInstance()
                                       .getMap(Constant.IMAP_FINISHED_JOB_METRICS)
                                       .get(jobId);
   +            if (finishedJobMetrics == null) {
   +               finishedJobMetrics = JobMetrics.empty();
   +            }
               JobDAGInfo finishedJobDAGInfo =
                       (JobDAGInfo)
                               nodeEngine
                                       .getHazelcastInstance()
                                       .getMap(Constant.IMAP_FINISHED_JOB_VERTEX_INFO)
                                       .get(jobId);
               return getJobInfoJson(
                       finishedJobState, finishedJobMetrics.toJsonString(), finishedJobDAGInfo);
   ```
   
   
   
   
   ### SeaTunnel Version
   
   2.3.12
   
   ### SeaTunnel Config
   
   ```conf
   hazelcast.yaml
   
   hazelcast:
     map:
       engine_runningJobMetrics:
         map-store:
           enabled: false
       engine_finishedJobMetrics:
         map-store:
           enabled: false
   ```
   
   ### Running Command
   
   ```shell
   -
   ```
   
   ### Error Exception
   
   ```log
   StackTrace:
   
   > **NOTE**: The line number may not correct because we modified the code.
   
   
   2026-04-02 14:09:14,551 ERROR [.s.r.f.ExceptionHandlingFilter] [qtp1990419108-3370] - Error occurred while processing request
   java.lang.NullPointerException: null
           at org.apache.seatunnel.engine.server.rest.service.JobInfoService.getJobInfoJson(JobInfoService.java:99) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.engine.server.rest.servlet.JobInfoServlet.doGet(JobInfoServlet.java:52) ~[seatunnel-starter.jar:2.3.12]
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[seatunnel-hadoop3-3.1.4-uber.jar:2.3.12]
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[seatunnel-hadoop3-3.1.4-uber.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.engine.server.rest.filter.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:50) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.Server.handle(Server.java:516) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[seatunnel-starter.jar:2.3.12]
           at org.apache.seatunnel.shade.org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[seatunnel-starter.jar:2.3.12]
           at java.lang.Thread.run(Thread.java:829) [?:?]
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   11
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Zeta] getJobInfoJson throws a NullPointerException [seatunnel]

Posted by "chl-wxp (via GitHub)" <gi...@apache.org>.
chl-wxp closed issue #10695: [Bug] [Zeta] getJobInfoJson throws a NullPointerException
URL: https://github.com/apache/seatunnel/issues/10695


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Zeta] getJobInfoJson throws a NullPointerException [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10695:
URL: https://github.com/apache/seatunnel/issues/10695#issuecomment-4203450581

   I checked the current path again and I agree this is a real bug. In the finished-job branch, `JobInfoService.getJobInfoJson()` reads the finished state, metrics, and DAG data separately, but the code assumes the metrics object is always present and calls `toJsonString()` without a null guard. If the finished state exists but the metrics / DAG entry is missing, the detail API can fail with NPE instead of returning degraded job info.
   
   I also checked the issue timeline and there is already a linked dev-branch PR for this: #10700. So the direction is correct, and the next step after merge should be to verify the failing job-detail case against the latest snapshot.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Zeta] getJobInfoJson throws a NullPointerException [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10695:
URL: https://github.com/apache/seatunnel/issues/10695#issuecomment-4199253896

   Thanks for reporting this. I checked the current REST service path and this looks like a real bug.
   
   The issue is that the job detail JSON assembly path assumes the finished-job metrics / DAG objects always exist. In the current implementation, once one of those objects is missing, the service can still go on to call methods like `toJsonString()` directly, which leads to the NPE you reported.
   
   So I think the right fix direction is:
   1. make the detail assembly path null-safe for missing metrics / DAG objects
   2. return an empty/default JSON section instead of throwing
   3. add a focused unit test for this case
   
   I’d keep this issue open for a small but real server-side fix.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org