502 error when logging into admin dashboard

Posted in: Newspaper
Post count: 19

Hello.

When I try to access the admin page (dashboard) and log in as an administrator, I get a 502 error.

Is there any way to fix this?

Site address: https://itons.net/

Post count: 35449

Hi,
It will be need to enable the debug mode and check the logs to see what is the problem and from were is coming – https://www.cloudways.com/blog/wordpress-502-bad-gateway-error/
Thank you!

Post count: 19

This is the debugging log.

[28-May-2022 17:12:56 UTC] PHP Deprecated: Function create_function() is deprecated in /volume1/web/wordpress/wp-content/themes/Newspaper-child/functions.php on line 80
[28-May-2022 17:12:56 UTC] PHP Notice: Constant WP_POST_REVISIONS already defined in /volume1/web/wordpress/wp-config.php on line 87
[28-May-2022 17:12:56 UTC] PHP Fatal error: Uncaught Error: Call to undefined function gzencode() in /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php:2275
Stack trace:
#0 /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php(1962): wp_cache_get_ob(‘\nDeprecated: Fu…’)
#1 [internal function]: wp_cache_ob_callback(‘\nDeprecated: Fu…’, 9)
#2 /volume1/web/wordpress/wp-includes/functions.php(5275): ob_end_flush()
#3 /volume1/web/wordpress/wp-includes/class-wp-hook.php(307): wp_ob_end_flush_all(”)
#4 /volume1/web/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array)
#5 /volume1/web/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /volume1/web/wordpress/wp-includes/load.php(1102): do_action(‘shutdown’)
#7 [internal function]: shutdown_action_hook()
#8 {main}
thrown in /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 2275
[28-May-2022 17:12:58 UTC] PHP Deprecated: Function create_function() is deprecated in /volume1/web/wordpress/wp-content/themes/Newspaper-child/functions.php on line 80
[28-May-2022 17:12:58 UTC] PHP Notice: Constant WP_POST_REVISIONS already defined in /volume1/web/wordpress/wp-config.php on line 87
[28-May-2022 17:12:59 UTC] PHP Fatal error: Uncaught Error: Call to undefined function gzencode() in /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php:2275
Stack trace:
#0 /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php(1962): wp_cache_get_ob(‘\nDeprecated: Fu…’)
#1 [internal function]: wp_cache_ob_callback(‘\nDeprecated: Fu…’, 9)
#2 /volume1/web/wordpress/wp-includes/functions.php(5275): ob_end_flush()
#3 /volume1/web/wordpress/wp-includes/class-wp-hook.php(307): wp_ob_end_flush_all(”)
#4 /volume1/web/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array)
#5 /volume1/web/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /volume1/web/wordpress/wp-includes/load.php(1102): do_action(‘shutdown’)
#7 [internal function]: shutdown_action_hook()
#8 {main}
thrown in /volume1/web/wordpress/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 2275

Reference
To avoid confusion, please note that separate error pages such as 404 and 502 are coded to redirect to the main homepage.

  • This reply was modified 1 year by leejaehak.
Post count: 35449

Hi,
It seems that the error is coming from the child theme. Please activate the main theme and check if the error still persists. If it doesn’t, then please check the code you have in the child theme.
Thank you!

Post count: 19

– Here is the child theme code.
– The code that needs to be hidden is marked with the x alphabet.
– I share the child theme code file as a txt file as follows.

https://1drv.ms/t/c/4b73c3634bb72fff/EcBi_ZDEXjxOr2sONLNJlKUBgia83eh2yaWwy2R04m6DiQ?e=Nizvp6

– I’d like to request a code review in case it helps.

  • This reply was modified 1 year by leejaehak.
Post count: 35449

Hi,

Normally we can not help for the custom code that user add on the child theme, for this you usually need a developer.
I checked a bet the file provided, but the problem is that on it the last line is 61 and in the error log it complain about a code from line 80 that is deprecated.

Thank you!

Post count: 19

I’m still getting the 502 error, but I’m sure it’ll get fixed eventually.

Post count: 35449

Hi,
Please set the main theme and clear all cache, after that check the website, the problem should be resolved.
Also, I set the code you have provided in chatgpt and this made some corrects and the code according to chatgpt should be like this – https://pastebin.com/qwuXms3M

Thank you!

Post count: 19

Thanks for reviewing my WordPress Newspaper child theme code.

And also, the WordPress admin page shows a 502 error and only FTP access is possible.

I previously tried to edit the theme using FTP, but it broke my site and I had to restore both the WordPress files and the DB files.

When clearing the cache, you also need to upgrade the cache plugin version for normal operation, and the cache will continue to accumulate.

The thing is…
I suddenly got a 502 server error when I logged into my WordPress admin page.

Post count: 35449

Hi,

If you have FTP access you should make a full backup for the current install and try to set a clean wordpress and theme without any edits on them and see if it’s working.

Thank you!

Post count: 19

It doesn’t seem to be a theme issue.

I recreated the Newspaper parent theme and child theme folders as ‘old’ themes.

And I still get the 502 error.

And the plugins I use are as follows:

classic-editor
td-cloud-library
td-composer
td-social-counter
wordpress-seo(yoast seo)
wp-super-cache

  • This reply was modified 1 year by leejaehak.
Post count: 35449

Hi,
A 502 Bad Gateway error is an HTTP status code indicating a problem between two web servers. The server acting as a proxy or gateway received an invalid response from another server. This means the website you’re trying to access is having trouble relaying information from another server and encountered an error.
My recommendation is to contact your host and ask them for help.
Thank you!

Post count: 19

Thank you.

I am running a Synology personal server.

I seem to be getting a 502 error on every menu that requires admin login.

It seems like Synology tech support has already been terminated due to my inquiry.

This will probably be the last time I will be receiving newspaper tech support due to a 502 error.

If you have any useful information or tips, please let me know.

I hope I’m not being unreasonable.

Thank you.

  • This reply was modified 1 year by leejaehak.
Post count: 35449

Hi,
You’re not being unreasonable at all, 502 errors can be frustrating, especially when paired with limited support and a self-hosted (Synology) environment, the only thing is that this is not covered by the support team and we do not have enough resources to help. But here is a point of view \bBased on the log and your setup, here’s a detailed plan to help you troubleshoot and fix the issue:
PHP Fatal error: Uncaught Error: Call to undefined function gzencode() ...
This means your server is trying to use the gzencode() function (used for GZIP compression), but the function isn’t available/usually because the zlib PHP extension is not enabled.

Other Notable Warnings:
– you’re using create_function() in functions.php
– WP_POST_REVISIONS is declared more than once. Make sure it’s only defined once in wp-config.php.

Post count: 19

I have modified WP_POST_REVISIONS correctly by referring to other references.

I also took another look at the gzip entry on the server.

The fuction item you mentioned seems to be the parent theme.

I am still getting 502 errors even though it is a personal server and I personally find it difficult to troubleshoot. I hope it gets fixed someday.

Thanks for the useful information and advice.

And while it’s not like there’s nothing to gain so far, the current source code seems to be an improvement over the old one.

  • This reply was modified 1 year by leejaehak.
  • This reply was modified 1 year by leejaehak.
Post count: 19

I looked at the header through Chrome developer tools.

Referrer Policy : strict-origin-when-cross-origin

I’m replying to your question rather than posting a new one, as I think it might be helpful.

thank you

Post count: 35449

Hi,

Maye this will help you: https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9

Also, you can try some WordPress Plugin (Easy for Non-Coders). Use a plugin like:
– HTTP Headers
– Security Headers
– WPCode (Insert Headers & Footers)

Thank you!

Viewing 17 posts - 1 through 17 (of 17 total)
The forum ‘Newspaper’ is closed to new topics and replies.