ServiceNow instance responds with 502 (Bad Gateway)SummaryServiceNow strives always to provide the best possible service to our customers. As with any complex software system, it is feasible that your instance may return an error message. If your instance or the infrastructure between ServiceNow and the client experiences an unexpected event, you may see an HTTP 502 (Bad Gateway) returned. These types of errors should be infrequent. What kinds of transactions can trigger a 502? Any transaction made to the instance can trigger a 502. API calls are more likely to experience 502 errors due to the rate they are initiated against an instance. What happens to my transaction if I get a 502? If you receive a 502 response from ServiceNow, you can assume your transaction failed to run. Depending on your business logic, you should check if it failed and try again if necessary. Can ServiceNow retry on failure? For HTTP GET requests, we have already tried before responding with a 502. Our system will push the GET request again against a different endpoint if we believe there is an error with the original endpoint. Due to their non-idempotent nature, HTTP POST requests are not automatically retried. The client should respond to the 502 and try again or throw an appropriate error. Does a 502 response mean my instance is down? Not in every case, no. ServiceNow instances are clusters of available nodes; only a single node may be affected. Our load balancer will move users and API calls to additional nodes as necessary. What can I do to understand what caused 502 responses? Using the transaction log, you can try to locate the time of the 502 and review the transactions that were running at the time. Reviewing the Platform Performance Metrics at the time of the 502 can also help understand the state of the instance. The instance is functioning, but I still received a 502 response. How is that possible? We have seen customers with internal proxies on their networks receive 502 responses. If an internet proxy exists on your network, that may explain this situation. Your instance has multiple nodes available for our load balancer to choose from; one user may be on an affected node and another on a node with no issues. What is ServiceNow’s recommendation for failed API calls due to 502 responses? It is considered best practice to apply logic on the API client to retry the request in the event of a 502. Related LinksIf this article does not have the information required or you need additional help, please reach out to our support organization.