Postmortem…

PilarPinto
3 min readMay 24, 2020
Rosho

Issue Summary

The proposed task is to use a container using ssh. A Wordpress-based website works in this container. To use it, you must make a file transfer calls to the local IP address, but oh surprise !! when activating this transfer of files by means of the command curl, something unwanted is shown at the output, an error 500.

The famous error 500 that terrifies even the most advanced developer, and more when it implies a failure in the core of a business. This famous error represents that there is something wrong with the server. This document describes step by step how the process to solve this error was carried out.

Timeline…

The complete timeline in the GMT-5 Bogotá time zone.

  • 19th May, 2020, 12:00 AM: Project release
  • 19th May, 2020, 5:00 PM: Read about interpreting strace, and saw the video.
  • 19th May, 2020, 5:23 PM: Test with curl and saw the 500 error
  • 19th May, 2020, 5:24 PM: Follow the video example, using ps auxf in order to show the pid of the active process
  • 19th May, 2020, 5:30 PM: Using strace to found the error, with an Apache pid. This shows a lot of things, but 3 are with -1 in the www/html folder, with a name in an inexistent PHP file.
  • 19th May, 2020, 6:30 PM: Looking for that file name, and change its extension to phpp with mv command
  • 19th May, 2020, 7:20 PM: Automate the process with a puppet file and upload it to git.

The part of the error was part of the proposed problem, also the first curl indicates an error 500. These errors appear when you make a mistake naming a variable when HTML tags do not close properly, among other errors. The problem is that you are not sure which error the 500 refers to.

The strace shows a somewhat confusing output, but the key is to find the outputs with -1 like this.

The error was that a .phpp document was needed. By simply changing the name of that file by adding a phpp at the end, it corrected the status from 500 to 200. The cause was clearly an error writing the file extension. Although the error is solved by changing the extension to phpp, it is very likely that this file will not take any action on the website because this extension is not the one that php uses to work, but it no longer hinders the operation of the server.

The solution was to change the name of the file using the following code.

Testing in a new container with the same error, the effectiveness of the solution is checked. Since the response to the GET request is 200.

Corrective and preventative measures:

You should check every so often that the output is as expected. In addition, verify that the files are written correctly and verify with the frontend. You can probably see an obvious error in this way. But even with all these measures there is still the possibility of error because Errare humanum est.

--

--