nacos get changed dataId error, code: 403

created at 01-03-2022 views: 6

problem

application.properties after modifying nacos permission verification

nacos.core.auth.caching.enabled=true

After the project is started, the prompt is always refreshed: [check-update] get changed dataId error, code: 403

[2021-12-30 15:01:22.247] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:22.447] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:22.647] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:22.728] loit-sample-getway [     ] [] [com.alibaba.nacos.client.naming.updater] INFO  com.alibaba.nacos.client.naming - removed ips(1) service: DEFAULT_GROUP@@loit-sample-getway -> [{"instanceId":"192.168.189.1#7001#DEFAULT#DEFAULT_GROUP@@loit-sample-getway","ip":"192.168.189.1","port":7001,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"DEFAULT","serviceName":"DEFAULT_GROUP@@loit-sample-getway","metadata":{"preserved.register.source":"SPRING_CLOUD","version":"2.0.0"},"ipDeleteTimeout":30000,"instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000}]
[2021-12-30 15:01:22.729] loit-sample-getway [     ] [] [com.alibaba.nacos.client.naming.updater] INFO  com.alibaba.nacos.client.naming - current ips:(0) service: DEFAULT_GROUP@@loit-sample-getway -> []
[2021-12-30 15:01:22.847] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:23.047] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:23.246] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:23.447] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
[2021-12-30 15:01:23.648] loit-sample-getway [     ] [] [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] ERROR com.alibaba.nacos.client.config.impl.ClientWorker - [fixed-127.0.0.1_8848-c505697b-48e6-43b6-a3bd-38a354d71e69] [check-update] get changed dataId error, code: 403
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'>Thu Dec 30 15:09:19 CST 2021</div><div>There was an unexpected error (type=Forbidden, status=403).</div><div>unknown user!</div></body></html>

solution:

Need to add permission account and password in the configuration of the running project

bootstrap.properties

spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.cloud.nacos.config.namespace=c505697b-48e6-43b6-a3bd-38a354d71e69
spring.cloud.nacos.config.file-extension=yaml
spring.cloud.nacos.username=nacos
spring.cloud.nacos.password=nacos

application-dev.yml

cloud:
     nacos:
       discovery:
         # Nacos Registration Center Address
         server-addr: 127.0.0.1:8848
         # Registry Center Namespace
         namespace: c505697b-48e6-43b6-a3bd-38a354d71e69
         # Group
         #group: DEFAULT_GROUP
         username: nacos
         password: nacos
sentinel:
       # Sentinel Gateway current limiting rule configuration file
       datasource.ds1.nacos:
         server-addr: ${spring.cloud.nacos.discovery.server-addr}
         namespace: ${spring.cloud.nacos.discovery.namespace}
         data-id: ${spring.application.name}-sentinel-gateway
         data-type: json
         group-id: DEFAULT_GROUP
         # Rule type Current limit configuration
         ruleType: gw-flow
         username: nacos # account
         password: nacos # password
Please log in to leave a comment.