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

Client not connected, current status:STARTING #3736

Closed
wuwei0727 opened this issue May 16, 2024 · 26 comments
Closed

Client not connected, current status:STARTING #3736

wuwei0727 opened this issue May 16, 2024 · 26 comments
Labels

Comments

@wuwei0727
Copy link

Which Component
use pring-cloud-alibaba

Startup error

Screenshots
If applicable, add screenshots to help explain your problem.
Startup error:
PixPin_2024-05-16_15-48-36

docker-compose:
PixPin_2024-05-16_15-50-24

springboot nacos yml :
PixPin_2024-05-16_15-50-38

aliyun The security group has been released
PixPin_2024-05-16_15-51-17

Additional context
Add any other context about the problem here.
<spring-boot.version>2.7.13</spring-boot.version>
<spring-cloud.version>2021.0.8</spring-cloud.version>
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>

@wuwei0727
Copy link
Author

Why do I configure the public ip address :8848, but the error message is 127.0.0.1:8848?

@yuluo-yx
Copy link
Collaborator

if use docker container, pls mapping 9848 port. try again

@yuluo-yx yuluo-yx added kind/question waiting-for-feedback Waiting for user feedback area/nacos spring cloud alibaba nacos labels May 17, 2024
@wuwei0727
Copy link
Author

I mapped it, Ali Cloud also mapped it
PixPin_2024-05-17_09-57-10

@yuluo-yx
Copy link
Collaborator

Can you provide a simple demo?

@wuwei0727
Copy link
Author

wuwei0727 commented May 17, 2024

The gateway connects to the nacos demo

YunNian-Cloud-demo.zip

@yuluo-yx
Copy link
Collaborator

image

:21.287 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway-dev.yml, group=DEFAULT_GROUP
12:22:21.288 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway, group=DEFAULT_GROUP
12:22:21.288 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway.yml, group=DEFAULT_GROUP
(♥◠‿◠)ノ゙  网关启动成功   ლ(´ڡ`ლ)゙ 
INFO: Sentinel log output type is: file
INFO: Sentinel log charset is: utf-8
INFO: Sentinel log base directory is: C:\Users\Administrator\logs\csp\
INFO: Sentinel log name use pid is: false
INFO: Sentinel log level is: INFO

This is a network issue between the containers, you can check if the nacos container and the gateway container can communicate properly.

@yuluo-yx yuluo-yx removed the waiting-for-feedback Waiting for user feedback label May 17, 2024
@wuwei0727
Copy link
Author

ThenThen should I use the container name yunnian-nacos:8848?

I've tried this before. No.

@yuluo-yx
Copy link
Collaborator

ThenThen should I use the container name yunnian-nacos:8848?

I've tried this before. No.

a simple way, you can run ping yunnian-nacos on gateway app container.

@wuwei0727
Copy link
Author

Hello, I configured server-addr: 8.136.114.59:8848 in bootstrap.yml. Why is the value 127.0.0.1:8848 when I start the connection?

@wuwei0727
Copy link
Author

PixPin_2024-05-19_12-38-13

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented May 19, 2024

PixPin_2024-05-19_12-38-13

What about configuration in application.yml? This may be a bug.
You can check that the preconfiguration file is correctly loaded into the

@yuluo-yx
Copy link
Collaborator

Please take a closer look at your project configuration, I ran the demo you provided locally and it ran successfully without any errors and without changing any configuration properties.

this is my local running log:

15:08:29.076 [main] INFO  c.a.n.c.e.SearchableProperties - [sortPropertySourceDefaultOrder,197] - properties search order:PROPERTIES->JVM->ENV->DEFAULT_SETTING
15:08:29.121 [background-preinit] INFO  o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
15:08:29.467 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
15:08:29.468 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
Spring Boot Version: 2.7.13
Spring Application Name: yunnian-gateway

15:08:31.646 [main] WARN  c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[yunnian-gateway] & group[DEFAULT_GROUP]
15:08:31.700 [main] WARN  c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[yunnian-gateway.yml] & group[DEFAULT_GROUP]
15:08:31.777 [main] INFO  c.y.g.YunNianGatewayApplication - [logStartupProfileInfo,637] - The following 1 profile is active: "dev"
15:08:36.457 [main] INFO  c.a.c.s.g.s.SentinelSCGAutoConfiguration - [sentinelGatewayFilter,144] - [Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: -2147483648
15:08:36.831 [main] INFO  c.a.c.s.g.s.SentinelSCGAutoConfiguration - [sentinelGatewayBlockExceptionHandler,134] - [Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler
INFO: Sentinel log output type is: file
INFO: Sentinel log charset is: utf-8
INFO: Sentinel log base directory is: C:\Users\Administrator\logs\csp\
INFO: Sentinel log name use pid is: false
INFO: Sentinel log level is: INFO
15:08:37.058 [main] WARN  o.s.c.l.c.LoadBalancerCacheAutoConfiguration$LoadBalancerCaffeineWarnLogger - [logWarning,83] - Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
15:08:37.077 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
15:08:37.077 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
15:08:37.442 [main] INFO  c.a.c.s.d.c.SentinelConverter - [convert,79] - converter can not convert rules because source is empty
15:08:39.606 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
15:08:39.606 [main] INFO  c.a.n.p.a.s.c.ClientAuthPluginManager - [init,56] - [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
15:08:39.940 [main] INFO  c.a.c.n.r.NacosServiceRegistry - [register,76] - nacos registry, DEFAULT_GROUP yunnian-gateway 192.168.235.1:1080 register finished
15:08:40.138 [main] INFO  c.a.c.n.d.NacosDiscoveryHeartBeatPublisher - [start,66] - Start nacos heartBeat task scheduler.
15:08:40.152 [main] INFO  c.y.g.YunNianGatewayApplication - [logStarted,61] - Started YunNianGatewayApplication in 12.507 seconds (JVM running for 13.522)
15:08:40.156 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway-dev.yml, group=DEFAULT_GROUP
15:08:40.156 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway, group=DEFAULT_GROUP
15:08:40.156 [main] INFO  c.a.c.n.r.NacosContextRefresher - [registerNacosListener,129] - [Nacos Config] Listening config: dataId=yunnian-gateway.yml, group=DEFAULT_GROUP
(♥◠‿◠)ノ゙  网关启动成功   ლ(´ڡ`ლ)゙ 
15:08:43.424 [RMI TCP Connection(4)-192.168.1.3] INFO  c.a.c.s.d.c.SentinelConverter - [convert,79] - converter can not convert rules because source is empty

btw, You should ensure that the nacos deployed on your server is secure
image

@wuwei0727
Copy link
Author

Thank you for your patient answer. I can connect to nacos by running gateway locally. My local debug breakpoint read nacos source code configuration and loaded my configuration 8.136.114.59:8848, but the online environment, as you see, reported an error. I see the environmental error on the line: NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='127.0.0.1:8848', The Client is not connected and current status:STARTING. Why is it 127.0.0.1:8848? I checked the configuration file and there are no configuration errors. Can you give me some ideas for troubleshooting?

@yuluo-yx
Copy link
Collaborator

Is the online environment configured the same way? dev config file

@wuwei0727
Copy link
Author

Yes, the environment is the same online

@wuwei0727
Copy link
Author

Oh, by the way, I use docker-compose for my online environment, and I have no problem executing it online using java-jar. But you can't use docker-compose
PixPin_2024-05-19_15-31-28

@yuluo-yx
Copy link
Collaborator

imo, In an online environment, it is possible that the dev configuration file is not loaded correctly, but instead, a default is loaded, which you can see more about in the logs

Looking at the online environment
15:08:31.777 [main] INFO c.y.g.YunNianGatewayApplication - [logStartupProfileInfo,637] - The following 1 profile is active: "dev"
What is output here? dev or default

@yuluo-yx
Copy link
Collaborator

if is default, you can see https://github.com/yuluo-yx/sca-k8s-demo/blob/f4e92d38c4752e7e34cc3e2b1c52dfc8efcdb992/docker-compose/apps/provider/Dockerfile#L18 setting

@wuwei0727
Copy link
Author

PixPin_2024-05-19_15-37-54

@wuwei0727
Copy link
Author

My environment here is dev

@yuluo-yx
Copy link
Collaborator

Make sure your config file is loaded correctly, or is it present in the container? It looks like the config file is loaded correctly

@yuluo-yx
Copy link
Collaborator

@wuwei0727
Copy link
Author

PixPin_2024-05-20_15-33-39

Hi, I checked docker's network and they are on the same network!

@wuwei0727
Copy link
Author

Now I can not locate what is the problem, this problem makes me confused, no idea

@wuwei0727
Copy link
Author

Hello, thank you very much! I've solved my problem。
The problem is that the old one was not updated before I built the docker image. The configuration file of the old image was 127.0.0.1, so I just updated the docker image

@yuluo-yx
Copy link
Collaborator

Hello, thank you very much! I've solved my problem。 The problem is that the old one was not updated before I built the docker image. The configuration file of the old image was 127.0.0.1, so I just updated the docker image

Good job, config file not load or network question.

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

No branches or pull requests

2 participants