docker run apisix1.1, The error.log file keeps outputting warn logs
Issue description
config.yaml setting config_center: yaml
error.log info : 2020/04/20 03:15:29 [warn] 26#26: *10929 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer 2020/04/20 03:15:29 [warn] 26#26: *10930 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer 2020/04/20 03:15:29 [warn] 16#16: *10946 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer 2020/04/20 03:15:29 [warn] 16#16: *10947 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer 2020/04/20 03:15:29 [warn] 16#16: *10948 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer 2020/04/20 03:15:29 [warn] 16#16: *10949 [lua] config_yaml.lua:118: wait for more time, context: ngx.timer
Environment
docker image: apache/apisix:1.1-alpine
- apisix version (cmd:
apisix version): - OS:
@xuliangyong How to reproduce the problem?
config.yaml setting
config_center: yaml
when you enable yaml as config_center, you need to set a valid apisix.yaml file.
here is a valid apisix.yaml file example:
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
if you still have a problem, please provide your conf/apisix.yaml file.
config.yaml setting config_center: yamlwhen you enable
yamlasconfig_center, you need to set a validapisix.yamlfile.here is a valid
apisix.yamlfile example:routes: - uri: /hello upstream: nodes: "127.0.0.1:1980": 1 type: roundrobin #ENDif you still have a problem, please provide your
conf/apisix.yamlfile. apisix.yaml
routes:
-
uri: /
plugins:
xxxx: {}
-
uri: /cas
upstream:
nodes:
"gateway-svc": 1
type: roundrobin
-
uri: /html/
upstream:
nodes:
"svc-proxy": 1
type: roundrobin
#END
How to reproduce the problem?
1 docker run --rm -it apache/apisix:1.1-alpine /bin/bash 2 vi conf/config.yaml setting enable_ipv6: false config_center: yaml
3 vi conf/apisix.yaml
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
4 apisix init
5 /usr/local/openresty/bin/openresty -p /usr/local/apisix
6 curl http://localhost:9080/hello response:
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty</center>
</body>
</html>
6 curl http://localhost:9080/hello response:
your response is correct because you do not start an upstream server which listens on the 1980 port.
you can make a try with this example.
and you make a test with curl -i http://127.0.0.1:9080/ and curl -i http://127.0.0.1:9080/js/fresh.js. it works fine at my local machine.
routes:
-
uri: /
plugins:
proxy-rewrite:
host: iresty.com
upstream:
nodes:
"iresty.com:80": 1
type: roundrobin
-
uri: /js/fresh.js
plugins:
proxy-rewrite:
host: iresty.com
upstream:
nodes:
"iresty.com:80": 1
type: roundrobin
#END
plugins: xxxx: {}
it seems like an invalid plugin name, please confirm it. and your yaml contain bad indentation. I reformatted it.
routes:
-
uri: /
plugins:
xxxx: {}
-
uri: /cas
upstream:
nodes:
"gateway-svc": 1
type: roundrobin
-
uri: /html/
upstream:
nodes:
"svc-proxy": 1
type: roundrobin
#END
plugins: xxxx: {}
it seems like an invalid plugin name, please confirm it. and your yaml contain bad indentation. I reformatted it.
routes:
-
uri: /
plugins:
xxxx: {}
-
uri: /cas
upstream:
nodes:
"gateway-svc": 1
type: roundrobin
-
uri: /html/
upstream:
nodes:
"svc-proxy": 1
type: roundrobin
#END
In the latest docker version, this problem can no longer be reproduced, so I think it can be closed now. @xuliangyong @spacewander
I still have the issue with 3.7.0 using a very basic config
apisix:
node_listen: 8080
deployment:
role: data_plane
role_data_plane:
config_provider: yaml
@idbeta Can you reproduce it also ?
It looks like somehow adding the #END fixes this, not sure why ? This is not something standard in YAML, I could not find anything in the docs about this behaviour.