502 Server Error

Keywords: WordPress - Google Cloud Platform - Technical issue - Other
Description:
Anytime I send through a few files on my Bitnami Wordpress or get a lot of traffic, I get a 502 Server Error. My Google load balancer logs are telling me that they “failed_to_pick_backend” — can anyone help me resolve this?

Hello @shaili.c,

We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Hi @fdepaz — I was finally able to run it, here’s my ticket number: 6859f7ce-8b8c-84b8-5198-b07f40e10fc5

Thank you!

Hi @shaili.c,

Our tool wasn’t able to run several of its commands, probably because of a lack of disk space. To make sure about it, please run the following command and share its output:

sudo df -h

That will show the instance’s available space and the main one, /dev/xvda1 will probably be full. If so, please increase your instance disk space as explained in our Increase Or Decrease The Server Disk Size guide.

Regards,
Francisco de Paz

Hi @fdepaz I just ran that command and it came back with:

Filesystem Size Used Avail Use% Mounted on
udev 839M 0 839M 0% /dev
tmpfs 170M 18M 153M 11% /run
/dev/sda1 9.7G 4.7G 4.6G 51% /
tmpfs 847M 0 847M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 847M 0 847M 0% /sys/fs/cgroup
/dev/sda15 124M 7.9M 116M 7% /boot/efi
tmpfs 170M 0 170M 0% /run/user/1002

I don’t see an xvda— is my main disk sda1? Even then, it only looks to be 51% full.

Sorry, this might be easier to understand:

Hello @shaili.c,

That’s strange, it seems our support tool threw some false positives besides not running some of the diagnostics. Could you rerun our tool and share the new code? Also, please share the output of this command:

sudo free -m

Regards,
Francisco de Paz

Hi @fdepaz I kept running into the 503 error every time I ran the support tool, any idea why that might happen?

I did run the other command mentioned, here’s what I got:

Hi @shaili.c,

You have very little available memory and that may be causing some problems in your instance in high-load memory periods like the ones you described in your first post. The support tool could also be failing because of this and that is why it is not running properly.

Could you please increase your instance size as explained in the following guide and check whether the issue resolves itself:

If the problem persists, could you give me more details or a trace for the 50X errors you encounter as well as sharing the output of:

sudo tail -30 /opt/bitnami/mysql/logs/mysqld.log
sudo tail -30 /opt/bitnami/apache2/logs/error_log

Regards,
Francisco de Paz

Hi Francisco, it looks good so far. I was able to run the support tool with no issues— I got this code:

6ac5fef1-1bbd-d15f-21d4-04fc9bdca393

Can you let me know if everything looks good in the output?

I think that should be all then :slight_smile: If it happens again, I can create a new topic and give you the additional details you outlined in your previous message.

Hi @shaili.c,

I’m glad the issue got solved! I have taken a look at the support report and, besides the old errors/warnings related to the lack of memory, I have only found some errors related to Apache’s pagespeed module.

[Tue Apr 27 13:58:50.703674 2021] [pagespeed:error] [pid 1667:tid 140229340034816] [mod_pagespeed 1.13.35.2-0 @1667] Slow ReadFile operation on file /opt/bitnami/apache2/var/cache/mod_pagespeed/v3/douc.fun/http,3A/,2Fdouc.fun/wp-content/uploads/2021/03/IMG_0590.png,: 124.922ms; configure SlowFileLatencyUs to change threshold

It is known that this module may cause performance issues in some configurations and in those cases we suggest disabling pagespeed. If you want to do so, please check the following guide to disable Pagespeed:

https://docs.bitnami.com/general/apps/wordpress/administration/use-pagespeed/#disable-pagespeed

Do not doubt to open a new thread if you encounter other issues in the future!

Best regards,
Francisco de Paz

Hi @fdepaz,

Done! Thank you for all of your help. Everything was so easy to maneuver because of it :slight_smile:

Best,
Shaili

1 Like