Menu

#1314 Upgrade from 1.4.10 to 1.6.1 dtatbase not available

None
open
nobody
None
1
2017-09-26
2017-09-13
Anonymous
No

After upgrading to 1.6.1 from 1.4.10, get Fatal error: unfortunately the database is not available at the moment. When we run mrbs, headers are therejust no room info.
Errors:

Uncaught exception 'MRBS\DBException' in /srv/www/htdocs/booking/lib/MRBS/DB.php at line 67
could not find driver
SQL:
Params:
#0 /srv/www/htdocs/booking/lib/MRBS/DBFactory.php(25): MRBS\DB->__construct('localhost', 'mrbs', 'kaplanlab', 'mrbs', false, 3306)
#1 /srv/www/htdocs/booking/dbsys.inc(40): MRBS\DBFactory::create('mysql', 'localhost', 'mrbs', 'kaplanlab', 'mrbs', false, NULL)
#2 /srv/www/htdocs/booking/dbsys.inc(74): MRBS\db()
#3 /srv/www/htdocs/booking/defaultincludes.inc(29): require_once('/srv/www/htdocs...')
#4 /srv/www/htdocs/booking/index.php(9): require('/srv/www/htdocs...')
#5 {main}
MRBS GET: Array
(
)
MRBS POST: Array
(
)

Discussion

1 2 > >> (Page 1 of 2)
  • Campbell Morrison

    It looks like you haven't got the PDO MySQL driver enabled. You need to (or ask your hosting company to) edit your php.ini file and uncomment the lines:

    for Linux servers:

    extension=pdo.so
    extension=pdo_mysql.so
    

    for Windows servers:

    extension=php_pdo.dll
    extension=php_pdo_mysql.dll
    
     
  • John Beranek

    John Beranek - 2017-09-13

    The PDO extension might also be provided by an OS package on Linux, e.g. "php-pdo" on RHEL/CentOS

     
  • Anonymous

    Anonymous - 2017-09-14

    Now I get :

    Meeting Room Booking System

    The database needs to be upgraded. Please backup your database before proceeding.

    Upgrading to database version: 36

    Fatal error: unfortunately the database is not available at the moment.
    View Day:
    Sep 08 | Sep 09 | Sep 10 | Sep 11 | Sep 12 | Sep 13 | [ Sep 14 ] | Sep 15 | Sep 16 | Sep 17 | Sep 18 | Sep 19 | Sep 20 | Sep 21
    View Week:
    Aug 13 | Aug 20 | Aug 27 | Sep 03 | [ Sep 10 ] | Sep 17 | Sep 24 | Oct 01 | Oct 08
    View Month:
    Jul 2017 | Aug 2017 | [ Sep 2017 ] | Oct 2017 | Nov 2017 | Dec 2017 | Jan 2018 | Feb 2018 | Mar 2018

     
  • Anonymous

    Anonymous - 2017-09-14

    Sorry here is the debug info:
    Meeting Room Booking System

    The database needs to be upgraded. Please backup your database before proceeding.
    
    Upgrading to database version: 36Uncaught exception 'MRBS\DBException' in /srv/www/htdocs/booking/lib/MRBS/DB.php at line 174
    SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'modified_by'
    SQL: # Add a modified_by column so that we can see who last edited a bookingALTER TABLE mrbs_entryADD COLUMN modified_by varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' NOT NULL AFTER create_by
    Params: Array
    (
    )
    
    #0 /srv/www/htdocs/booking/upgrade.inc(79): MRBS\DB->query('# Add a modifie...')
    #1 /srv/www/htdocs/booking/dbsys.inc(141): MRBS\upgrade_database(false, '35', 49, Object(MRBS\DB_mysql))
    #2 /srv/www/htdocs/booking/defaultincludes.inc(29): require_once('/srv/www/htdocs...')
    #3 /srv/www/htdocs/booking/day.php(4): require('/srv/www/htdocs...')
    #4 {main}
    MRBS GET: Array
    (
        [year] => 2017
        [month] => 09
        [day] => 09
    )
    MRBS POST: Array
    (
        [form_username] => mrbs
        [form_password] => kaplanlab
    )
    
    Fatal error: unfortunately the database is not available at the moment
    
     

    Last edit: Campbell Morrison 2017-09-14
  • Campbell Morrison

    Do you know how the 'modified_by' column could have got there? Did you add it manually?

     
  • Anonymous

    Anonymous - 2017-09-14

    No, I did ot add it. This was originally setup by someone at another University, I've inherited it.

     
  • Campbell Morrison

    Does the mrbs_area table have a column called 'min_create_ahead_enabled'?

    If so, then it looks as though your database has already been partially upgraded and I'll have to think a bit about what might have happened and how to fix it.

    If not, then maybe it's coincidence that somebody has added a column called 'modified_by'. In which case you could alter the value of 'db_version' in the mrbs_variables table from 35 to 36. But backup your database first !!!

     
  • Anonymous

    Anonymous - 2017-09-15

    Would it have upgraded when we upgraded to 1.4.10? That was the only upgrade I know of.

     
    • Campbell Morrison

      Yes, when you upgraded to 1.4.10 the database would have been upgraded to the 1.4.10 level.

       
  • Anonymous

    Anonymous - 2017-09-15

    Don't know if this helps, but when I use webmin to view tables I get:
    SQL show index from mrbs_repeat failed : Table 'mrbs.mrbs_repeat' doesn't exist

     
  • Campbell Morrison

    Very weird. If you haven't got an mrbs_repeat table then something is seriously wrong. Did you manage to see if you have a column called 'min_create_ahead_enabled' in the mrbs_area table?

     
  • Anonymous

    Anonymous - 2017-09-15

    Now I'm more confused here are the tables:
    mysql> show tables;
    +----------------+
    | Tables_in_mrbs |
    +----------------+
    | mrbs_area |
    | mrbs_entry |
    | mrbs_repeat |
    | mrbs_room |
    | mrbs_users |
    | mrbs_variables |
    | mrbs_zoneinfo |
    +----------------+
    7 rows in set (0.00 sec)

     
  • Anonymous

    Anonymous - 2017-09-15

    Here is the list of columns:
    mysql> show columns from mrbs_area;
    +--------------------------+-------------+------+-----+---------+----------------+
    | Field | Type | Null | Key | Default | Extra |
    +--------------------------+-------------+------+-----+---------+----------------+
    | id | int(11) | NO | PRI | NULL | auto_increment |
    | disabled | tinyint(1) | NO | | 0 | |
    | area_name | varchar(30) | YES | | NULL | |
    | timezone | varchar(50) | YES | | NULL | |
    | area_admin_email | text | YES | | NULL | |
    | resolution | int(11) | YES | | NULL | |
    | default_duration | int(11) | YES | | NULL | |
    | default_duration_all_day | tinyint(1) | NO | | 0 | |
    | morningstarts | int(11) | YES | | NULL | |
    | morningstarts_minutes | int(11) | YES | | NULL | |
    | eveningends | int(11) | YES | | NULL | |
    | eveningends_minutes | int(11) | YES | | NULL | |
    | private_enabled | tinyint(1) | YES | | NULL | |
    | private_default | tinyint(1) | YES | | NULL | |
    | private_mandatory | tinyint(1) | YES | | NULL | |
    | private_override | varchar(32) | YES | | NULL | |
    | min_book_ahead_enabled | tinyint(1) | YES | | NULL | |
    | min_book_ahead_secs | int(11) | YES | | NULL | |
    | max_book_ahead_enabled | tinyint(1) | YES | | NULL | |
    | max_book_ahead_secs | int(11) | YES | | NULL | |
    | max_per_day_enabled | tinyint(1) | NO | | 0 | |
    | max_per_day | int(11) | NO | | 0 | |
    | max_per_week_enabled | tinyint(1) | NO | | 0 | |
    | max_per_week | int(11) | NO | | 0 | |
    | max_per_month_enabled | tinyint(1) | NO | | 0 | |
    | max_per_month | int(11) | NO | | 0 | |
    | max_per_year_enabled | tinyint(1) | NO | | 0 | |
    | max_per_year | int(11) | NO | | 0 | |
    | max_per_future_enabled | tinyint(1) | NO | | 0 | |
    | max_per_future | int(11) | NO | | 0 | |
    | custom_html | text | YES | | NULL | |
    | approval_enabled | tinyint(1) | YES | | NULL | |
    | reminders_enabled | tinyint(1) | YES | | NULL | |
    | enable_periods | tinyint(1) | YES | | NULL | |
    | confirmation_enabled | tinyint(1) | YES | | NULL | |
    | confirmed_default | tinyint(1) | YES | | NULL | |
    +--------------------------+-------------+------+-----+---------+----------------+
    36 rows in set (0.00 sec)

     
  • Campbell Morrison

    It looks like you have got an mrbs_repeat table after all. Not sure why you were getting that message before.

    As you haven't got a 'min_create_ahead_enabled' column yet, it's possible that the 'modified_by' column was there because someone had created it manually. One thing you could try then is altering the value of 'db_version' in the mrbs_variables table from 35 to 36. But backup your database first !!!

     
  • Anonymous

    Anonymous - 2017-09-15

    MRBS_REPEAT shows to be a table, but when I show:

    mysql> select * from mrbs_repeat;
    ERROR 1146 (42S02): Table 'mrbs.mrbs_repeat' doesn't exist

     
  • Campbell Morrison

    I don't know why that's happening. Did repeat bookings work OK before you tried to upgrade? If so, then it's probably OK.

     
  • Anonymous

    Anonymous - 2017-09-15

    Changed to variable to 35 to 36 now get:

    Meeting Room Booking System
    
    The database needs to be upgraded. Please backup your database before proceeding.
    
    Upgrading to database version: 37Uncaught exception 'MRBS\DBException' in /srv/www/htdocs/booking/lib/MRBS/DB.php at line 174
    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mrbs.mrbs_repeat' doesn't exist
    SQL: ALTER TABLE mrbs_repeatMODIFY COLUMN timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
    Params: Array
    (
    )
    
    #0 /srv/www/htdocs/booking/upgrade.inc(79): MRBS\DB->query('\n\nALTER TABLE m...')
    #1 /srv/www/htdocs/booking/dbsys.inc(141): MRBS\upgrade_database(false, '36', 49, Object(MRBS\DB_mysql))
    #2 /srv/www/htdocs/booking/defaultincludes.inc(29): require_once('/srv/www/htdocs...')
    #3 /srv/www/htdocs/booking/week.php(6): require('/srv/www/htdocs...')
    #4 {main}
    MRBS GET: Array
    (
        [year] => 2017
        [month] => 09
        [day] => 28
    )
    MRBS POST: Array
    (
        [form_username] => mrbs
        [form_password] => kaplanlab
    )
    
    Fatal error: unfortunately the database is not available at the moment.
    
     

    Last edit: Campbell Morrison 2017-09-16
  • Anonymous

    Anonymous - 2017-09-15

    +------------------+--------+----------+----------------------------------------+
    | Table | Op | Msg_type | Msg_text |
    +------------------+--------+----------+----------------------------------------+
    | mrbs.mrbs_repeat | repair | Error | Table 'mrbs.mrbs_repeat' doesn't exist |
    | mrbs.mrbs_repeat | repair | status | Operation failed |
    +------------------+--------+----------+----------------------------------------+
    2 rows in set (0.00 sec)

     
  • John Beranek

    John Beranek - 2017-09-15

    I would say you've got some sort of serious problem with your MySQL database server.

    Try restarting MySQL and looking in its error log.

     
  • Anonymous

    Anonymous - 2017-09-15

    Can I drop and add it.

     
    • Campbell Morrison

      Dropping and adding the repeat table isn't an option as you'd lose all the information about your repeat bookings.

       
1 2 > >> (Page 1 of 2)