5xx Status Codes
A 5xx code means the problem was caused by the server. With a 5xx code, the request can be present with no changes and you will get the requested result when the server has been fixed. With a 4xx code, typically the client or user has to fix an error before trying again, but there are some exceptions. You can read about best practices for 4xx codes.
These errors are caused by the server being unable to fulfill an apparently valid request from a visitor. Often, you will need the help of a server administrator to investigate them.
It is also important to consider that quite often, a chain of servers is handling an HTTP request, so that it may not be your server that is returning the error.
500 Internal Server Error
This error indicates that the server has encountered an unexpected condition. This often occurs when an application request cannot be fulfilled due to the application being configured incorrectly on the server.
501 Not Implemented
This error indicates that the HTTP method sent by the client is not supported by the server. This is most often caused by the server being out of date. It is a very rare error and generally requires that the web server be updated.
502 Bad Gateway
This error is usually due to improperly configured proxy servers. However, the problem may also arise when there is poor IP communication between back—end computers, when the client's server is overloaded, or when a firewall is functioning improperly.
The first step in resolving the issue is to clear the client's cache. This action should result in a different proxy being used to resolve the web server's content.
503 Service Unavailable
This error occurs when the server is unable to handle requests due to a temporary overload or due to the server being temporarily closed for maintenance. The error indicates that the server will only temporarily be down. It is possible to receive other errors in place of 503.
Contact the server administrator if this problem persists.
504 Gateway Timeout
This error occurs when a server somewhere along the chain does not receive a timely response from a server further up the chain. The problem is caused entirely by slow communication between upstream computers.
To resolve this issue, contact the system administrator.
505 HTTP Version Not Supported
This error occurs when the server refuses to support the HTTP protocol that has been specified by the client computer. This can be caused by the protocol not being specified properly by the client computer; for example, if an invalid version number has been specified.
506 Variant Also Negotiates
This error indicates that the server is not properly configured. Contact the system administrator to resolve this issue.
507 Insufficient Storage
This error indicates that the server is out of free memory. This is most likely to occur when an application that is being requested cannot allocate the necessary system resources to run.
To resolve the issue, the server's hard disk may need to be cleaned of any unnecessary documents to free up more hard disk space, its memory may need to be expanded, or it may simply need to be restarted.
Contact the system administrator for more information regarding this error message.
509 Bandwidth Limit Exceeded
This error occurs when the bandwidth limit imposed by the system administrator has been reached. The only fix for this issue is to wait until the limit is reset in the following cycle.
Consult the system administrator for information about acquiring more bandwidth.
510 Not Extended
This error occurs when an extension attached to the HTTP request is not supported by the web server.
To resolve the issue, you may need to update the server. Consult the system administrator for more information.
When Do 500 Errors Appear in the HTTP Request-Response Cycle?
Your browser, the client, communicates with a web server to display a web page in a process called the request-response cycle. If a problem occurs, the 500 error will appear during the last step of the cycle:
- The browser sends out the IP name of the site to the domain name servers (DNS). The DNS provides the numeric IP address for the website.
- An IP socket connection opens to the IP address.
- The browser sends an HTTP data stream through that socket.
- In response, the browser receives an HTTP data stream from the desired web server. If the server is experiencing a problem, this data stream will contain the 500 error code that you view in your browser.
Browser or Client Workarounds for 5xx Responses
Although a 5xx response is generally caused by server-side error, a browser user may be able to work around the problem. Often the problem is temporary. Wait a few moments and try the page again. The following are some other options for solving the viewing problem on the client-side.
1. Reload the page, clear the cache, and delete its cookies
Reload the page. On Windows, press F5 , on Mac, hold down Cmd and Shift and then click R, or enter the URL again.
Note: If you received the 500 error code on a page where you are submitting a payment, do not reload. If you do reload, you could send in multiple orders.
2. Clear the browser caches
In Chrome, press F12, and then click and hold the Reload button and press Shift key. On the menu, click Empty Cache and Hard Reload.
In Firefox, press Shift, and then click Reload.
3. Delete browser cookies
In Chrome, on the browser toolbar , click More Tools, and then click Clear Browsing Data.
Identifying and Fixing 5xx Responses on a Website
If the 5xx response appear on your own website, it may be difficult to pinpoint the source of the problem. Incompatible upgrades, missing or corrupt files, incorrect permissions, and script errors may be culprits.
If you encounter a 5xx response on your own webpage or site, first try these two things to remedy the issue:
- When the error appears, wait for a moment, and then try reloading the page to ensure that the problem was not just a momentary issue.
- Check the error log for the website that’s returning the error. (Several websites may be hosted on one server.) Even if you have a hosted website, you can still request a copy of the server log to view the problem.
- As a general guideline, the easiest way to troubleshoot a 5xx response may be to think of the last change to your system and then roll it back.
Common Causes of 5xx response
If those three steps didn't solve the problem on your site, it's time to consider some of the common causes and take steps to repair the issue. Here are some reasons that 500 errors can occur:
- New plugins or themes: Rollback the newest installations until the problem disappears.
- New software upgrade failed: If you’ve just upgraded software before the error appeared, the upgrade may not have been successful, files may be missing or corrupted. Uninstall the upgrade and try again.
- Software upgrade incompatibilities: Themes and plugins may be incompatible with the new software. You can pinpoint the incompatibility, by deactivating apps one by one until the problem disappears.
- Incorrect permissions: Permissions may be incorrect on the host.
Internal ASP error.
Debugging Your Server Scripts to Solve 500 Errors
Server-side scripts may produce 500 errors. In addition to viewing common HTTP status code errors, you can often turn on additional functionality in server scripting languages to display more detailed messages for debugging purposes. In PHP, for example, use display_errors to log errors or display errors onscreen. In IIS 4.0, clear the Show Friendly HTML Error Messages checkbox to show the developers message. For more information on troubleshooting on IIS, see How web site administrators can troubleshoot an “HTTP 500 Internal Error” error message on IIS 4.0 or IIS 5.0.
When 500 errors appear, check your server scripts for these problems:
- Server permission: If permissions are incorrect, a server cannot run a script. For example, permissions for both PHP or CGI script should be set to 0755 (-rwxr-xr-x).
- PHP timeout: If the server connects to external services, they may time out. If too many connections time out, a 500 error appears. Review timeout rules and error handling in your script. These can be difficult to find because connections to databases and RSS feeds will stop the script. The easiest solution may be to remove external connections.
- Server timeout: Lost server connections, reboots, and too many calls at once can cause a server to timeout. Test the script to ensure this is not happening frequently.
- Structure in .htaccess files: An error in an .htaccess file may prevent a page from loading. To test whether .htaccess is the problem, temporarily remove the file or rename it. Then, reload the page.
- CGI and Perl script errors: If a web page with the extension .cgi or .pl returns a #500 error, check the script. Ensure that you save CGI files in pure ASCII format and also that you upload them to the cgi-bin directory in ASCII mode. Also verify that any Perl modules required for your script are supported.
500 Errors on Common Software Platforms and Programs
If you are seeing errors for products such as WordPress, Joomla, or if you present content on a content management system, check the knowledge base and help pages for those platforms.
AT&T Video Optimizer Can Help
AT&T Video Optimizer, a free diagnostic tool for optimizing mobile app performance, identifies all HTTP 4xx and 5xx status codes that are found in an application trace. These codes are an important part of application analysis, because they provide information about possible errors resulting from an HTTP request.