1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Fatal Error: Maximum execution time of 30 seconds exceeded

Discussion in 'Troubleshooting and Problems' started by dieg0, Sep 5, 2013.

  1. dieg0

    dieg0 Active Member

    This is what happens when someone tries to access one particular thread. I just checked on google and it has a cached version of it from a couple of weeks ago (vB days) so it's an issue related to our move to xF.

    Code:
    2013/09/05 12:29:21 [error] 27690#0: *2948486 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /usr/share/nginx/webs/mysite.com/library/XenForo/Helper/String.php on line 411" while reading response header from upstream, client: 83.59.180.81, server: www.mysite.com, request: "GET /threads/tema-de-ayuda-dudas-juegos-guias-e-informacion.60986/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "www.mysite.com"
    Code:
    2013/09/05 12:49:11 [error] 27690#0: *2963464 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 83.59.180.81, server: www.mysite.com, request: "GET /threads/tema-de-ayuda-dudas-juegos-guias-e-informacion.60986/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock:", host: "www.mysite.com"
    Heres the slow log

    Code:
    [05-Sep-2013 15:37:13]  [pool www] pid 7058
    script_filename = /usr/share/nginx/webs/mysite.com/index.php
    [0x000002b16a2bc4b8] preg_replace() /usr/share/nginx/webs/mysite.com/library/XenForo/Helper/String.php:411
    [0x000002b16a2bc0a0] bbCodeStrip() /usr/share/nginx/webs/mysite.com/library/XenForo/Template/Helper/Core.php:1165
    [0x000003ff4114c2d0] helperSnippet() unknown:0
    [0x000002b16a2bbe50] call_user_func_array() /usr/share/nginx/webs/mysite.com/library/XenForo/Template/Helper/Core.php:835
    [0x000002b16a2a88b0] callHelper() /usr/share/nginx/webs/mysite.com/library/XenForo/Template/Abstract.php(265) : eval()'d code:45
    [0x000002b16a2a8660] +++ dump failed
    
    Any idea how can we fix this?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    First, you should disable all add-ons and try again.

    I see reference there to preg_replace so it might also be useful to specifically disable all Template Modifications if you've added any custom ones yourself. (If they're added automatically by add-ons then disabling the add-ons should disable them so that's ok).
     
  3. dieg0

    dieg0 Active Member

    Every add-on turned off and using the default skin. Still nothing.

    Code:
    [05-Sep-2013 17:23:14]  [pool www] pid 7053
    script_filename = /usr/share/nginx/webs/xft/index.php
    [0x000002b16a2bc340] preg_replace() /usr/share/nginx/webs/xft/library/XenForo/Helper/String.php:411
    [0x000002b16a2bbf28] bbCodeStrip() /usr/share/nginx/webs/xft/library/XenForo/Template/Helper/Core.php:1165
    [0x000003ff4114c2d0] helperSnippet() unknown:0
    [0x000002b16a2bbcd8] call_user_func_array() /usr/share/nginx/webs/xft/library/XenForo/Template/Helper/Core.php:835
    [0x000002b16a2a88a0] callHelper() /usr/share/nginx/webs/xft/library/XenForo/Template/Abstract.php(265) : eval()'d code:45
    [0x000002b16a2a8650] +++ dump failed
    
     
  4. Mike

    Mike XenForo Developer Staff Member

    I'm going to have to move this to bugs. It looks like either there's an infinite loop or PCRE is crashing on this regex. I'm not sure why there would be an infinite loop though.

    Is it possible for you to access the DB to check the contents of the first post in that thread? You'd need to use the xf_thread table to identify the first_post_id and then look that up in xf_post or look at for the post with position = 0 in that thread in xf_post.
     
  5. dieg0

    dieg0 Active Member

    Sure.

    Code:
    select first_post_id from xf_thread where thread_id = 60986;
    select message from xf_post where post_id = 708153;
    Find attached the message.
     

    Attached Files:

  6. Mike

    Mike XenForo Developer Staff Member

    Err, the post is 800K? That's likely to be the problem... The default limit on text is 10K and increasing it has potential to create performance issues. This would be a good example of one.
     
  7. dieg0

    dieg0 Active Member

    Makes sense. What should I do?
     
  8. Mike

    Mike XenForo Developer Staff Member

    You likely need to edit the post directly in the database to reduce the content significantly. It could potentially be split into multiple posts, though you're probably looking at 90 posts or so...
     
  9. Felomeno

    Felomeno Member

    The problem is that it contains 2955 images, most of them gifs, 800,000 chars is not a big issue to show threads (editing will probably throw 502 error) but 2955 images...

    You should try this:
    update xf_post set message = REPLACE(message, '[IMG]', '[*IMG*]') where post_id = 708153

    And then you should be able to access the thread.

    update xf_post set message = LEFT(message, 700000) where post_id = 708153;

    You can run that query changing 700,000 to 600000 and so on, it will probably start working at 200000.
     
    Last edited: Sep 5, 2013
  10. Amaury

    Amaury Well-Known Member

    I ran into basically the problem on a site I'm a member of that I reported here, and it was due to me having a lot of tabs in my thread from, I think, Brogan's custom bulletin board code resource.
     

Share This Page