Skip to content

2.1.3 配合 nacos3.0 创建一个来源为mcpsse的mcpserver,不生效并且删除时候崩溃 || 2.1.3 Create an mcpserver with mcpsse source with mcpsse, which does not take effect and crashes when deleted. #2296

@caolicaoli

Description

@caolicaoli

源头服务是个springai的mcpsse,配置到nacos3上,higress打印日志2025-05-22T01:11:50.761902Z info McpServer get config callback, namespace:nacos-default-mcp, groupName:mcp-server, dataId:chaofan-mcp-server.json,然而并没有创建mcp服务访问不通。

手动删除nacos上的这个来源后,higress崩溃。

2025-05-22T01:11:50.761902Z info McpServer get config callback, namespace:nacos-default-mcp, groupName:mcp-server, dataId:chaofan-mcp-server.json
2025-05-22T01:11:51.591128Z info McpServer unsubscribe mcp server, groupName:mcp-server, dataId:chaofan-mcp-server.json
2025-05-22T01:11:51.591341Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591383Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591399Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591414Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591434Z info ads full push happen, reason:map[config:1]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2a83f22]

goroutine 214 [running]:
github.com/alibaba/higress/registry/nacos/mcpserver.(*MultiConfigListener).Stop(...)
github.com/alibaba/higress/registry/nacos/mcpserver/util.go:75
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).unsubscribe(0xc000d62308, {0xc000ed4120, 0xa}, {0xc000ed412c, 0x17})
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:372 +0x382
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).fetchAllMcpConfig(0xc000d62308)
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:321 +0x2d4
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).Run(0xc000d62308)
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:266 +0x1a5
created by github.com/alibaba/higress/registry/reconcile.(*Reconciler).Reconcile in goroutine 62
github.com/alibaba/higress/registry/reconcile/reconcile.go:127 +0xa6b


The source service is a springai mcpsse, configured on Nacos3, higress print log 2025-05-22T01:11:50.761902Z info McpServer get config callback, namespace:nacos-default-mcp, groupName:mcp-server, dataId:chaofan-mcp-server.json, but the mcp service was not created and accessed is not accessible.

Higress crashed after manually deleting this source on nacos.

2025-05-22T01:11:50.761902Z info McpServer get config callback, namespace:nacos-default-mcp, groupName:mcp-server, dataId:chaofan-mcp-server.json
2025-05-22T01:11:51.591128Z info McpServer unsubscribe mcp server, groupName:mcp-server, dataId:chaofan-mcp-server.json
2025-05-22T01:11:51.591341Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591383Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591399Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591414Z info ads full push happen, reason:map[config:1]
2025-05-22T01:11:51.591434Z info ads full push happen, reason:map[config:1]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2a83f22]

goroutine 214 [running]:
github.com/alibaba/higress/registry/nacos/mcpserver.(*MultiConfigListener).Stop(...)
github.com/alibaba/higress/registry/nacos/mcpserver/util.go:75
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).unsubscribe(0xc000d62308, {0xc000ed4120, 0xa}, {0xc000ed412c, 0x17})
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:372 +0x382
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).fetchAllMcpConfig(0xc000d62308)
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:321 +0x2d4
github.com/alibaba/higress/registry/nacos/mcpserver.(*watcher).Run(0xc000d62308)
github.com/alibaba/higress/registry/nacos/mcpserver/watcher.go:266 +0x1a5
created by github.com/alibaba/higress/registry/reconcile.(*Reconciler).Reconcile in goroutine 62
github.com/alibaba/higress/registry/reconcile/reconcile.go:127 +0xa6b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions