• Hi!

    I have an issue with Polylang 1.4.

    I added German as language which worked fine. Afterwards I added US English as language and got a Bad Gateway. The Bad Gateway appears on /wp-admin/ as well as on the site itself.

    It’s a WordPress 3.8.1 with the following plugins activated:

    Google Analyticator v 6.4.7.3
    IM8 Exclude Pages v 2.6.1
    Polylang v 1.4
    WordPress SEO v 1.4.24

    All plugins are still in default configuration.

    There is not content in WP (besides the “Hello World”), as it is a fresh install.

    Theme is one that came with WP (“Twenty Thirteen”).

    Permalink setting for WP is “Day and name”.

    “Front page displays Your latest posts”.

    Any ideas?

    Thanks

    https://wordpress.org/plugins/polylang/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Chouby

    (@chouby)

    Could you check if you get the same error with no other plugins activated?

    Thread Starter Alex F

    (@alex-f-1)

    Ok, sure.

    All plugins deactivated works just fine.

    Activating only Polylang gets me a Bad Gateway.

    Activating all other three, but not Polylang:

    Google Analyticator v 6.4.7.3
    IM8 Exclude Pages v 2.6.1
    WordPress SEO v 1.4.24

    works just fine.

    Restoring a backup of the situation before I installed any of the plugins – ok

    Re-installing all four plugins (works fine except Google Analyticator requiring a rmdir of its directory structure – did it), not activating any of them – ok

    Activating Polylang – ok

    Using Setting – languages – ok

    Adding German – ok

    Adding English – Bad Gateway

    Restoring a backup of the situation before I installed any of the plugins – ok

    Installing only Polylang – ok

    Activating Polylang – ok

    Using Setting – languages – ok

    Adding German – ok

    Adding English – US – Bad Gateway

    Plugin Author Chouby

    (@chouby)

    That’s annoying. I tried this (in case I missed something).
    Install WP 3.8.1
    Install and activate Polylang 1.4 from admin plugins page
    Add German
    Add English
    Everything’s ok (I did that in debug mode to check that no errors are emitted).

    bad gateway is hard to debug as it does not give any clue where the error is.

    just two ideas:
    1. in wp-config.php, replace the line:

    define('WP_DEBUG', false);

    by

    define('WP_DEBUG', true);
    define('SCRIPT_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    ini_set('display_errors','Off');

    If there are any errors, they will be logged in a file wp-content/debug.log
    Maybe you will discover some error.

    2. Try a new install from scratch as I did (in case there is some conflict source in your current DB).

    Thread Starter Alex F

    (@alex-f-1)

    Thanks for the quick response.

    I did the following:

    Added in wp-config.php

    define('WP_DEBUG', true);
    define('SCRIPT_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    ini_set('display_errors','Off');

    (my version did not have define('WP_DEBUG', false); )

    Installed and activated Polylang, added German, English – Bad Gateway

    There was no debug.log or wp-content/debug.log

    Some background, maybe any of this helps you spot the root cause of this:

    I am using WP Engine for hosting.

    They provided my with WP 3.8 (so not: 3.8.1 as in the case above), and I used the previous versions of the mentioned plug-ins.

    Everything worked fine (although there the Day-Of-Week in the date of posts was only displayed in English, never in German).

    I added a post with two diagrams, and added translations for each of the diagrams.

    After that I cannot exactly recall the sequence, but what happened was:

    I upgraded WP and all plugins to the most current version (WP 3.8.1., Polylang 1.4 etc).

    I noticed that for one of the original diagrams (i.e. default language), the image itself was missing, although all the metadata seemed ok.

    So I uploaded the diagram again, and tried to trash the broken medium.

    If I remember correctly, this is when I got the first Bad Gateway. However I am not sure if the first Bad Gateway happened immediately after upgrading the plugins, or after trying the fix the broken image.

    I restored a backup and tried to work around this, without success. Now every change to the posts that had the diagram embedded caused a Bad Gateway, and there was no clean way of fixing it.

    I worked through a couple of the available backups, all ultimately led to the same issue.

    So I asked WP Engine to provide me with a fresh install, so I could start from scratch.

    They did it, and what I got looked like a fresh install to me. All my content gone, instead I got the “Hello” content from WP etc.

    However, this time I got WP 3.8.1., only Polylang 1.4 was available for install etc. The experience with it was what I called “Bad Gateway with Polylang 1.4 on fresh install” above.

    Happy to try a “a new install from scratch”, but not sure how to get anything different from the last time I asked for it.

    Any suggestions?

    Thread Starter Alex F

    (@alex-f-1)

    I tried in staging environment:

    WP 3.8.1.
    Theme: twentyfourteen
    Only active plugin: Polylang 1.4 (other plugins still installed but deactivated)

    Adding German, English – Bad Gateway

    WP 3.8.1.
    Theme: twentyfourteen
    Only active plugin: Polylang 1.4 (other plugins still installed but deactivated)

    Adding English-US, German (different sequence) – Bad Gateway

    Plugin Author Chouby

    (@chouby)

    Some people had some issues with a feature recently added in Polylang. Although I don’t see how it could impact the backend, could you try to add the line:

    define('PLL_CACHE_HOME_URL', false);

    in your wp-config.php above the comment:
    /* That’s all, stop editing! Happy blogging. */

    Thread Starter Alex F

    (@alex-f-1)

    Thanks for the suggestion. I tried it. Unfortunately I got the same result.

    Plugin Author Chouby

    (@chouby)

    Does it work with v1.3.1?
    Could you get more information from your host? Maybe they log some error and know more than just “error 502”.

    Thread Starter Alex F

    (@alex-f-1)

    Yes, the previous combination worked to a certain point.

    I am using WP Engine for hosting. They provided my with WP 3.8 (so not: 3.8.1 as in the case above), and I used the previous versions of the mentioned plug-ins (for Polylang, I used the version right before 1.4).

    Everything worked fine (although the Day-Of-Week in the date of posts was only displayed in English, never in German).

    I added a post with two diagrams, and added translations for each of the diagrams.

    After that I cannot exactly recall the sequence, but what happened was:

    I upgraded WP, and some time later all plugins to the most current version (WP 3.8.1., Polylang 1.4 etc).

    I noticed that for one of the original diagrams (i.e. default language), the image itself was missing, although all the metadata seemed ok.

    So I uploaded the diagram again, and tried to trash the broken medium.

    If I remember correctly, this is when I got the first Bad Gateway.

    However I am not sure if the first Bad Gateway happened immediately after upgrading the plugins (Polylang to 1.4), or after trying the fix the broken image.

    I restored a backup and tried to work around this, without success. Now every change to the posts that had the diagram embedded caused a Bad Gateway, and there was no clean way of fixing it.

    I worked through a couple of the available backups, all ultimately led to the same issue.

    Plugin Author Chouby

    (@chouby)

    Another user had the same issue with the same host. The current development version (1.4.0.5) solved the issue for him. Can you try it too?
    http://downloads.wordpress.org/plugin/polylang.zip

    Thread Starter Alex F

    (@alex-f-1)

    Sorry for the long silence. Thank you for looking into this.

    I just tried 1.4.2

    Unfortunately same result. Adding German as first language works fine, adding English_US as second language leads me to a Bad Gateway.

    Plugin Author Chouby

    (@chouby)

    Yes. I thought the issue was solved by a bug fix I included v1.4.1 but it is not in fact. Did you report the issue to wp engine?

    I am following the issue with them for another user and they do not reproduce the issue anymore (without knowing what changed). I don’t know if you can access: https://help.wpengine.com/requests/186027

    Jus a question. Do you know the PHP version used?

    I have the same issue with WPengine.
    Added English as second language as well.

    @chouby:

    Based on a quick look at your code, I think the problem is related to your Polylang::activate() method. That method checks for the minimum WordPress version, and then it calls the Polylang::do_for_all_blogs() method. The do_for_all_blogs() method re-calls the Polylang::activate() method.

    This appears to be an infinite loop, which would account for the 502 timeout error.

    I would recommend that your class methods do some checking to ensure there isn’t an infinite loop being created.

    Looks like you can disregard my last comment. I see that Polylang::do_for_all_blogs() is calling the _activate() method, not the activate() method.

    Sorry about that πŸ™‚

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: Polylang] Bad Gateway with Polylang 1.4 on fresh install’ is closed to new replies.