Giter Site home page Giter Site logo

Comments (3)

kayx23 avatar kayx23 commented on June 13, 2024

The repetitive logging would stop when a working configuration is present in apisix.yaml it seems.

For example, it won't stop logging warning and errors with just the creation of the file:

sudo docker exec apache-apisix bash -c "echo '#END' > /usr/local/apisix/conf/apisix.yaml"

It would stop when a working config is present:

docker exec -i apache-apisix sh -c 'cat > /usr/local/apisix/conf/apisix.yaml <<_EOC_
routes:
  -
    id: httpbin
    uri: /*
    upstream:
      nodes:
        "httpbin.org": 1
      type: roundrobin
    plugin_config_id: 1

plugin_configs:
  -
    id: 1
    plugins:
      response-rewrite:
        body: "Hello APISIX\n"
    desc: "response-rewrite"
#END
_EOC_'

APISIX is usable, however, just with a very polluted log.

Please evaluate if this is something to fix for. If this is not a concern, the issue can be closed. It doesn't block me for anything personally.

from apisix-docker.

kayx23 avatar kayx23 commented on June 13, 2024

Another way is to mount the file apisix.yaml at container start up, with a working config (e.g. a route) inside the file.

If you mount an empty file, you could get the following:

/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
/usr/local/openresty//luajit/bin/luajit: /usr/local/apisix/deps/share/lua/5.1/tinyyaml.lua:756: bad argument #1 to 'sfind' (string expected, got nil)
stack traceback:
        [C]: in function 'sfind'
        /usr/local/apisix/deps/share/lua/5.1/tinyyaml.lua:756: in function 'parsedocuments'
        /usr/local/apisix/deps/share/lua/5.1/tinyyaml.lua:818: in function 'parse'
        /usr/local/apisix/apisix/cli/file.lua:321: in function 'read_yaml_conf'
        /usr/local/apisix/apisix/cli/ops.lua:174: in function </usr/local/apisix/apisix/cli/ops.lua:157>
        /usr/local/apisix/apisix/cli/ops.lua:976: in function 'execute'
        ./apisix/cli/apisix.lua:40: in main chunk
        [C]: at 0x56493d0c23d0

from apisix-docker.

Revolyssup avatar Revolyssup commented on June 13, 2024

@kayx23 These are just yaml parsing warnings present that go away once a valid configuration is given. I think since these are warning logs and not error logs, it's fine to have them.

from apisix-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.