Tagged: 502, bad gateway
-
AuthorPosts
-
January 22, 2019 at 11:49 am #1057157
Hi guys,
I encountered an annoying problem on my page, already dealing with it for a couple of days. If I upload an image I get a 502 Bad Gateway Error. Well, there are a couple of lists on the web pointing out possible solutions, but I already tried almost everything and its not yet working. The weird thing is that the error doesnt seem to occur all the time, some rare times an image uploads properly, but I can’t see a pattern of when it works and when it doesn’t (imagesize, dimensions, format, name…).
I already added define( ‘WP_MEMORY_LIMIT’, ‘256M’ ); and define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ ); to the wp-config.php and cleared the htaccess from some stuck and old caching code from a plugin but it seems it had no effect. All plugins except of WooCommerce are already disabled or completely uninstalled. Now the reason why I ask you guys to hopefully help me solve this problem. As I completely reinstalled WordPress and the Enfold theme, I checked again if I get the 502 Bad Gateway Error when uploading mediafiles and as long as Twenty Nineteen Theme was activated the upload somehow worked. So I guess it must be a Theme-specific Error, or something wrong in the Databases the Theme uses (I am not very convenient with coding and that kind of stuff). Not at the very beginning of the error but right now I also get some messages in the debug.log which indicate some memory limit issues (but the weird thing, it all works with twenty nineteen and wp_memory_limit is already set to 256M)[21-Jan-2019 13:55:43 UTC] PHP Notice: Undefined index: upload_folder in /wp-content/themes/enfold/framework/php/class-framework-widgets.php on line 3372
[21-Jan-2019 14:50:27 UTC] PHP Fatal error: Out of memory (allocated 12582912) (tried to allocate 462848 bytes) in /wp-content/themes/enfold/css/dynamic-css.php on line 985
[21-Jan-2019 14:50:47 UTC] PHP Fatal error: Out of memory (allocated 23068672) (tried to allocate 81920 bytes) in /wp-includes/class-wp-theme.php on line 1019I hope you can help me with this topic, as I have no more ideas how to handle this, and obviously dont want to use the twenty nineteen theme or switch themes every time I upload some media.
Thanks a lot in advance
Kind regards,
ChrisJanuary 22, 2019 at 5:45 pm #1057345Hey chrizz06,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( do be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create a admin user and post the login credentials in the “private data” field.Best regards,
NikkoJanuary 22, 2019 at 6:34 pm #1057376Hi Nikko, thanks a lot for the fast reply.
In the Private Content you find the URL for temporary login. Hope we can solve this. I also set up a temp FTP access for you. Just in case.
Best regards,
ChrisJanuary 24, 2019 at 10:32 pm #1058369Hi,
I have run some tests, your php memory limit is on 32M, seems that the code from wp-config is not working
Best regards,
BasilisJanuary 25, 2019 at 3:30 pm #1058764Thanks a lot Basilis.
Do you have any idea on why the memory limit isn’t working as I think the code is put correctly in the wp-config? Is it just this line which doesnt work or is it the whole wp-config? I also put in the code for post-revisions and apparently that line isnt working as well. Could it be possible that the php memory limit works on another theme, as like I mentioned above, I dont get a 502 Bad Gateway Error when Twenty Nineteen is activited? And most important, do you have any ideas on how to solve this?
Best regards,
ChrisJanuary 27, 2019 at 7:14 am #1059281Hi Chris,
What type of hosting are you on? If it’s shared then your hosting provider might be block anything which would increase the memory limit on individual installation, I would suggest that you contact your hosting provider to see if that is the case. Enfold is a memory intensive theme if you compare to TwentyNineteen, so that is likely why it’s working when you switch to that.
Best regards,
RikardFebruary 4, 2019 at 4:17 pm #1062731I had already contacted my hosting provider and the support didn’t tell me anything about blocked memory limit. They even increased it to 512 MB for me, which obviously didn’t help either. I think some plugin completely messed up my database or I don’t know. Anyway, my solution after trying to fix it in each and every possible way which didn’t work out for over one week:
1. Screenshots of the WP and Enfold Options
2. Export Pages and Media
3. Delete all Plugins, Databases, Theme and finally WordPress
4. Completely fresh install of WordPress
5. Import Pages and Media
Took me about 4 hours. Of course this isn’t the best solution, but if I would have done it like this at the beginning would have saved me one week. Just for others to consider this option, if they cant solve their suddenly occuring bad gateway the “normal way”.Best regards,
ChrisFebruary 5, 2019 at 9:17 am #1063074 -
AuthorPosts
- You must be logged in to reply to this topic.