TaeyeongKwak commented on issue #12618:
URL: https://github.com/apache/apisix/issues/12618#issuecomment-3310524412

   @Baoyuantop @Crazy-xyr 
   
   After conducting further tests, I've confirmed that when plugin metadata is 
added and then deleted, the subsequent single GET API request returns a 500 
error.
   
   Below are the steps I followed for testing:
   
   1. Start APISIX
   ```shell
   curl -sL https://run.api7.ai/apisix/quickstart | sh
   ```
   
   2. Initial single GET request (404 error)
   ```shell
   curl -i --location 
"http://localhost:9180/apisix/admin/plugin_metadata/file-logger"; --header 
"x-api-key: $APISIX_API_KEY"
   
   HTTP/1.1 404 Not Found
   Date: Fri, 19 Sep 2025 04:25:29 GMT
   Content-Type: application/json
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/3.13.0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   X-API-VERSION: v3
   
   {"message":"Key not found"}
   ```
   
   3. Create plugin metadata
   ```shell
   curl -i --location --request PUT 
'http://localhost:9180/apisix/admin/plugin_metadata/file-logger' \
   --header 'x-api-key: $APISIX_API_KEY' \
   --header 'Content-Type: application/json' \
   --data '{
       "log_format": {
           "host": "$host",
           "client_ip": "$remote_addr"
       }
   }'
   
   HTTP/1.1 200 OK
   Date: Fri, 19 Sep 2025 04:26:01 GMT
   Content-Type: application/json
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/3.13.0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   X-API-VERSION: v3
   
   
{"key":"/apisix/plugin_metadata/file-logger","value":{"id":"file-logger","log_format":{"client_ip":"$remote_addr","host":"$host"}}}
   ```
   
   4. Delete plugin metadata
   ```shell
   curl -i --location --request DELETE 
'http://localhost:9180/apisix/admin/plugin_metadata/file-logger' \
   --header 'x-api-key: $APISIX_API_KEY'
   
   HTTP/1.1 200 OK
   Date: Fri, 19 Sep 2025 04:26:43 GMT
   Content-Type: application/json
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/3.13.0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   X-API-VERSION: v3
   
   {"key":"/apisix/plugin_metadata/file-logger","deleted":"1"}
   ```
   
   5. Single GET request (500 error)
   ```shell
   curl -i --location 
"http://localhost:9180/apisix/admin/plugin_metadata/file-logger"; --header 
"x-api-key: $APISIX_API_KEY"
   
   HTTP/1.1 500 Internal Server Error
   Date: Fri, 19 Sep 2025 04:26:58 GMT
   Content-Type: text/html; charset=utf-8
   Content-Length: 249
   Connection: close
   Server: APISIX/3.13.0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   
   <html>
   <head><title>500 Internal Server Error</title></head>
   <body>
   <center><h1>500 Internal Server Error</h1></center>
   <hr><center>openresty</center>
   <p><em>Powered by <a 
href="https://apisix.apache.org/";>APISIX</a>.</em></p></body>
   </html>
   ```


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