WillDera opened a new issue, #11952:
URL: https://github.com/apache/apisix/issues/11952

   ### Description
   
   I followed the [plugin 
develop](https://apisix.apache.org/docs/apisix/plugin-develop/) documentation 
to create a new plugin and modify the existing authz-casbin plugin. Below is 
what my folder structure looks like
   
   
![Image](https://github.com/user-attachments/assets/89844522-cc1b-4c02-8a51-a18911eaff48)
   
   This is my apisix conf.yaml file
   ```lua
   apisix:
     node_listen: 9080              # APISIX listening port
     enable_ipv6: false
     # Add these lines
     extra_lua_path: "/usr/local/apisix/custom-plugin/?.lua"
     log_level: debug
     enable_control: true
     control:
       ip: "0.0.0.0"
       port: 9092
     
   
   deployment:
     admin:
       allow_admin:               # 
https://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.
   
       admin_key:
         - name: "admin"
           key: edd1c9f034335f136f87ad84b625c8f1
           role: admin                 # admin: manage all configuration data
   
         - name: "viewer"
           key: 4054f7cf07e344346cd3f287985e76a2
           role: viewer
   
     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
   ``` 
   
   Here is my apisix dashboard conf.yaml
   ```lua
   conf:
     listen:
       host: 0.0.0.0     # `manager api` listening ip or host name
       port: 9000          # `manager api` listening port
     etcd:
       endpoints:          # supports defining multiple etcd host addresses for 
an etcd cluster
         - etcd:2379
   
                           # etcd basic auth info
       # username: "root"    # ignore etcd username if not enable etcd auth
       # password: "123456"  # ignore etcd password if not enable etcd auth
     log:
       error_log:
         level: warn       # supports levels, lower to higher: debug, info, 
warn, error, panic, fatal
         file_path:
           logs/error.log  # supports relative path, absolute path, standard 
output
                           # such as: logs/error.log, /tmp/logs/error.log, 
/dev/stdout, /dev/stderr
   authentication:
     secret:
       secret              # secret for jwt token generation.
                           # NOTE: Highly recommended to modify this value to 
protect `manager api`.
                           # if it's default value, when `manager api` start, 
it will generate a random string to replace it.
     expire_time: 3600     # jwt token expire time, in second
     users:
       - username: admin   # username and password for login `manager api`
         password: admin
       - username: user
         password: user
   
   plugin_attr:
     prometheus:
       export_addr:
         ip: "0.0.0.0"
         port: 9091
   
   plugins:
     - authz-casbin
     - jwt-extractor
     - jwt-auth
   ```
   
   Here is my docker-compose.yml file found in `example/docker-compose.yml`
   
   The issue here is that I dont see logs in the 
`/usr/local/apisix-dashboard/logs/error.log`  and 
`/usr/local/apisix-dashboard/logs/access.log` nor in 
`/usr/local/apisix/logs/error.log`.
   
   I'm not sure what I'm doing wrongly. I can see the plugin files are properly 
copied into the apisix server container in the folder I described:
   ```
   ❯ docker exec docker-apisix-apisix-1 ls 
/usr/local/apisix/custom-plugin/apisix/plugins
   authz-casbin.lua
   jwt-extractor.lua
   ```
   
   but when I make the following curl request
   
   ```
   curl --request PUT \
     --url http://127.0.0.1:9180/apisix/admin/routes \
     --header 'Content-Type: application/json' \
     --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
     --data '{
     "id":"jwt-extractor",
     "uri":"/test",
     "plugins": {
                "jwt-extractor": {
                        "role_claim": "role"
                }
        }
   }'
   ```
   
   I get the following response back
   ```
   {
        "error_msg": "unknown plugin [jwt-extractor]"
   }
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.11.0-debian
   - Operating system (run `uname -a`): debian (docker image)
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 1.19,0
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): 3.5.0 (the curl request returns 404)
   - APISIX Dashboard version, if relevant: 3.0.1
   - Plugin runner version, for issues related to plugin runners: Not Sure 
where to get this
   - LuaRocks version, for installation issues (run `luarocks --version`): Not 
Sure where to get this
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to