com.alibaba.nacos.api.exception.NacosException

具体异常如下:

com.alibaba.nacos.api.exception.NacosException: <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'>Fri Apr 14 14:31:24 CST 2023</div><div>There was an unexpected error (type=Forbidden, status=403).</div><div>unknown user!</div></body></html>
at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:306)
at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:155)
at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:98)
at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85)
at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosConfiguration(NacosPropertySourceLocator.java:158)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadSharedConfiguration(NacosPropertySourceLocator.java:116)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:101)
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51)
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:634)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:403)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:337)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at com.sky.sparrow.admin.SparrowAdminApplication.main(SparrowAdminApplication.java:24)

经排查,原因是本地指定了命名空间但是对应的nacos 的 discovery下未能配置用户密码导致 找不到/无法连接对应配置中心的服务

处理:指定配置命名空间,并配置用户密码授权就好了

如下图:

 

posted @ 2023-04-18 10:53  小年的西瓜  阅读(7476)  评论(0编辑  收藏  举报