You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/24 20:46:04 UTC

[GitHub] [apisix] bisakhmondal commented on issue #6175: request help: api-breaker plugin donot work

bisakhmondal commented on issue #6175:
URL: https://github.com/apache/apisix/issues/6175#issuecomment-1020531386


   > In fact, I refer to the example of official documents.
   see as https://apisix.apache.org/zh/docs/apisix/plugins/api-breaker/
   503 is an http error code that the resource cannot be found. Therefore, although upstream is not configured, the http request return 503.
   
   Hi as @starsz pointed out, the error is due to missing upstream configuration. If you open the logs/error.log you will see an entry there,
   > 2022/01/25 02:06:08 [error] 3128311#3128311: *3394 [lua] init.lua:520: http_access_phase(): failed to set upstream: missing upstream configuration in Route or Service, client: 127.0.0.1, server: _, request: "GET /test/index.html HTTP/1.1", host: "127.0.0.1:9080"
   
   Due to security reasons, we don't throw elaborate error messages along with HTTP status codes during request-response lifecycle. The 503 you are seeing is not the one you may have configured (if) inside your api-breaker schema. It's from the apisix internal component following the semantic HTTP response codes when it hits an error
   > The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.
   
   Feel free to test it with the configuration @starsz shared, you will get something like
   ```
   curl -i http://127.0.0.1:9080/test/index.html     
   
   HTTP/1.1 502 Bad Gateway
   Date: Mon, 24 Jan 2022 20:39:22 GMT
   Content-Type: text/html; charset=utf-8
   Content-Length: 154
   Connection: keep-alive
   Server: APISIX/2.11.0
   X-APISIX-Upstream-Status: 502
   
   <html>
   <head><title>502 Bad Gateway</title></head>
   <body>
   <center><h1>502 Bad Gateway</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>
   
   ```
   
   Hope, this solves your concern. Thank you.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org