DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How To Repair Failed Installations of Exchange Cumulative and Security Updates
  • Development of Custom Web Applications Within SAP Business Technology Platform
  • Coding Once, Thriving Everywhere: A Deep Dive Into .NET MAUI’s Cross-Platform Magic
  • The Ultimate Guide To Building Front-End Web Applications From Scratch

Trending

  • How To Start a Successful Career in DevOps
  • Microservices With Apache Camel and Quarkus
  • Breaking Down Silos: The Importance of Collaboration in Solution Architecture
  • How To Simplify Multi-Cluster Istio Service Mesh Using Admiral

How to Decode a Cryptic Server Error Message

Got a nagging HTTP server error message that won't quit? Here are few tips for handling some of the frequent offenders: 500, 503, and 520 server error messages.

Darren Perucci user avatar by
Darren Perucci
·
Apr. 26, 16 · Tutorial
Like (3)
Save
Tweet
Share
4.87K Views

Join the DZone community and get the full member experience.

Join For Free

feature photo the first step in troubleshooting an http server error is the 5xx server error message the failure generated. for many of the most common server errors, the code doesn't help much in hunting down the source of the problem. fortunately, a handful of causes accounts for the bulk of 500 (generic), 503 (unavailable), and 520 (unknown) server-error messages.

when a server generates an error code in response to a request, there are a finite number of possible causes. the problem is that too often the http error code doesn't provide much of a clue about the error's origin. a restart or some other short-term fix may get you running again, but some errors defy a quick solution. these are the most likely sources of server-error glitches whose causes aren't readily apparent: 500 (generic), 503 (unavailable), and 520 (unknown error).

w3schools.com provides a complete list of http status messages along with a brief description of each; 5xx server error messages and descriptions are shown below.

of the many http server error codes, the three that are most difficult to troubleshoot are 500 (generic), 503 (unavailable), and 520 (unknown error). source: w3schools.com

getting to the bottom of a '500 internal server error' message

about.com 's tim fisher identifies the three most common causes of the generic 500 internal server error alert:

  1. permission errors caused by a file or folder lacking appropriate access rights. the incorrect permission is most often associated with a php or cgi script. the standard setting for such scripts is 0775 (-rwxr-xr-x).
  2. php timeouts when attempting to connect to external resources. these can usually be addressed by adjusting the timeout rules or improving the script's error handling.
  3. a .htaccess coding error.

servers running microsoft internet information service generate more specific error codes. the microsoft support site provides a complete list of these supplemental codes, which are listed below.

http status code in iis 7.0, iis 7.5, and iis 8.0 for the generic 500 internal server error. source: microsoft

hunting down the source of 503 server unavailable messages

some server errors are a side-effect of http showing its age. an example is described in a stack overflow post from june 2013. a 503 service unavailable error was traced to a user agent header that lacked "mozilla." a commenter noted that many mobile phones have user agents that don't start with mozilla.

an http 503 service unavailable message was traced to a missing "mozilla" user agent. source: stack overflow

the reason for using the mozilla user agent goes back to the 1990s and the first popular browsers: mosaic and netscape. netscape differed from mosaic in that it supported frames. sites ultimately had a "frames" version and a "no frames" version, which were distinguished by the server via the user agent. ultimately, some servers were configured to drop any browser that didn't have the mozilla user agent, assuming that any such browser wouldn't render the page correctly.

solving the mystery of a 520 unknown error message

when a server encounters something unexpected or unacceptable, such as a protocol violation or empty response, it may kick out a 520 unknown error message. in a june 6, 2015, article , cloudflare's michelle zatlin identifies the five common causes of a 520 message:

  1. connection resets occur after a successful tcp handshake.
  2. the header size limit is exceeded.
  3. the origin server returned an empty response.
  4. the http response is invalid.
  5. the http response is missing some headers.

run a curl command to determine whether the origin server is returning an empty reply, an invalid http response, or over-large response headers, among other possible problems. for example, when the origin response is an empty reply, the curl command returns an error message such as the one shown below.

the curl command returns "empty reply from server" in the 520 error message when the origin server returns an empty reply. source: cloudflare

the most efficient way to monitor the availability and performance of apps, databases, and systems is the happy apps service, which lets you create checks for the web, mysql, mongodb, redis, riak, and elasticsearch. happy apps is a robust app-management solution that supports ssh and agent-based connectivity to all your apps on public, private, and hybrid clouds. the service provides dependency maps for determining the impact your it systems will have on other apps.

all checks performed on your apps are collected in easy-to-read reports that can be analyzed to identify repeating patterns and performance glitches over time. if you're looking for ways to save time, trouble, and money when managing your apps, visit happy apps today.

Error message mobile app

Published at DZone with permission of Darren Perucci, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How To Repair Failed Installations of Exchange Cumulative and Security Updates
  • Development of Custom Web Applications Within SAP Business Technology Platform
  • Coding Once, Thriving Everywhere: A Deep Dive Into .NET MAUI’s Cross-Platform Magic
  • The Ultimate Guide To Building Front-End Web Applications From Scratch

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: