Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Strange Errors and Timeouts with PDO

2

Comments

  • @phreak said:
    x00: So far nothing was recorded in the last 2 hours (i guess with this amount of users it should have already wrote something to the file). The files has 777 but my user as creator and not wwwrun. Do you have experience if the wwwrun user is substantial that writing can occur?

    it is just good practice to assign the owner rather than giving ridiculously high permissions.

    What you don't ever want to do is add the web use to one of your groups (without good reason).

    The whole point of having most of you file not under the web user is to prevent the webuser form writing to anything.

    You need to make sure you have put the absolute path tot the log file.

    grep is your friend.

  • phreakphreak MVP
    edited August 2013

    Alright changed rights. We got a first entry here. Seems like a query error when doing... something. Anyone deep enough in the structure to understand what happened here and if this has a relation to the problems above?

    07 Aug 2013 - 15:57:36: [Garden] /www/htdocs/webroot/library/database/class.database.php, 280, Gdn_Database.Query(), **You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join GDN_ConversationMessage lm on uc.LastMessageID = lm.MessageID**
    join GDN_User' at line 4, select c.*, lm.InsertUserID as `LastMessageUserID`, lm.DateInserted as `DateLastMessage`, lm.Body as `LastMessage`, lm.Format as `Format`, lmu.Name as `LastMessageName`, lmu.Photo as `LastMessagePhoto`, c.CountMessages - uc.CountReadMessages as `CountNewMessages`, uc.LastMessageID as `LastMessageID`, uc.CountReadMessages as `CountReadMessages`, uc.DateLastViewed as `DateLastViewed`, uc.Bookmarked as `Bookmarked`
    from GDN_Conversation c
    join GDN_UserConversation uc on c.ConversationID = uc.ConversationID and uc.UserID = 
    join GDN_ConversationMessage lm on uc.LastMessageID = lm.MessageID
    join GDN_User lmu on lm.InsertUserID = lmu.UserID
    where uc.Deleted = :ucDeleted
     and c.ConversationID in ('2362')
    
    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Bingo! : **join GDN_UserConversation uc on c.ConversationID = uc.ConversationID and uc.UserID = **

    That part after uc.UserID is missing.
    So it ended up in that special log? Interesting.
    It's something about private messaging.
    Hope we can find this piece in the Vanilla sourcecode, should be easy.

    There was an error rendering this rich post.

  • x00x00 MVP
    edited August 2013

    it is from here applications/conversations/models/class.conversationmodel.php

       public function ConversationQuery($ViewingUserID, $Join = '') {
          $this->SQL
             ->Select('c.*')
             ->Select('lm.InsertUserID', '', 'LastMessageUserID')
             ->Select('lm.DateInserted', '', 'DateLastMessage')
             ->Select('lm.Body', '', 'LastMessage')
             ->Select('lm.Format')
             ->Select('lmu.Name', '', 'LastMessageName')
             ->Select('lmu.Photo', '', 'LastMessagePhoto')
             ->From('Conversation c');
    
    
          if ($ViewingUserID !== FALSE) {
             $this->SQL
                ->Select('c.CountMessages - uc.CountReadMessages', '', 'CountNewMessages')
                ->Select('uc.LastMessageID, uc.CountReadMessages, uc.DateLastViewed, uc.Bookmarked')
                ->Join('UserConversation uc', "c.ConversationID = uc.ConversationID and uc.UserID = $ViewingUserID")
                ->Join('ConversationMessage lm', 'uc.LastMessageID = lm.MessageID')
                ->Join('User lmu', 'lm.InsertUserID = lmu.UserID')
                ->Where('uc.Deleted', 0);
          } else {
             $this->SQL
                ->Select('0', '', 'CountNewMessages')
                ->Select('c.CountMessages', '', 'CountReadMessages')
                ->Select('lm.DateInserted', '', 'DateLastViewed')
                ->Select('0', '', 'Bookmarked')
                ->Join('ConversationMessage lm', 'c.LastMessageID = lm.MessageID')
                ->Join('User lmu', 'lm.InsertUserID = lmu.UserID');
          }
       }
    

    which imples that $ViewingUserID is '' or NULL rather then FALSE so whatever is calling that isn't supplying FALSE

    $ViewingUserID !== FALSE means if it is not FALSE that part of the query will be added, not something that evaluates to FALSE but only FALSE.

    You would need backtrace to know exactly what is is causing it.

    Do you have any addon that have anything to do with conversations? If not it is a core problem.

    grep is your friend.

  • phreakphreak MVP
    edited August 2013

    Mmh, i have just those plugins activated.

    Besides Tapatalk i think there is no plugin, that has any touch points with the conversations.
    The Tapatalk plugin comes in a newer version from GitHub here, than the one in the Vanilla repository.
    https://github.com/tapatalk/tapatalk-vanilla2

    MentionsLookup doesn't work in Conversations so its not the case. Maybe the Authorization plugins Facebook and GoogleSignIn are checking for connection, but i guess i will leave this to you guys.

    // EnabledPlugins
    $Configuration['EnabledPlugins']['TranslationCollector'] = 'TranslationCollector';
    $Configuration['EnabledPlugins']['Emoticons'] = 'Emoticons';
    $Configuration['EnabledPlugins']['Sitemaps'] = 'Sitemaps';
    $Configuration['EnabledPlugins']['Facebook'] = 'Facebook';
    $Configuration['EnabledPlugins']['OpenID'] = 'OpenID';
    $Configuration['EnabledPlugins']['GoogleSignIn'] = 'GoogleSignIn';
    $Configuration['EnabledPlugins']['Emotify'] = 'Emotify';
    $Configuration['EnabledPlugins']['PostCount'] = 'PostCount';
    $Configuration['EnabledPlugins']['Signatures'] = 'Signatures';
    $Configuration['EnabledPlugins']['Pockets'] = 'Pockets';
    $Configuration['EnabledPlugins']['HtmLawed'] = 'HtmLawed';
    $Configuration['EnabledPlugins']['vanillicon'] = TRUE;
    $Configuration['EnabledPlugins']['RecentActivity'] = TRUE;
    $Configuration['EnabledPlugins']['ButtonBar'] = TRUE;
    $Configuration['EnabledPlugins']['WhosOnline'] = TRUE;
    $Configuration['EnabledPlugins']['FileUpload'] = TRUE;
    $Configuration['EnabledPlugins']['LikeThis'] = TRUE;
    $Configuration['EnabledPlugins']['Quotes'] = TRUE;
    $Configuration['EnabledPlugins']['StopForumSpam'] = TRUE;
    $Configuration['EnabledPlugins']['VanillaStats'] = TRUE;
    $Configuration['EnabledPlugins']['MentionsLookup'] = TRUE;
    $Configuration['EnabledPlugins']['RoleTitle'] = TRUE;
    $Configuration['EnabledPlugins']['PeregrineBadges'] = TRUE;
    $Configuration['EnabledPlugins']['VersionCheck'] = TRUE;
    $Configuration['EnabledPlugins']['RegisterPM'] = TRUE;
    $Configuration['EnabledPlugins']['SubCategories'] = TRUE;
    $Configuration['EnabledPlugins']['MyProfile'] = TRUE;
    $Configuration['EnabledPlugins']['GoBackMobile'] = TRUE;
    $Configuration['EnabledPlugins']['StatsBox'] = TRUE;
    $Configuration['EnabledPlugins']['AddMenuitem'] = TRUE;
    $Configuration['EnabledPlugins']['SymbolEdit'] = TRUE;
    $Configuration['EnabledPlugins']['Tapatalk'] = TRUE;
    
    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • x00x00 MVP
    edited August 2013

    It looks like a bug, but I don't believe this is the major issue, the issue you are having is you are loosing session reference momentarily and reference to a bunch of other object in memory, so this is more symptom of that. There is some problem on you server where it is loosing reference to the objects in memory. Which is why you are getting errors like not finding the the conf.php, values, leading it to believe vanilla is not installed.

    In any case, it is unlikely down to simply a script error. I did ask you if there was an caching like APC, memchache.

    I think this is an issue that you need to solve with your host. It could be that the server is borking, and restarting, however this seems to be mid process like it is temporarily loosing reference and still attempting to continue with the procces unperterbed. Otherwise you would not get this strangeness, it would simply crash.

    grep is your friend.

  • I noticed that little x here actually ... had a blue background . It went away when I refreshed the page. Maybe if no activity for a while it wigs out . Maybe it's a subliminal pop up with no other reason than to get you attention ?

    I have actually had bonk pop ups happen and appear where the notification pop ups happen. Goes away after refresh. No error logged. I think it's a server time out ...

  • Thanx @x00: I will contact my hoster. From what i saw from my server-monitoring there are no exceedings. I wonder where the devil's hidden. No APC or Memchaches running. So it's a Javacript request thing and as said yes, the reloads does it but that is not a solution to 75.000 visitors.

    It's like hunting the duck in the reed. :)

    @Lincoln and crew: Will it be possible to get a server configuration cheatsheets from what you are using to run the hosted version or what you think might help the OS variant of Vanilla regarding performance and stability?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • x00x00 MVP
    edited August 2013

    what I'm saying is it would not normally reach that place in the code in that condition, there is a memory issue going on where it is loosing track. If the session was void you would not reach that point, it is loosing the session, or the config object, or reference half way through processing the request.

    grep is your friend.

  • phreakphreak MVP
    edited August 2013

    @x00: Yep, i understand. I'm conversation with my hosting support.

    Also, interesting would be if there could be some software side fallback. Meaning if there is a possibility Vanilla could manage an error like this on it's own. I actually have no clue about this but maybe an instance like a waitANDtryagain(); call or similar could help in cases like this. Estimating this up in the air, developers will laugh at me, i know ;).

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • x00x00 MVP
    edited August 2013

    Getting something that is not working anyway to regulate itself or a parent is haphazard. Most scripts do not have that level of self awareness, that is in the realm of AI.

    Normally you would do the wait a try again if there is a server error such as 500. However this is not saying there is a error with the server that prevent it running, something is getting lost half way through an it is carrying on in good faith, believe it is doing the correct, it is only erroring becuase it reaches a point were that object needs to be used an it is not there an the operation doesn't makes sense in context. it would normally never happen like this, it is only when something is unstable, would somethign like this happen.

    It is a bit like the quantum world, things vanish for no reason.

    grep is your friend.

  • phreakphreak MVP
    edited August 2013

    And as you @x00. Here is one of the bastards in all it's beauty, after having the browser window open for about an hour. But for some it seem to occur earlier or while writing a posting.

    @Underdog:

    <div class="InformWrapper Dismissable AjaxError">
    
    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • x00x00 MVP
    edited August 2013

    Well that is a standard 500 internal server error. They happen from time to time, but if it is happening a lot, sporadically, that is an indication of a problem.

    There is a way to auto refresh on these errors otherwise.


    As an aside I recommend that any medium to big forum regularly prunes their Gdn_Activity table. Activity is a huge generator of mostly useless information, even if it is a bit more optimised, in recent versions.

    grep is your friend.

  • Yea the image phreak posted looks like what has happened to me on my forum from time to time ... No error however , I mean nothing is actually bonking except the popup .

    I think it has to do with MySQL PDO memory leaks?

  • phreakphreak MVP
    edited August 2013

    I could catch one of this Erros in all it's beauty. :)


    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • UnderDogUnderDog MVP
    edited August 2013

    That is awesome!

    SQLSTATE[42000] [1203] User notimportant already has more than 'max_user_connections' active connections
    And a little less awesome... It's too many connections to the database. I don't know how to solve it though, but at least it's a clear MySQL error.

    There was an error rendering this rich post.

  • phreakphreak MVP
    edited August 2013

    Thanx for formating my post better @UnderDog.

    This might not give a clear information, but the forum this error appears reaches during day hours about 50-70 visitors and about 20-35 logged in users. The forum is still working, but seem to cause problems to some users. I have no clue where to start with the screwdriver, but i've set up the refresh rate of Who's online to all 10 seconds from 7, just to give this a try.

    Although i don't think the online users in this dimensions are not likely to cause a problem, as i've seen this errors also with less users. Any more ideas?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • I found this bit of info that may prove useful , changing the settings for mysql

    http://dev.mysql.com/doc/refman/5.0/en/user-resources.html

  • @phreak said:

    This might not give a clear information, but the forum this error appears reaches during day hours about 50-70 visitors and about 20-35 logged in users. The forum is still working, but seem to cause problems to some users. I have no clue where to start with the screwdriver, but i've set up the refresh rate of Who's online to all 10 seconds from 7, just to give this a try.

    Seriously I disable stuff like this, or break the polling deliberately. Are people that keen to know whose online every ten seconds. it is not like it is that accurate, they might just leave the browser open and go to the park.

    This sort of aimless polling at regular intervals can hammer a site for no good reason, I would set a very high numbers. Personally I break it entirely, becuase it still request once again after the page request. But then again I'm anti social, and don't like this "social networking" crap.

    grep is your friend.

  • But then again I'm anti social, and don't like this "social networking" crap.

    Yeah, i wouldn't need one either, but informations like this (friends online) can have a huge positive impact on communities like mine.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Sign In or Register to comment.