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

request help: failed to set upstream: discovery nacos is uninitialized #4420

Closed
yimuczhou opened this issue Jun 12, 2021 · 12 comments
Closed

Comments

@yimuczhou
Copy link

Issue description

本地使用的apisix 2.6版本, 项配置下使用nacos服务发现。 搜索了之前的Issue没发现有类似的问题

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uri": "/v1/*",
"upstream": {
"service_name": "APISIX-NACOS",
"type": "roundrobin",
"discovery_type": "nacos"
}
}'

请求无法通过,提示
2021/06/12 07:26:50 [error] 47#47: *213366 [lua] init.lua:470: http_access_phase(): failed to set upstream: discovery nacos is uninitialized, client: 172.20.0.1, server: _, request: "GET /v1/t HTTP/1.1", host: "127.0.0.1:9080"

Environment

使用的Mac docker环境
image

@Yiyiyimu
Copy link
Member

Hi @YangHuiFor have you configured nacos in apisix config correctly? Could you show config.yaml and how you set up nacos

@yimuczhou
Copy link
Author

Hi @YangHuiFor have you configured nacos in apisix config correctly? Could you show config.yaml and how you set up nacos
hi @Yiyiyimu

this my config.yaml
image

this my nacos
image

@tokers
Copy link
Contributor

tokers commented Jun 13, 2021

@YangHuiFor It looks like the nacos client in APISIX was not initialized correctly, you may need to look through the error.log and found some clues about this (check out the reload/start/restart timing).

@yimuczhou
Copy link
Author

@tokers
error.log
2021/06/14 02:50:49 [error] 46#46: *2725467 [lua] init.lua:470: http_access_phase(): failed to set upstream: discovery nacos is uninitialized, client: 172.20.0.1, server: _, request: "GET /v1/t HTTP/1.1", host: "127.0.0.1:9080"

@tokers
Copy link
Contributor

tokers commented Jun 14, 2021

@tokers
error.log
2021/06/14 02:50:49 [error] 46#46: *2725467 [lua] init.lua:470: http_access_phase(): failed to set upstream: discovery nacos is uninitialized, client: 172.20.0.1, server: _, request: "GET /v1/t HTTP/1.1", host: "127.0.0.1:9080"

Well, I mean are there any log messages that can tell us the reason what the discovery nacos can not be initialized?

@spacewander
Copy link
Member

Closed as lack of response.

@jxljf
Copy link

jxljf commented Sep 10, 2021

please execute 'make reload' after modify conf.yaml

@zemelLeong
Copy link

@tokers
error.log
2021/06/14 02:50:49 [error] 46#46: *2725467 [lua] init.lua:470: http_access_phase(): failed to set upstream: discovery nacos is uninitialized, client: 172.20.0.1, server: _, request: "GET /v1/t HTTP/1.1", host: "127.0.0.1:9080"

Well, I mean are there any log messages that can tell us the reason what the discovery nacos can not be initialized?

I have same issue. I get this error.log when I execute command docker-compose -p docker-apisix up -d to start apisix.
image

@zemelLeong
Copy link

@tokers
error.log
2021/06/14 02:50:49 [error] 46#46: *2725467 [lua] init.lua:470: http_access_phase(): failed to set upstream: discovery nacos is uninitialized, client: 172.20.0.1, server: _, request: "GET /v1/t HTTP/1.1", host: "127.0.0.1:9080"

Well, I mean are there any log messages that can tell us the reason what the discovery nacos can not be initialized?

I have same issue. I get this error.log when I execute command docker-compose -p docker-apisix up -d to start apisix.
image

never mind. the discovery need in the root.
https://github.com/apache/apisix/blob/master/conf/config-default.yaml

@luyi1994
Copy link

luyi1994 commented Aug 4, 2024

I have the same problem 。。

@luyi1994
Copy link

luyi1994 commented Aug 4, 2024

[error] 50#50: *152 [lua] init.lua:548: handle_upstream(): failed to set upstream: discovery nacos is uninitialized

@zhoujiexiong
Copy link
Contributor

#11528

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

No branches or pull requests

8 participants