#252 Failed to acquire exclusive database access

open
nobody
None
7
2012-09-04
2012-07-11
No

Hi all, since a couple of weeks we are facing this error message while adding a new reservation request. It doesn't happen constantly but very often and it's not very nice because we have several users that cannot use the system.

I made a standard installation so I didn't touch any mysql parameters. The first time I got this error I enabled $db_nopersist = 1 in the config.inc.php but it didn't solve this problem.

Below you see my enviroment installation. Do you have any idea on how to solve my problem?

Thanks in advance.

MRBS 1.4.8
Database: MySQL 5.5.16
System: Windows NT ITA-BSYSTEM 6.0 build 6002 (Windows Server 2008 Enterprise Edition Service Pack 2) i586
Server time: 7/11/2012 12:30:14 PM
PHP: 5.3.8

Related

Bugs: #240
Support Requests: #258

Discussion

  • Campbell Morrison

    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))
    {

    Campbell

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    Thanks...I'll make this change and let you know.

    Many many thanks

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    No luck, I added the line exactly as you suggested but I get the same error message. As additional info I notice this problem happens after five or 6 added entries...when it starts to stop working I see that when I start adding a new reservation the "v" check signs for "no scheduling conflicts" and "no policy conflicts" take about 6/7 seconds to be visible (usually when the system worksI see these signs immediately) and then it takes some time to execute the reservation and in most of the case it doesn't work. Sometimes I also get the following error: "500 - Internal server error." "There is a problem with the resource you are looking for, and it cannot be displayed."

    Do you have some additional hints?

    Thanks in advance.

     
  • Campbell Morrison

    For some reason the Ajax checks are taking a long time. In order to reduce the frequency of the problem for your users while we get this sorted out you could set

    $ajax_refresh_rate = 0;

    in your config file. This will disable regular Ajax checks, which normally happen every 10 seconds, to update the green ticks/red crosses in case somebody else makes a booking while you are waiting.

    In the meantime I can suggest two things:

    (1) If you are able to run a duplicate test system (copy the mrbs web files to another directory, but still run against the same database) with $ajax_refresh_rate = 10; (ie identical to the problem system) then can you turn on the JavaScript console in your browser and see if you are getting any error messages there

    and/or (2) if you are able to download the latest version of the code from the Subversion trunk, can you try running it to see if that has the problem. (If you can't download it I can post it on this page)

    Campbell

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    I prefer that you post the link to the latest revision just to be sure that I'm using the correct one.

    Thanks

     
  • Campbell Morrison

    MRBS 1.4.8 is the latest released version, but to get the latest development version you'll need a Subversion client. Full details here https://sourceforge.net/scm/?type=svn&group_id=5113

    If you don't have a Subversion client I can post the latest files for you

    Campbell

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    Here some news: I downloaded the latest svn version, I made a copy of the original mysql db. I just kept from my original version the file config.inc.php and modified the entry related to the copied DB. As soon as I started using the svn version I got the message to upgrade the DB and I did it.

    Starting using the svn version I didn't get the "Failed to acquire exclusive database access" error message so far...I still noticed slowness to make reservations even if I added the line "$ajax_refresh_rate = 0;" but currently this is the only "problem".

    For sure the slowness problem happens always when I make a reservation into an area with 7 rooms...

    Hope these info help you to better detect the problem.

    Thanks!

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    spoke too fast...I got the "Failed to acquire exclusive database access" but only when I make a reservation on the area with 7 rooms...

     
  • Campbell Morrison

    Is your SQL server on the localhost or is it on a remote server?

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    It's on localhost, it'a a virtual machine

     
  • Campbell Morrison

    Can you have a look at your JavaScript console in the browser and see if there are any error messages there?

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    This is what I get enabling the JS console while browsing and making reservations

    [16:35:30.025] Use of attributes' specified attribute is deprecated. It always returns true. @ http://loan.italy.conseur.org/mrbs_por/web/edit_entry.php?area=11&room=17&hour=08&minute=00&year=2012&month=7&day=11

    http://loan.italy.conseur.org/mrbs_por/web/edit_entry_handler.php

    Request Method:
    POST
    
    Status Code:
    HTTP/1.1 500 Internal Server Error
    
    Request Headers
    16:41:05.476
    

    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8Accept-Encoding:gzip, deflateAccept-Language:en-us,en;q=0.5Authorization:Basic aXRhbHlcbXJvY2NvOnZlcmJhdGltConnection:keep-aliveHost:loan.italy.conseur.orgReferer:http://loan.italy.conseur.org/mrbs_por/web/edit_entry.php?area=9&room=15&hour=08&minute=30&year=2012&month=7&day=11User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1

    Response Headers
    Δ32941ms
    

    Content-Length:1208Content-Type:text/htmlDate:Wed, 11 Jul 2012 14:41:38 GMTServer:Microsoft-IIS/7.0X-Powered-By:ASP.NET

     
  • Campbell Morrison

    You say the problem has only been happening for the last couple of weeks. Was it OK before then? Can you think of anything that may have changed at the time the problem started?

     
  • Campbell Morrison

    I've just been looking through the archives. Other people have reported problems with slow saves which turned out to be due to network misconfiguration and problems resolving a fully qualified domain name. Are you getting any errors in your web server log?

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-11

    I didn't verify the web server errors...I'll look for it...what I'm afraid is the error message that I'm still getting "Failed to acquire exclusive database access" that it seems to be mysql related but I don't know how to fix it.

     
  • Campbell Morrison

    I think you're getting the "failed to acquire message" because the saves are slow. My theory is that something is causing the saves to be slow and so edit_entry_handler is holding the mutex lock for ~5 seconds, whih means that other users will get the "failed to acquire message". My guess is that if we can get the saves to be normal speed then the "failed to acquire" problem will disappear.

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-12

    I'm checking the vm server status, network and IIS settings...I'll keep you in touch.

    Thanks

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-12

    Belive it or not I found the solution and it was as "stupid" as difficult to find...I checked everywhere, IIS, network, VM enviroment, performance and so on...the problem was:

    for that specific area the timezone was different from the setting in the config file...unbelievable!!!!

    We have different countries that connect to our server in Italy (each country has it's own enviroment and DB), what I did is to set in the config file of each country their local timezone...I hope this is the correct setting...btw it's working now.

    Many many thanks for you kind support!!!!!!

     
  • Campbell Morrison

    Glad to hear everything's now working, but I don't quite understand why the timezone was causing it. The system is designed so that you can have different timezones for different areas. The timezone setting is supposed to be the timezone of the area not the server, but if you've already got some existing bookings for the area you can't change the timezone now because the existing bookings will all be at the wrong time. Is it possible that when you changed the timezone setting you also changed something else?

    Campbell

     
  • Massimo Rocco

    Massimo Rocco - 2012-07-13

    To be honest I don't know...but even changing the timezone I still have some problems...I want to give you more info about my enviroment:

    My host machine is a Win 2008 Server R2 x64 ENG virtualized
    all language settings are in italian (timezone and so on)

    I made five installations of mrbs with five different Mysql DB
    five installations are for the following countries:
    Italy
    Spain
    Portugal
    Brazil
    Belgium

    I set for each country their own timezone in config file
    Rome
    Madrid
    Lisbon
    Sao Paulo
    Brussels

    yesterday I verified that for Portugal enviroment, timezone for one are was Rome, I changed to Lisbon and the problem was solved.

    This morning I verified again, and I got the same slowness, I verified the timezone and it was Lisbon...I changed to Dublin and it worked again so I'm still stuck...suggestions are welcome

     
  • Campbell Morrison

    See also SF Support Request 258 and SF Bug 240

    Campbell

     
  • Massimo Rocco

    Massimo Rocco - 2012-08-08

    Many thanks.

    Massimo
    On 08/08/2012 11:10, Campbell Morrison wrote:

    See also SF Support Request 258 and SF Bug 240

    Campbell


    support-requests:252 Failed to acquire exclusive database access

    Status: open Created: Wed Jul 11, 2012 10:36 AM UTC by Massimo
    Rocco Last Updated: Fri Jul 20, 2012 06:42 PM UTC Owner: nobody

    Hi all, since a couple of weeks we are facing this error message while
    adding a new reservation request. It doesn't happen constantly but
    very often and it's not very nice because we have several users that
    cannot use the system.

    I made a standard installation so I didn't touch any mysql parameters.
    The first time I got this error I enabled $db_nopersist = 1 in the
    config.inc.php but it didn't solve this problem.

    Below you see my enviroment installation. Do you have any idea on how
    to solve my problem?

    Thanks in advance.

    MRBS 1.4.8
    Database: MySQL 5.5.16
    System: Windows NT ITA-BSYSTEM 6.0 build 6002 (Windows Server 2008
    Enterprise Edition Service Pack 2) i586
    Server time: 7/11/2012 12:30:14 PM
    PHP: 5.3.8


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/mrbs/support-requests/252/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/prefs/

     
  • 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


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