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

bug: log-rotate #10795

Closed
Jasonbr opened this issue Jan 10, 2024 · 24 comments
Closed

bug: log-rotate #10795

Jasonbr opened this issue Jan 10, 2024 · 24 comments
Labels
bug Something isn't working

Comments

@Jasonbr
Copy link

Jasonbr commented Jan 10, 2024

Current Behavior

在config.yaml中开启log-rotate插件后其他插件都默认开启的插件都失效了,也需要在plugins下开启。
plugins:
# the plugins you enabled
- log-rotate
plugin_attr:
log-rotate:
interval: 3600 # rotate interval (unit: second)
max_kept: 168 # max number of log files will be kept
max_size: -1 # max size of log files will be kept
enable_compression: false # enable log file compression(gzip) or not, default false

Expected Behavior

开启 - log-rotate的时候不影响其他默认开启的插件。

Error Logs

024/01/10 07:26:22 [warn] 58#58: 13 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 55#55: 2 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 61#61: 16 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 53#53: 11 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 56#56: 3 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 47#47: 12 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 48#48: 7 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 52#52: 9 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 51#51: 5 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 62#62: 15 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 59#59: 14 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 50#50: 4 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 49#49: 6 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 57#57: 1 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 60#60: 17 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 49#49: 6 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 52#52: 9 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 56#56: 3 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 60#60: 17 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 59#59: 14 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 61#61: 16 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 50#50: 4 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 57#57: 1 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 55#55: 2 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 47#47: 12 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 53#53: 11 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 51#51: 5 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 48#48: 7 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 62#62: 15 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 58#58: 13 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 63#63: 8 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 63#63: 8 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 54#54: 10 [lua] plugin.lua:173: load(): new plugins: {"log-rotate":true}, context: init_worker_by_lua
2024/01/10 07:26:22 [warn] 54#54: 10 [lua] plugin.lua:223: load_stream(): new plugins: {"syslog":true,"mqtt-proxy":true,"ip-restriction":true,"limit-conn":true}, context: init_worker_by_lua

Steps to Reproduce

1、通过docker-compose部署
2、在config.yaml中开启log-rotate插件
plugins:
# the plugins you enabled
- log-rotate
plugin_attr:
log-rotate:
interval: 3600 # rotate interval (unit: second)
max_kept: 168 # max number of log files will be kept
max_size: -1 # max size of log files will be kept
enable_compression: false # enable log file compression(gzip) or not, default false
3、然后通过正则的一些插件就失效了。

Environment

  • APISIX version (run apisix version):
    2.15.1-alpine

  • Operating system (run uname -a):
    Linux YS-YS-0026 4.15.0-193-generic feature: opentracing, support Zipkin first #204-Ubuntu SMP Fri Aug 26 19:20:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

  • OpenResty / Nginx version (run openresty -V or nginx -V):
    nginx version: openresty/1.21.4.1
    built with OpenSSL 1.1.1n 15 Mar 2022
    TLS SNI support enabled
    configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.21 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.11 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-stream --with-http_ssl_module

    • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
      etcd:3.4.15
  • APISIX Dashboard version, if relevant:
    apisix-dashboard:2.13-alpine

  • Plugin runner version, for issues related to plugin runners:
    log-rotate

  • LuaRocks version, for installation issues (run luarocks --version):
    /usr/local/bin/luarocks 3.8.0
    LuaRocks main command-line interface

@SilentEntity
Copy link
Contributor

Would you be able to respond in English, please .

@sheharyaar
Copy link
Contributor

Hi @Jasonbr , the log is alright, can you please give specific details for the issue?

@Jasonbr
Copy link
Author

Jasonbr commented Jan 11, 2024

@sheharyaar
After enabling the log rotate plugin in config.yaml, all other plugins that are enabled by default have become invalid and need to be enabled in plugins.
Plugins:
#The plugins you enabled
--Log rotate
Plugin_ Attr:
Log rotate:
Interval: 3600 # rotate interval (unit: second)
Max_ Ket: 168 # max number of log files will be kept
Max_ Size: -1 # max size of log files will be kept
Enable_ Compression: false # enable log file compression (gzip) or not, default false

And then some custom plugins through regularization all became invalid,It seems that it needs to be opened under Plugins:

@Jasonbr
Copy link
Author

Jasonbr commented Jan 11, 2024

This seems unreasonable

@season886
Copy link

season886 commented Jan 14, 2024

the same problem. my config.yaml everything is ok ,only add

plugins:
  - log-rotate

open-connect is not work,version on docker: apache/apisix:3.7.0-debian

@sheharyaar
Copy link
Contributor

Ok, I will have a look into this issue.

@sheharyaar
Copy link
Contributor

@Jasonbr @season886 , it would be helpful if you can provide me with route, upstream and relevant configs to test.

@season886
Copy link

season886 commented Jan 15, 2024

apisix config.yaml:

apisix:
  node_listen: 9080
  enable_ipv6: false
  enable_server_tokens: false
  enable_control: true
  control:
    ip: "0.0.0.0"
    port: 9092
nginx_config:
  error_log: /log/error.log
  error_log_level: error
  worker_rlimit_nofile: 65535
  worker_cpu_affinity: auto
  worker_processes: auto
  enable_server_tokens: off
  event:
    worker_connections: 65536
    accept_mutex: off
  http:
    enable_access_log: true
    access_log: /log/access.log
  http_configuration_snippet: |
      default_type  application/octet-stream;
      server_names_hash_bucket_size 128;
      client_header_buffer_size 32k;
      large_client_header_buffers 4 32k;
      client_body_buffer_size 1024k;
      sendfile on;
      sendfile_max_chunk 512k;
      tcp_nodelay on;
      tcp_nopush off;
      proxy_buffer_size  64k;
      proxy_buffers   32 64k;
      proxy_busy_buffers_size 128k;
      fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;
      fastcgi_buffer_size 4k;
      fastcgi_buffers 16 256k;
      fastcgi_busy_buffers_size 512k;
      fastcgi_temp_file_write_size 512k;
      gzip on;
      gzip_min_length 1k;
      gzip_buffers 4 16k;
      gzip_http_version 1.1;
      gzip_comp_level 2;
      gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
      gzip_vary on;
      gzip_proxied expired no-cache no-store private auth;
      gzip_disable "MSIE [1-6]\.";
      add_header X-Content-Type-Options nosniff;
deployment:
  admin:
    allow_admin:
      - 0.0.0.0/0
    admin_listen:
      ip: 0.0.0.0
      port: 9180
    admin_key:
      - 
        name: admin
        key: ******
        role: admin
  etcd:
    host:                           # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
      - "http://etcd:2379"          # multiple etcd address
    prefix: "/apisix"               # apisix configurations prefix
    timeout: 30                     # 30 seconds
plugins:
  - log-rotate
plugin_attr:
  prometheus:
    export_addr:
      ip: "0.0.0.0"
      port: 9091
  redirect:
    https_port: 443
  log-rotate:
    interval: 86400
    max_kept: 30   
    max_size: -1      
    enable_compression: true

@season886
Copy link

season886 commented Jan 15, 2024

route :

{
  "uri": "/admin/*",
  "name": "Admin",
  "desc": "Better系统ADMIN接口模块",
  "methods": [
    "GET",
    "POST",
    "PUT",
    "DELETE",
    "PATCH",
    "HEAD",
    "OPTIONS",
    "CONNECT",
    "TRACE",
    "PURGE"
  ],
  "host": "better.***.com",
  "plugins": {
    "cors": {
      "_meta": {
        "disable": true
      },
      "allow_credential": false,
      "allow_headers": "*",
      "allow_methods": "*",
      "allow_origins": "*",
      "expose_headers": "*",
      "max_age": 3600
    },
    "openid-connect": {
      "_meta": {
        "disable": false
      },
      "bearer_only": true,
      "client_id": "",
      "client_secret": "",
      "discovery": "https://oidc.***.com/.well-known/openid-configuration",
      "introspection_endpoint": "http://hydra:4445/admin/oauth2/introspect",
      "realm": "apisix"
    },
    "proxy-rewrite": {
      "scheme": "http"
    },
    "redirect": {
      "http_to_https": true
    }
  },
  "upstream_id": "495903293667541525",
  "status": 1
}

@season886
Copy link

upstream:

{
  "nodes": [
    {
      "host": "nginx",
      "port": 80,
      "weight": 1
    }
  ],
  "timeout": {
    "connect": 6,
    "send": 6,
    "read": 180
  },
  "type": "roundrobin",
  "scheme": "http",
  "pass_host": "pass",
  "name": "Nginx",
  "desc": "Nginx 转发服务",
  "keepalive_pool": {
    "idle_timeout": 60,
    "requests": 1000,
    "size": 320
  }
}

@Jasonbr
Copy link
Author

Jasonbr commented Jan 15, 2024

@sheharyaar
the same problem.
my config.yaml
apisix:
ssl:
fallback_sni: "0.0.0.0"
listen_port:
- 9443
node_listen: 9080 # APISIX listening port
enable_ipv6: false
show_upstream_status_in_response_header: true

allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- 0.0.0.0/0 # We need to restrict ip access rules for security. 0.0.0.0/0 is for test.
#- 172.0.0.0/8

admin_key:
- name: "admin"
key: 8c1c43c1f0ae5ed11a1939df0a5119be
role: admin # admin: manage all configuration data
# viewer: only can view configuration data
- name: "viewer"
key: 4054f7cf07e344346cd3f287985e76a2
role: viewer

enable_control: true
control:
ip: "0.0.0.0"
port: 9092

etcd:
host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
- "http://etcd:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds

plugin_attr:
prometheus:
export_addr:
ip: "0.0.0.0"
port: 9091

plugins:
# the plugins you enabled
- log-rotate
plugin_attr:
log-rotate:
interval: 3600 # rotate interval (unit: second)
max_kept: 24 # max number of log files will be kept
max_size: -1 # max size of log files will be kept
enable_compression: false # enable log file compression(gzip) or not, default false

#nacos
discovery:
nacos:
host:
- "http://nacos:[email protected]:9080"
prefix: "/nacos/v1/"
fetch_interval: 30 # default 30 sec
weight: 100 # default 100
timeout:
connect: 2000 # default 2000 ms
send: 2000 # default 2000 ms
read: 5000 # default 5000 ms

zhe route, upstream

{
"uri": "/fileManage/",
"name": "mino",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE"
],
"plugins": {
"proxy-rewrite": {
"regex_uri": [
"/fileManage/(.
)",
"/$1"
]
}
},
"upstream": {
"nodes": [
{
"host": "ip",
"port": 9321,
"weight": 1
}
],
"timeout": {
"connect": 600,
"send": 600,
"read": 600
},
"type": "roundrobin",
"scheme": "http",
"pass_host": "pass",
"keepalive_pool": {
"idle_timeout": 60,
"requests": 1000,
"size": 320
}
},
"status": 1
}

@sheharyaar
Copy link
Contributor

@season886 @Jasonbr ,can you try to enable log-rotate in the config-default.yml with the options and also can you set the log level to info. Let me know the results and the logs

@shreemaan-abhishek shreemaan-abhishek added the bug Something isn't working label Jan 15, 2024
@season886
Copy link

@sheharyaar here is logfile, "enable log-rotate in the config-default.yml and set log level to info"

2024/01/17 14:31:04 [info] 89#89: *162666 [lua] timers.lua:39: run timer[plugin#server-info], context: ngx.timer
2024/01/17 14:31:04 [info] 89#89: *162666 [lua] timers.lua:39: run timer[plugin#log-rotate], context: ngx.timer
2024/01/17 14:31:04 [info] 89#89: *162666 [lua] log-rotate.lua:271: rotate interval:86400, context: ngx.timer
2024/01/17 14:31:04 [info] 89#89: *162666 [lua] log-rotate.lua:272: rotate max keep:30, context: ngx.timer
2024/01/17 14:31:04 [info] 89#89: *162666 [lua] log-rotate.lua:273: rotate max size:-1, context: ngx.timer
2024/01/17 14:31:04 [info] 89#89: *162666 [lua] log-rotate.lua:274: rotate timeout:10000, context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] timers.lua:39: run timer[plugin#server-info], context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] timers.lua:39: run timer[plugin#log-rotate], context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] log-rotate.lua:271: rotate interval:86400, context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] log-rotate.lua:272: rotate max keep:30, context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] log-rotate.lua:273: rotate max size:-1, context: ngx.timer
2024/01/17 14:31:05 [info] 89#89: *163087 [lua] log-rotate.lua:274: rotate timeout:10000, context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] timers.lua:39: run timer[plugin#server-info], context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] timers.lua:39: run timer[plugin#log-rotate], context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] log-rotate.lua:271: rotate interval:86400, context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] log-rotate.lua:272: rotate max keep:30, context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] log-rotate.lua:273: rotate max size:-1, context: ngx.timer
2024/01/17 14:31:06 [info] 89#89: *163549 [lua] log-rotate.lua:274: rotate timeout:10000, context: ngx.timer

@hanqingwu
Copy link
Contributor

@sheharyaar , I have found something wrong with log-rotate plugin , when I enable plugin log-rotate in apisix/config.yaml , then I do

curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "username": "jack",
    "plugins": {
        "key-auth": {
            "key": "auth-one"
        }
    }
}'
{"error_msg":"invalid plugins configuration: unknown plugin [key-auth]"}

I disable plugin log-rotate , then try again , it works normal.

curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "username": "jack",
    "plugins": {
        "key-auth": {
            "key": "auth-one"
        }
    }
}'
{"key":"/apisix/consumers/jack","value":{"create_time":1705484829,"update_time":1705484829,"plugins":{"key-auth":{"key":"auth-one"}},"username":"jack"}}

test version under : apache/apisix:3.8.0-debian

I will try to find out why .

@hanqingwu
Copy link
Contributor

hanqingwu commented Jan 17, 2024

I find root cause, If config.yaml not define plugins, then it use alternate config-default.yaml, so most plugins works , because them enable in config-default.yaml.

plugin.lua

local function get_plugin_names(config)
    local http_plugin_names
    local stream_plugin_names

    if not config then
        -- called during starting or hot reload in admin
        local err
        local_conf, err = core.config.local_conf(true)    
        if not local_conf then
            -- the error is unrecoverable, so we need to raise it
            error("failed to load the configuration file: " .. err)
        end

        http_plugin_names = local_conf.plugins     
        stream_plugin_names = local_conf.stream_plugins
    else
        -- called during synchronizing plugin data
        http_plugin_names = {}
        stream_plugin_names = {}
        local plugins_conf = config.value        -- **here load config.yaml**
        -- plugins_conf can be nil when another instance writes into etcd key "/apisix/plugins/"
        if not plugins_conf then
            return true
        end

        for _, conf in ipairs(plugins_conf) do
            if conf.stream then
                core.table.insert(stream_plugin_names, conf.name)
            else
                core.table.insert(http_plugin_names, conf.name)
            end
        end
    end

    return false, http_plugin_names, stream_plugin_names
end

here load config-default.yaml
local_conf, err = core.config.local_conf(true)

So if config.yaml enable plugins, then only enable these plugins, the reset plugins were disabled.

@hanqingwu
Copy link
Contributor

@Jasonbr @season886 , I suggest you try to enable plugin log-rotate in config-default.yaml .

@sheharyaar
Copy link
Contributor

If this fixed, please close this issue @Jasonbr @season886

@season886
Copy link

@hanqingwu 谢谢你的帮助,由于apisix很多都是镜像部署的,手动去修改config-default.yaml不是很方便,建议推送一个pr去修复,目前只能临时进入镜像修改作为过渡

@hanqingwu
Copy link
Contributor

@season886 , 你可以手动修改一份,然后挂载进去 docker -v ,
具体要看 apisix 是否同意 config-default 默认启用 log-rotate

@season886
Copy link

@hanqingwu 试过了,我手动修改的config-default把log-rotate打开了,目前可以正常日志轮询并压缩。open-connect也正常了

@sheharyaar
Copy link
Contributor

@season886 if this is fixed, can we close the issue?

@Jasonbr
Copy link
Author

Jasonbr commented Jan 19, 2024

@sheharyaar @hanqingwu Thank you , it's ok!

@Jasonbr Jasonbr closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
@season886
Copy link

Is there anyone who can fix this bug ?

@Juncx
Copy link

Juncx commented Sep 20, 2024

Copy the plugins field in config-default.yaml to config.yaml, and it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

7 participants