Support » Plugin: Loco Translate » Add New Language Timeout Problem

  • Resolved Özgür KARALAR

    (@zgrkaralar)


    Hello,

    I’m trying to use locotranslate on my wordpress setup but when i try to trasnlate plugin then click add new language locotranslate waiting then waiting so long after that server gives timeout.

    Anyone know how to fix this ?

    Thank you

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tim W

    (@timwhitlock)

    That page loads in less than one millisecond on my server. It does very little processing.

    Your problem may be caused by something else going on in WordPress. I cannot guess what that is, so try disabling all other plugins and switching to a stock WordPress theme like twentyseventeen.

    If you think the issue is definitely with this plugin then please provide steps to reproduce the problem.

    Thread Starter Özgür KARALAR

    (@zgrkaralar)

    @timwhitlock
    Thank you for reply.

    I try to disable all plugins then try again on the smtp-mailer plugin but same problem about that.

    Also i change as you say template to twentyseventeen but still have this problem.

    18768#0: *432442 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 79.100.**.**, server: myserver, request: “GET /wp-admin/admin.php?bundle=smtp-mailer%2Fmain.php&domain=smtp-mailer&page=loco-plugin&action=msginit HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/dev.domain.com.sock”, host: “domain of my”, referrer: “https://dev.domainmy.com/wp-admin/admin.php?bundle=smtp-mailer%2Fmain.php&page=loco-plugin&action=view”

    Plugin Author Tim W

    (@timwhitlock)

    I downloaded smtp-mailer and I get no problems that URL.

    I am curious as to the duration of the timeout is. Is it reasonable? Are we talking about a second here, or much longer?

    Does this happen on all screens? What if you click “Edit Template” instead of adding a language?

    Does this happen for all bundles? What about adding a language to another theme or plugin?

    Could your WordPress core be doing something, like maybe cron?

    Based on what I know so far I can only make guesses.

    Thread Starter Özgür KARALAR

    (@zgrkaralar)

    Nevermind which plugins all plugins when i try to add new lang making this. Just happing on adding new lang buton this problem other functions are working well not any other problem.

    I’m using this steps,
    Loco Translate >> Plugins >> one of my plugins >> Overview >> click add new language

    If i make this Edit template it’s working without problem.

    My guess on loco translate when try to create folder or files making some problem for this i try to re-settings chmod and chown setting on my site but still have same problem.

    PS: I can upload image and otherthings are working on my wordpress without problem.

    Plugin Author Tim W

    (@timwhitlock)

    This page view won’t create any files or directories, but it will be testing for the existence of them. However, most pages do that.

    Eliminating remote connections is a good place to start though.

    1. Perhaps you’re connecting to the file system indirectly, e.g. using FTP. See this page if you’re not sure.

    You can eliminate any hanging FTP connections by adding define('FS_METHOD','direct'); to your wp-config. This will prevent Loco Translate from attempting any remote file system connections.

    2. Perhaps remote connections to the WordPress API are hanging.

    This line of code gets locale data from WordPress. Can you check if this is hanging?

    3. Debugging

    There’s a limit to what I can achieve by guessing. Are you able to step through this file to see when it starts to hang? Existing during the render function should show how far the script gets.

    Also be sure to enable debug mode and logging so you see any warnings.

    Plugin Author Tim W

    (@timwhitlock)

    Also, I see you’re using FastCGI and it is timing out before PHP does. That means you’ll never see a fatal PHP error. That error might give away the line at which the script died.

    Try setting your PHP max_execution_time to something quite low, like 2 seconds:

    ;; example for php-fpm
    php_value[max_execution_time] = 2

    Then ensure your FastCGI timeouts are longer like this:

    # example for nginx
    fastcgi_connect_timeout 10s;
    fastcgi_send_timeout 10s;
    fastcgi_read_timeout 10s;
    Thread Starter Özgür KARALAR

    (@zgrkaralar)

    @timwhitlock i try every method as you say but nothing change then I try php and fastcgi settings as you say but still i can’t understand why this problem 🙁

    Logs are here,

    php-fpm/error.log log is this

    [26-Jan-2018 02:52:09] NOTICE: child 16434 stopped for tracing
    [26-Jan-2018 02:52:09] NOTICE: about to trace 16434
    [26-Jan-2018 02:52:09] NOTICE: finished trace of 16434
    [26-Jan-2018 02:54:04] WARNING: [pool dev.domainname.com] child 16434, script '/home/devbelcho/public_html/wp-cron.php' (request: "POST /wp-cron.php?doing_wp_cron=1516927924.0041201114654541015625") execution timed out (120.818218 sec), terminating
    [26-Jan-2018 02:54:04] WARNING: [pool dev.domainname.com] child 16434 exited on signal 15 (SIGTERM) after 401.766272 seconds from start
    [26-Jan-2018 02:54:04] NOTICE: [pool dev.domainname.com] child 16609 started
    [26-Jan-2018 02:54:44] WARNING: [pool dev.domainname.com] child 16433, script '/home/devbelcho/public_html/wp-admin/admin.php' (request: "GET /wp-admin/admin.php?bundle=winner-post-types%2Fwinner-post-types.php&domain=winner-post-types&page=loco-plugin&action=msginit") executing too slow (5.583339 sec), logging
    [26-Jan-2018 02:54:44] NOTICE: child 16433 stopped for tracing
    [26-Jan-2018 02:54:44] NOTICE: about to trace 16433
    [26-Jan-2018 02:54:44] NOTICE: finished trace of 16433
    [26-Jan-2018 02:55:41] WARNINGbelchohristovv.domainname.com] child 16433 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Maximum execution time of 2 seconds exceeded in /home/devbelcho/public_html/wp-includes/Requests/Transport/cURL.php on line 162"

    nginx log is
    2018/01/26 02:55:39 [error] 16363#0: *253 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 95.42.50.71, server: dev.domain.com, request: “GET /wp-admin/admin.php?bundle=winner-post-types%2Fwinner-post-types.php&domain=winner-post-types&page=loco-plugin&action=msginit HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/dev.domain.com.sock”, host: “dev.belchohristov.com”, referrer: “https://dev.domain.com/wp-admin/admin.php?bundle=winner-post-types%2Fwinner-post-types.php&page=loco-plugin&action=view”

    Plugin Author Tim W

    (@timwhitlock)

    The last line for process 16433 shows your PHP error.

    PHP Fatal error: Maximum execution time of 2 seconds exceeded in […]/wp-includes/Requests/Transport/cURL.php on line 162″

    So this is a slow (or hanging) HTTP connection as I suggested earlier (point no.2).

    I can only assume this is the remote connection to the WordPress API (from Loco Translate) but you’ll have to debug it to be certain.

    WordPress will warn you if HTTP connections fail and just carry on, but not if your script dies first.

    Thread Starter Özgür KARALAR

    (@zgrkaralar)

    I try to set more but i thing thats is not solution for this error do you have any other thing to fix this problem @timwhitlock

    Plugin Author Tim W

    (@timwhitlock)

    I can’t tell you how to fix your problem, but it sounds rather like a network issue.

    Plugin Author Tim W

    (@timwhitlock)

    I’m marking this as resolved as the issue is external to my plugin. I hope you’ve managed to fix it.

    For the next release of the plugin I will look at adding a flag that disables network functions.

    Plugin Author Tim W

    (@timwhitlock)

    I’ve added a filter to the development version that lets you disable any remote connections. Use it like this:

    add_filter('loco_allow_remote','__return_false');

    With network access disabled the “add language” screen will use an offline copy of available languages instead of pulling it from WordPress. It will also block any FTP/SSH file connections you might be making.

    I hope this is useful in getting to your root cause.

    Thread Starter Özgür KARALAR

    (@zgrkaralar)

    Hello,

    @timwhitlock dev version fix my problem usting without add_filter(‘loco_allow_remote’,’__return_false’); this but working well thank you you can mark this Resolved

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Add New Language Timeout Problem’ is closed to new replies.