Unexpected Response From Server Please Try Again or Switch Off Javascript
Yous're viewing Apigee Border documentation.
View Apigee 10 documentation.
Videos
Lookout man the post-obit video to learn more than about solving 503 Service Unavailable Errors.
Video | Description |
---|---|
503 Service Unavailable Error from Backend Server | Learn about the post-obit:
|
Symptom
The client application receives an HTTP response status 503 with the message Service Unavailable following an API proxy call.
Error messages
You can see one of the following error messages:
HTTP/ane.1 503 Service Unavailable
HTTP/1.ane 503 Service Unavailable: Back-stop server is at capacity
You might as well see an error message like the following in the HTTP response:
The server is temporarily unable to service your request due to maintenance downtime or chapters problems. Delight try over again later on.
Note: The above response code and fault message are only examples. In some cases, you lot may receive only the fault response code without any error message. The format and the content of the error response code and the error message may vary depending on the backend server implementation.
Causes
The HTTP status lawmaking 503 means that the server is currently unable to handle the incoming requests. Usually, this mistake occurs because the server is too busy or is temporarily down for maintenance.
Possible causes for the 503 Service Unavailable response are:
Cause | Clarification | Who can perform the troubleshooting steps |
---|---|---|
Overloaded Server | The backend server is overloaded or beyond its capacity and cannot handle whatever new incoming client requests. | Edge Public and Private Cloud users |
Server under maintenance | The backend server may be under maintenance temporarily. | Edge Public and Private Cloud users |
Cause: Overloaded Server/Server under Maintenance
In Apigee Border, the 503 Service Unavailable Fault can be returned from a backend server under either of the following circumstances:
- A backend server is overloaded/busy and cannot handle any new requests.
- The backend server is down for a temporary menses due to maintenance.
Diagnosis
To diagnose the error, you tin can use any of the post-obit three methods:
- Trace tool
- Nginx access logs
- Directly call to backend server
Click the tabs below to learn about each method.
Trace tool
- Enable the trace session, and make the API call to reproduce the upshot - 503 Service Unavailable.
- Select one of the declining requests and examine the trace.
- Navigate through various phases of the trace and locate where the failure occurred.
- If y'all find that the 503 fault is returned as a response from the target server, the cause for 503 error is the target server.
Here's a sample trace screenshot showing 503 Service Unavailable response received from the target server:
- Click the Response received from target server phase and go through the Response Headers and Response Content sections to see if they have any useful data:
- The Response Headers may comprise the Server header, which indicates where the error response was sent from.
- The Response Content may contain additional data about why the target server sent the 503 response code.
- Confirm that the 503 fault is coming from the target server by checking the values of Ten-Apigee-fault-source and X-Apigee-fault-code in the AX (Analytics Information Recorded) Stage in the trace using the steps given below:
- Click on AX (Analytics Data Recorded) Stage every bit shown in the screenshot beneath:
- Scroll downwards the Phase Details to the Response Headers section and make up one's mind the values of 10-Apigee-fault-code and X-Apigee-fault-source as shown below:
- If the values of X-Apigee-fault-source and X-Apigee-fault-code lucifer the values shown in the beneath table, you can confirm that the 503 fault is coming from the target server:
Response Headers Value X-Apigee-fault-source target X-Apigee-fault-lawmaking messaging.adaptors.http.flow.ErrorResponseCode
- Bank check if you are using proxy chaining i.e. if the target server/target endpoint is invoking another proxy in Apigee. To determine this:
- Navigate back to the Request sent to target server phase and click the Show Curl push button and make up one's mind the target server host alias.
- If the target server host alias is pointing to a virtual host alias, then information technology'south proxy chaining. In this instance, y'all need to repeat all the to a higher place steps for the chained proxy till you determine what is actually causing the 503 Service Unavailable error. In these cases 503 Service Unavailable may happen in other chained proxies at other stages likewise which can be diagnosed using this playbook.
- If the target server host alias points to your backend server, then go to Resolution.
Nginx admission logs
You can also refer to Nginx lccess logs to determine whether the 503 status lawmaking was sent by the backend server. This is particularly useful if the issue has occurred in the past or if the issue is intermittent and you are unable to capture the trace in UI. Utilise the following steps to determine this information from Nginx admission logs:
- Check the Nginx admission logs.
/opt/apigee/var/log/edge-router/nginx/<org>~<env>.<port#>_access_log
- Search for any 503 Errors for the specific API proxy during a specific duration (if the problem happened in the past) or for any requests still declining with 503.
- If there are any 503 Errors, then check if the error is coming from the backend server. If the values of X-Apigee-mistake-source and X-Apigee-fault-code match the values shown in the table beneath, the 503 error is coming from the backend server:
Response Headers Value Ten-Apigee-fault-source target X-Apigee-fault-lawmaking messaging.adaptors.http.flow.ErrorResponseCode Hither'due south a sample entry showing the 503 error acquired by the target server:
- Review the specific API Proxy and ensure that y'all are using proxy chaining i.e., if the target server/target endpoint is not invoking another proxy in Apigee. If you are using proxy chaining, you need to repeat all the above steps for the chained proxy until you lot determine what is actually causing the 503 Service Unavailable error. In these cases, 503 Service Unavailable may happen in other chained proxies at other stages besides, which you tin diagnose using this playbook.
- If you confirm that yous are not using proxy chaining, and the 503 error is coming from your backend server, then get to Resolution.
Phone call to Backend Server
You can make a direct telephone call to the backend server and verify that y'all are getting the aforementioned 503 Service Unavailable response as received when the request was made through Apigee Edge.
- Ensure that you take all the required headers, query parameters and any credentials that need to be passed to the backend server as part of the asking.
- If the backend service is publicly accessible, y'all can use the curl command, Postman or whatever other Remainder Client and invoke the backend server API straight.
- If the backend server is accessible simply from the Message Processors, you can utilize the curl command, Postman or whatever other REST Customer and invoke the backend server API directly from the Bulletin Processor.
- Verify that the backend service is indeed returning 503 Service Unavailable error.
Resolution
If you lot ascertain that the 503 error is coming from the backend server, y'all can do the following to resolve the issue:
- If the issue is caused because the backend server is downward for maintenance, you tin can bring the backend server online subsequently the maintenance menstruation.
- If the issue is caused considering the backend server is overloaded, then fix the issue if you have admission to the backend server. Otherwise you may need to work with your backend server team to ready the issue.
Diagnose Bug using API Monitoring
API Monitoring enables you to isolate problem areas speedily to diagnose error, performance, and latency issues and their source, such as developer apps, API proxies, backend targets, or the API platform.
Stride through a sample scenario that demonstrates how to troubleshoot 5xx issues with your APIs using API Monitoring. For example, you may want to prepare an warning to be notified when the number of messaging.adaptors.http.menstruum.ErrorResponseCode faults exceeds a item threshold.
Must gather diagnostic information
If the problem persists even subsequently following the to a higher place instructions, delight assemble the following diagnostic information, and then contact Apigee Back up.
If you are a public cloud user, provide the following information:
- Organization Proper noun
- Environs Name
- API Proxy Proper name
- Consummate curl command to reproduce the 503 error
- Trace file containing the requests with 503 Service Unavailable error
- If the 503 errors are not occurring currently, provide the fourth dimension menses with the timezone information when 503 errors occurred in the by.
If you are a private cloud user, provide the following data:
- Complete mistake bulletin observed for the declining requests.
- Organization, Environment Proper noun and API Proxy Name for which yous are observing 503 errors.
- API Proxy Bundle.
- Trace file containing the requests with 503 Service Unavailable error.
- Nginx access logs.
/opt/apigee/var/log/edge-router/nginx/<org>~<env>.<port#>_access_log
- Bulletin Processor logs.
/opt/apigee/var/log/border-message-processor/logs/organization.log
- The time period with the timezone information when the 503 errors occurred.
Source: https://docs.apigee.com/api-platform/troubleshoot/runtime/503-service-unavailable-backend-server
0 Response to "Unexpected Response From Server Please Try Again or Switch Off Javascript"
Post a Comment