Skip to content
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

There is no content for NacosPropertySource #12838

Open
Xiaobai01 opened this issue Nov 12, 2024 · 7 comments
Open

There is no content for NacosPropertySource #12838

Xiaobai01 opened this issue Nov 12, 2024 · 7 comments

Comments

@Xiaobai01
Copy link

Issue Description

java应用获取不到nacos的配置中心的配置文件

Describe what happened (or what feature you want)

在nacos的public ns中创建了配置文件,但是在本地仍然获取不到对应的配置。

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

在本地【Mac电脑M2 MAX】使用docker启动了nacos的镜像
server端是ARM版本的镜像[v2.3.1-slim],client端为nacos-config-spring-boot-starter的0.2.12版本

Anything else we need to know?

配置信息如下:
nacos:
config:
server-addr: 127.0.0.1:8848

主类使用NacosPropertySource注解
@NacosPropertySource(dataId = "test.yaml", autoRefreshed = true)

报错信息如下:
2024-11-12 12:09:18.528 INFO 99713 [main] c.a.nacos.plugin.auth.spi.client.ClientAuthPluginManager:init:56 [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
2024-11-12 12:09:18.528 INFO 99713 [main] c.a.nacos.plugin.auth.spi.client.ClientAuthPluginManager:init:56 [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
2024-11-12 12:09:19.160 WARN 99713 [main] c.a.nacos.spring.core.env.AbstractNacosPropertySourceBuilder:doBuild:188 There is no content for NacosPropertySource from dataId[test.yaml] , groupId[DEFAULT_GROUP] , properties[{accessKey=${nacos.access-key:}, clusterName=${nacos.cluster-name:}, configLongPollTimeout=${nacos.configLongPollTimeout:}, configRetryTime=${nacos.configRetryTime:}, contextPath=${nacos.context-path:}, enableRemoteSyncConfig=${nacos.enableRemoteSyncConfig:}, encode=${nacos.encode:UTF-8}, endpoint=${nacos.endpoint:}, maxRetry=${nacos.maxRetry:}, namespace=${nacos.namespace:}, password=${nacos.password:}, secretKey=${nacos.secret-key:}, serverAddr=${nacos.server-addr:}, username=${nacos.username:}}]

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'decryptingBeanPostProcessor': Injection of @NacosValue dependencies is failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'db.host' in value "${db.host}"

@KomachiSion
Copy link
Collaborator

see ${user.home}/logs/nacos/config.log to find out whether config has found and got from nacos server.

@Xiaobai01
Copy link
Author

我在容器中没有找到home/logs/nacos/config.log路径,但是找到了/home/nacos/logs路径,并且logs路径下不存在nacos文件夹及config.log文件
Uploading nacos.jpg…

@Xiaobai01
Copy link
Author

Xiaobai01 commented Nov 13, 2024 via email

@KomachiSion
Copy link
Collaborator

在应用所在的节点找日志,而不是在nacos server。

@Xiaobai01
Copy link
Author

Xiaobai01 commented Nov 14, 2024 via email

@Xiaobai01
Copy link
Author

Xiaobai01 commented Nov 15, 2024 via email

@KomachiSion
Copy link
Collaborator

不是应该配置username和password吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants