#240 edit_entry_handler.php - Failed to acquire exclusive database access

Major
closed
nobody
None
1
2015-09-16
2012-08-08
Cheney
No

Hi MRBS developers,
I have installed the MRBS v1.4.8 for several months, it works well.However, recently, I found that if anybody want to book the room(it shows "edit_entry_handler.php" was executing), it took a very long time and sometimes failed and reported "Failed to acquire exclusive database access".
Is there any known issue about this? And do you have any suggestion about it?
Thanks for your time in advance.
Cheney

Related

Support Requests: #258

Discussion

  • Campbell Morrison

    I think there may be a problem lurking somewhere in MRBS or else in your network or system configuration. See also SF Support Requests 252 and 258.

    Can you first of all try making the following change:

    This sounds like a bug which has already been fixed in the trunk. You can patch your 1.4.8 system by editing edit_entry_handler.php and adding

    sql_mutex_unlock("$tbl_entry");

    at line 647, ie just after

    // If this is an Ajax request and if it's not a valid booking which we want
    // to commit, then output the results and exit. Otherwise we go on to commit the
    // booking
    if ($ajax && function_exists('json_encode'))
    {
    if (!($commit && $valid_booking))
    {

    Please let me know if that fixes the problem or not.

    Campbell

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-08
     

    Related

    Support Requests: #252
    Support Requests: #258

  • Cheney

    Cheney - 2012-08-08

    Hi Campbell,
    Really appreciate your prompt response. I applied what you indicated as below, but seems it does not work. The book still takes too long time.
    1. sql_mutex_unlock("$tbl_entry");
    at line 647, ie just after
    2. $ajax_refresh_rate = 0;

    Do you have more suggestion about it?
    
    Thanks.
    
     
  • Campbell Morrison

    Other people have had similar problems which turned out to be due to problems with their network configuration. Is your SQL server on the same machine as your web server or is it remote? To quote from a thread on the mailing list:

    MRBS (PHP) is communicating with the database (MySQL) via network
    sockets, so if the network is misconfigured you could well have problems
    with things being slow.

    Your server should have at least the following:

    1) A FQDN for the host itself, as returned by 'hostname'. It should
    ideally be a full hostname with the domain in, i.e. myhost.example.com

    2) An entry for localhost in /etc/hosts, i.e.:
    127.0.0.1 localhost.localdomain localhost

    3) An entry for the FQDN in /etc/hosts, i.e.:
    1.2.3.4 myhost.example.com myhost

    Campbell

     
  • Cheney

    Cheney - 2012-08-10

    Hi Campbell,
    I installed the mysql and MRBS in the same server. Is there same impact as the remote SQL server?
    Currently, my configuration in /etc/hosts is that 127.0.0.1 localhost, then I modify the entry as below
    127.0.0.1 localhost.localdomain localhost
    But the book still be slow.
    Anyway, thanks for your help. Looking forward to other suggestion.
    Cheney

     
  • Campbell Morrison

    I've just re-read the thread. Can you confirm that you inserted the line

    sql_mutex_unlock("$tbl_entry");
    

    in edit_entry_handler.php at line 647? Why I'm asking is that you said you'd inserted it just after

    $ajax_refresh_rate = 0;
    

    However that line does not appear anywhere in edit_entry_handler.php. The insertion should be just after

    if ($ajax && function_exists('json_encode'))
    {
      if (!($commit && $valid_booking))
      {
    

    Campbell

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-13

    Hi Campbell, this also starting happening for our server on Thursday last week, with no changes made on the network, server, or anything else for that matter, it seems like it just started with no catalyst (now, we all nknow this can't be true)

    I've added the sql_mutex_unlock("%tbl_entry");

    line where indicated (As shown below)

    // If this is an Ajax request and if it's not a valid booking which we want
    // to commit, then output the results and exit. Otherwise we go on to commit the
    // booking
    if ($ajax && function_exists('json_encode'))
    {
    if (!($commit && $valid_booking))
    {
    sql_mutex_unlock("$tbl_entry");
    $result = array();
    $result['valid_booking'] = $valid_booking;
    $result['rules_broken'] = $rules_broken;

    Here's the thing sometimes we get the failed to open exclusive access error, and others simply times out, the only common factor is it's sitting at the edit_event_handler.php

    We've tried looking at this from a multitude of angles (including the mysql side, which reports threads closing in event viewer, but I suspect this is down to timeouts again)

    Any help would be very much appreciated as we currently have no facility to book rooms for 8 offices (and some very agitating recpetionists!!!).

    Using win 2k8 x64 ESXi VM, XAMPP 1.7.3.

    MRBS v1.4.8

     
    Last edit: Rich Kellett 2012-08-13
  • Rich Kellett

    Rich Kellett - 2012-08-13

    Apologies forgot to login in First - d'oh!

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-13

    And a bit more info, set $ajax_refresh_rate = 0;
    also enabled ebugging, no error is shown when clicking the save button, however I'm forever getting thrown a datepicker Object expected error (although the datepicker does appear to be working fine.

    Running this from http://localhost to rule out any networking errors (which shouldn't be a problem anyway as this has been working absolutely fine).

    In case it's relevant, the JS error:- (object expected at '^')

    ^$(function() {
    $("#datepicker").datepicker({yearRange: '2007:2017',
    altField: '#datepicker_alt'
    });
    var initial_date = new Date(2012, 7, 13);
    var dateFormat = $("#datepicker").datepicker( "option", "dateFormat" );
    document.getElementById('datepicker').value = $.datepicker.formatDate(dateFormat, initial_date);
    document.getElementById('datepicker_alt_day').value = 13;
    document.getElementById('datepicker_alt_month').value = 8;
    document.getElementById('datepicker_alt_year').value = 2012;
    $(".ui-datepicker").draggable();
    });

     
  • Campbell Morrison

    OK - that's helpful. You mean if you set $ajax_refresh_rate = 0; then the "Failed to acquire .. " message goes away and all you are left with is the object expected error (presumably in the JavaScript console)?

    Campbell

     
  • Campbell Morrison

    Which browser and version are you using when you get the datepicker Object expected error?

    Campbell

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-14

    no, regardless of whether or not I have the $ajax_refresh_Rate at 0 or 10 (or 20 for that matter) I still get the JS error, just mentioning that changing the value did nothing the shape of resolving...

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-14

    on IE8, get the datee picker object any time the calendar or datepicker is required (so once on loading the first screen (date picker at top, which is the line 214 error -and 4 times when editing / creating an event (one for datepicker at top of page (line 214), one for start date (line 716), end date (line 1289) and Repeat End Date (Line 2092))

     
    Last edit: Rich Kellett 2012-08-14
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-14

    in short I think it's every time a call is made to the date picker function, almost as if some variables aren't getting passed along properly - which I also don't understand as the picker does display the correct dates (eg today it's selected 14 Aug 2012 as the default goto date), could this be linked to the db error on the edit_entry_handler?

    FYI I know unlikely but thought I'd take a prod at it anyway, I exported and created a new DB, re-imported and tested that as the DB, error still exists, don't know if that gives you anymore insight into it, but I'll popst anything else I try (never know, it may help with elimination process...)

     
  • Rich Kellett

    Rich Kellett - 2012-08-14

    last 3 post were me, again forgot to login.... apologies....

     
  • Rich Kellett

    Rich Kellett - 2012-08-14

    Also tried Disabling Anti-Virus, in case that was causing the issue... No

     
  • Rich Kellett

    Rich Kellett - 2012-08-14

    Interesting, just upgraded xampp to 1.8.0 - and now when trying to create / edit I now get a completely different area, which may be of more use...

    Fatal error: Call to undefined function mrbsGetRoomArea() in C:\xampp\htdocs\xampp\mrbs\web\edit_entry_handler.php on line 264

     
  • Rich Kellett

    Rich Kellett - 2012-08-14

    Ignore last post, we'd commented out an include to do some testing - Great News, the upgrade to XAMPP has done the trick :)

    However we are still getting the Datepicker errors.. (on the grand scheme of things however, this is nothing major!)

     
    Last edit: Rich Kellett 2012-08-14
  • Campbell Morrison

    Glad the "Failed to acquire has gone away". I don't know what's causing the "Object expected error". You could try upgrading to the latest version of MRBS in SVN and see if it's any better.

    Campell

     
  • Rich Kellett

    Rich Kellett - 2012-08-15

    I'll wait for the 1.4.9 as we're also having the slow editing issue due to ldap authentication (which I believe has been resolved in 1.4.9), I've got a happy of admin staff at the minute, I don't want to rock the boat so soon....

     
  • Rich Kellett

    Rich Kellett - 2012-08-15

    and forgot to mention thanks for the quick response - nice to receive a high level of service, working in IT, it's nice to know that you're work is actually appreciated - so, to that end, thank you :)

     
  • Rich Kellett

    Rich Kellett - 2012-08-22

    Hi Campbell, FYI this has flared itself back up again, restarting the services brought it back to life, but this happened last time too, until it eventually wouldn't run full stop, I've renabled the db_nopersist so hopefully that will stop the issue...

     
  • Campbell Morrison

    Does your site forbid external internet access? In which case I think I understand the problem, which can be solved by setting

    $zoneinfo_expiry = PHP_INT_MAX;
    

    in your config file.

    See https://sourceforge.net/p/mrbs/support-requests/258/?limit=10&page=1#19f8 for an explanation.

    Campbell

     
    Last edit: Campbell Morrison 2012-09-05
  • John Beranek

    John Beranek - 2015-09-16
    • status: open --> closed
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks