nacos get changed dataId error, code: 403问题解决
- 问题出现原因:
- 解决办法:需要在运行项目的配置添加权限账号和密码,重启服务
问题出现原因:
由于nacosserver开启了权限验证,项目启动时出现异常
nacos.core.auth.caching.enabled=true
c.a.n.c.c.i.ClientWorker.checkUpdateConfigStr:389 - [fixed-192.22.12.10_8848-zdxlz-iam] [check-update] get changed dataId error, code: 403
2024-07-24 09:50:22.133 ERROR [] [com.alibaba.nacos.client.Worker.longPolling.fixed-192.22.12.10_8848-zdxlz-iam] c.a.n.c.c.i.ClientWorker.checkUpdateConfigStr:389 - [fixed-192.22.12.10_8848-zdxlz-iam] [check-update] get changed dataId error, code: 403
2024-07-24 09:50:22.233 ERROR [] [com.alibaba.nacos.naming.beat.sender] c.a.n.c.n.n.NamingProxy.reqApi:561 - request: /nacos/v1/ns/instance/beat failed, servers: [192.22.12.10:8848], code: 403, msg: <html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Wed Jul 24 09:50:22 CST 2024</div><div>There was an unexpected error (type=Forbidden, status=403).</div><div>unknown user!</div></body></html>
解决办法:需要在运行项目的配置添加权限账号和密码,重启服务
spring:cloud:nacos:username: nacospassword: nacosdiscovery:server-addr: 192.22.12.10:8848namespace: testconfig:server-addr: 192.22.12.10:8848 #配置中心地址file-extension: yml #后缀名group: dev namespace: test #命名空间ID
参考链接