sermant-io / Sermant

CNCF sandbox project, a Cloud-Native Proxyless Service Mesh based on Java Bytecode Enhancement Technology
https://sermant.io/
Apache License 2.0
1.25k stars 164 forks source link

ConfigManager#initialize phase, log warnings/errors, causing agent mount fail #1591

Closed AYue-94 closed 2 months ago

AYue-94 commented 3 months ago

What happened?

i add myList property in config.properties and AgentConfig, and default it is empty string.

agent.config.myList=

when io.sermant.core.config.utils.ConfigValueUtil#parseConfigToCollection, parse empty string, then log warn. image it cause new LogEventCollector instance created, but Config is not ready, so it cause NPE, and agent mount fail. image

How can we reproduce it (as minimally and precisely as possible)?

you can try set agent.config.serviceInjectList as empty string.

Anything else we need to know?

No response

Sermant version

2.0.0

OS version

MacOS14.1

hanbingleixue commented 3 months ago

@AYue-94 The cause of this problem is that when the configuration type of a configuration item is collection and the configuration content is empty, an warning log is recorded. The LogEventCollector collects and reports warning logs. However, the event configuration is not initialized, so a NullPointerException is thrown on event collection. We will fix it in the next release.