help request: Plugins do not work propely
Description
I have triying to configurate apisix in minikube (before to dpeloy it in my real cluster). I have using the helm chart with kustomize. I have configured a global rule (it's just a example):
apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
name: global-response-rewrite
namespace: apisix
spec:
ingressClassName: apisix
plugins:
- name: response-rewrite
enable: true
config:
headers:
add:
X-Plugin-Config: "example-response-rewrite"
In adition I have openid-connect rule configured in one route:
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
name: auth-plugin-config
namespace: apisix
spec:
plugins:
- name: openid-connect
config:
discovery: <idp-url>
client_id: apisix
client_secret: <secret>
bearer_only: true
ssl_verify: true
_meta:
disable: false
The openid-connect is working properly but the global rule not. Logs do not show any error.
In addition, I don't see any plugin on the dashboad and I don't know why.
Any idea?
Thank you in advance
Environment
- APISIX version (run
apisix version): 3.13.0 - Operating system (run
uname -a): Linux apisix-67b96cdf54-gqpj7 6.10.14-linuxkit aarch64 GNU/Linux - OpenResty / Nginx version (run
openresty -Vornginx -V): openresty/1.27.1.2 - etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info): - APISIX Dashboard version, if relevant: included in the helm chart
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run
luarocks --version):
// The openid-connect is working properly but the global rule not. Logs do not show any error.
Is there a reproduction step for the global plugin that is not working properly? Also, how do you determine if this global plugin is not working properly?
Written by @dosu, edited by moonming
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Can reproduce and I see property \"headers\" validation failed: object matches none of the required] in the ingress controller log:
failed to execute adc command {"error": "ADC execution error for GatewayProxy/ingress-apisix/apisix-config: [ServerAddr: http://10.244.0.7:9180, Err: invalid global_rules at index 0, err: failed to check the configuration of plugin response-rewrite err: property \"headers\" validation failed: object matches none of the required]", "config": {"name":"GatewayProxy/ingress-apisix/apisix-config","serverAddrs":["http://10.244.0.7:9180"],"tlsVerify":false}}
headers.set and headers.remove work.
headers.add should be supported though cc: @AlinsRan @ronething
@alvarobem @kayx23 for headers.add field, it should be an array.
ref:
- https://apisix.apache.org/docs/apisix/plugins/response-rewrite/
- https://github.com/apache/apisix/blob/aec606d420f52196b0aee69d27876506126b647c/apisix/plugins/response-rewrite.lua#L57-L65
- https://github.com/apache/apisix/blob/c56bace23af3cb3312674647db3179f508ea0763/t/plugin/response-rewrite2.t#L567-L570
Oops I misread and thought it was proxy-rewrite (where the add is an object)
@alvarobem
First, check which version of the APISIX Ingress Controller you are using (check the container image tag); also, confirm your deployment mode, whether etcd or standalone.
If you are using standalone deployment, the embedded APISIX dashboard will not work, which is expected.
Hello @bzp2010.
I am using etcd deployment mode and the ingress controller version is 2.0.0-rc3
@alvarobem
Has the Ingress Controller reported any synchronization errors?
If not, you need to inspect the plugin configuration stored in etcd to determine whether the issue occurs during the ingress controller's configuration transformation or at the APISIX data plane. This helps us clarify the situation and better diagnose the problem.
As a guide, you have the following methods available:
- Use the Admin API to inspect your resources, global_rules, or routes.
- Directly check the configuration using
etcdctl get --prefix /.
@bzp2010
Hello! I have no error on Ingress controller and the global rule is not created in the etcd (using admin api):
curl http://localhost:8080/apisix/admin/global_rules -H "X-API-KEY: <KEY>"
{"total":0,"list":[]}
But the global rule is created on kubernetes
This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.