apisix icon indicating copy to clipboard operation
apisix copied to clipboard

docker run apisix1.1, The error.log file keeps outputting warn logs

Open xuliangyong opened this issue 6 years ago • 9 comments

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 avatar Apr 20 '20 07:04 xuliangyong

@xuliangyong How to reproduce the problem?

moonming avatar Apr 20 '20 08:04 moonming

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.

membphis avatar Apr 20 '20 08:04 membphis

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. 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

xuliangyong avatar Apr 20 '20 08:04 xuliangyong

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>

xuliangyong avatar Apr 20 '20 08:04 xuliangyong

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

membphis avatar Apr 21 '20 15:04 membphis

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

membphis avatar Apr 21 '20 15:04 membphis

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

membphis avatar Apr 21 '20 15:04 membphis

In the latest docker version, this problem can no longer be reproduced, so I think it can be closed now. @xuliangyong @spacewander

idbeta avatar Mar 01 '21 08:03 idbeta

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.

kedare avatar Feb 06 '24 12:02 kedare