Wweiei opened a new issue, #5721:
URL: https://github.com/apache/shenyu/issues/5721

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   When the shenyu data synchronization chose the nacos model, if the nacos 
server contextPath is not the default /nacos, shenyu-admin or  shenyu-bootstrap 
will be unable to connect to the nacos. And the server will start failed due to 
the failure of connect to nacos.
   
   ### Expected Behavior
   
   shenyu.sync.nacos should have a parameter to set the contextPath. and then 
nacos-client can connect to nacos successfully.
   
   ### Steps To Reproduce
   
   1.check out to master branch and pull the lastest code.
   2.prepare a Nacos service with the contextPath set to a value other than 
/nacos.
   3.change shenyu-admin shenyu.sync.nacos's config in application.yml
   
   ### Environment
   
   ```markdown
   ShenYu version(s):branch master latest
   ```
   
   
   ### Debug logs
   
   ``` Error starting ApplicationContext. To display the condition evaluation 
report re-run your application with 'debug' enabled.
   2024-10-24 15:17:48 [main] ERROR org.springframework.boot.SpringApplication 
- Application run failed
   org.apache.shenyu.common.exception.ShenyuException: http error, 
code=403,msg=user not 
found!,dataId=plugin.list,group=DEFAULT_GROUP,tenant=public
        at 
org.apache.shenyu.admin.listener.nacos.NacosDataChangedInit.dataIdNotExist(NacosDataChangedInit.java:67)
        at 
java.base/java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
        at 
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at 
java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:1002)
        at 
java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
        at 
java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
        at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
        at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at 
java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
        at 
java.base/java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
        at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at 
java.base/java.util.stream.ReferencePipeline.allMatch(ReferencePipeline.java:637)
        at 
org.apache.shenyu.admin.listener.nacos.NacosDataChangedInit.notExist(NacosDataChangedInit.java:56)
        at 
org.apache.shenyu.admin.listener.AbstractDataChangedInit.run(AbstractDataChangedInit.java:38)
        at 
org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790)
        at 
org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83)
        at 
org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60)
        at 
org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88)
        at 
org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798)
        at 
org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789)
        at 
org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774)
        at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at 
java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
        at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
        at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at 
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at 
org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:342)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
        at 
org.apache.shenyu.admin.ShenyuAdminBootstrap.main(ShenyuAdminBootstrap.java:36)
   2024-10-24 15:17:48 [main] INFO  
org.springframework.integration.endpoint.EventDrivenConsumer - Removing 
{logging-channel-adapter:_org.springframework.integration.errorLogger} as a 
subscriber to the 'errorChannel' channel
   2024-10-24 15:17:48 [main] INFO  
org.springframework.integration.channel.PublishSubscribeChannel - Channel 
'application.errorChannel' has 0 subscriber(s).
   2024-10-24 15:17:48 [main] INFO  
org.springframework.integration.endpoint.EventDrivenConsumer - stopped bean 
'_org.springframework.integration.errorLogger ```
   
   ### Anything else?
   
   After add the contextPath parameter in 
org.apache.shenyu.admin.config.properties.NacosProperties and 
org.apache.shenyu.sync.data.nacos.config.NacosConfig, then add the CONTEXT_PATH 
property for the ConfigService , shenyu-admin and shenyu-bootstrap can start 
successfully. And shenyu-admin can push data to nacos successfully, or 
shenyu-bootstrap pull data from nacos successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to