Skip to content

v3.1.0版本中K8sSyncServer处理Endpoints时出现空指针异常 #13867

@2200376luhuabin

Description

@2200376luhuabin

#13767

nacos版本:3.1.0
nacos部署在k8s集群,启用k8s-sync

  - name: NACOS_K8S_SYNC_ENABLED
    value: "true"

错误消息:

2025-09-29 10:20:46,377 ERROR failed invoking ADD event handler: {}

java.lang.NullPointerException: Cannot invoke "io.kubernetes.client.openapi.models.V1Service.getSpec()" because "service" is null
        at com.alibaba.nacos.k8s.sync.K8sSyncServer$3.onAdd(K8sSyncServer.java:214)
        at com.alibaba.nacos.k8s.sync.K8sSyncServer$3.onAdd(K8sSyncServer.java:201)
        at io.kubernetes.client.informer.cache.ProcessorListener.run(ProcessorListener.java:72)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

问题:

  • 之前提的PR 未删除冗余的 factory.startAllRegisteredInformers();

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategory issues or prs related to bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions