[AWS Lightsail] Uncovering why WordPress stopped working while uploading heavy images.

I had uploaded some heavy images to WordPress media.
I waited, but the image upload progress bar showed no sign of moving.
What’s that? And without thinking about it, I did a browser reload, but this time the reload did not finish.
After waiting, the request finally failed and the screen was not displayed at all.

The WordPress environment was AWS Lightsail.

目次

investigation into the cause

ping

I hit ping, and… the server instance is dead!

Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

Go to the Lightsail management screen and confirm that it is up and running properly.

The reason was that ICMP was not allowed in the Lightsail firewall.
When allowed, communication was confirmed. The server instance is safe.

64 bytes from 192.168.0.x: icmp_seq=0 ttl=53 time=34.748 ms
64 bytes from 192.168.0.x: icmp_seq=1 ttl=53 time=21.535 ms

Check the Bitnami error log

Check Bitnami logs.

$ cd /opt/bitnami/apache2/logs
$ tail -f error_log

A timeout error was occurring there. Is this the cause.

The timeout specified has expired
AH01075 : Error dispatching request to : (polling), referer

The execution time for uploading heavy images was too long and exceeded the timeout limit.
So it may have retried several times, eating the process and preventing access to the server.

Restart Apache

Hit the Bitnami shell script.

sudo /opt/bitnami/ctlscript.sh restart

After the restart was completed, WordPress was successfully accessed and displayed.

Summary

When the server is (or seems to be) dead, you can find a solution by going through the order.
In a case like this, it is only a workaround, but it should recur when heavy image uploads are performed.

For a root solution, it may be a good idea to increase the max_execution_time in php.ini while also considering the server load.

よかったらシェアしてね!
目次