Open jberanek opened 7 years ago
Is there anything in your log just before that? It would be good to know the actual SQL error. If you are not seeing anything then change that trigger_error() line to
error_log(sql_error());
Original comment by: campbell-m
Hi,
Thanks for your time. There is nothing in the log before that. I don't see the actual SQL, that would be great to see it.
Here's what i have done to the mrbs_sql.inc
if (sql_command($sql) < 0)
{
// probably because the table hasn't been created properly
//trigger_error(sql_error(), E_USER_WARNING);
error_log(sql_error());
fatal_error(TRUE, get_vocab("fatal_db_error"));
}
Here's the last log.
[02-Nov-2016 17:14:04 America/New_York] MRBS: Fatal error: unfortunately the database is not available at the moment.
[02-Nov-2016 17:14:04 America/New_York] #0 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(634): fatal_error(true, 'Fatal error: un...')
/home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(666): mrbsCreateEntry('mrbs_entry', Array)
/home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(1856): mrbsCreateSingleEntry(Array)
/home/skipresse/public_html/sk1m3d14/edit_entry_handler.php(685): mrbsMakeBookings(Array, NULL, false, NULL, NULL, true, 'series')
{main}
[02-Nov-2016 17:14:04 America/New_York] MRBS POST: Array
(
[name] => tester
[description] => tester
[start_day] => 2
[start_month] => 11
[start_year] => 2016
[start_seconds] => 43200
[end_day] => 2
[end_month] => 11
[end_year] => 2016
[end_seconds] => 43200
[area] => 5
[rooms] => Array
(
[0] => 23
)
[type] => I
[rep_type] => 0
[rep_day] => Array
(
[0] => 3
)
[rep_num_weeks] => 1
[month_type] => 0
[month_absolute] => 2
[month_relative_ord] => 1
[month_relative_day] => WE
[rep_end_day] => 2
[rep_end_month] => 11
[rep_end_year] => 2016
[returl] => http://68.71.42.171/~skipresse/sk1m3d14/day.php?year=2016&month=11&day=02&area=5&room=23
[create_by] => p.lincourt
[rep_id] => 0
[edit_type] => series
)
[02-Nov-2016 17:14:04 America/New_York] MRBS SESSION: Array
(
[UserName] => p.lincourt
)
I don't see any SQL error. Maybe i'm doing something wrong?
Thanks again for your help, i really appreciate it. Patrick
Original comment by: plincourt
If you change that piece of code to
if (sql_command($sql) < 0)
{
// probably because the table hasn't been created properly
//trigger_error(sql_error(), E_USER_WARNING);
error_log($sql); // Add this line
error_log(sql_error());
fatal_error(TRUE, get_vocab("fatal_db_error"));
}
then you should see the SQL in the log.
Original comment by: campbell-m
Please forget about my last message.
Here's the last log.
[02-Nov-2016 17:44:29 America/New_York] Column 'repeat_id' cannot be null
[02-Nov-2016 17:44:29 America/New_York] MRBS: Fatal error: unfortunately the database is not available at the moment.
[02-Nov-2016 17:44:29 America/New_York] #0 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(635): fatal_error(true, 'Fatal error: un...')
#1 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(667): mrbsCreateEntry('mrbs_entry', Array)
#2 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(1857): mrbsCreateSingleEntry(Array)
#3 /home/skipresse/public_html/sk1m3d14/edit_entry_handler.php(685): mrbsMakeBookings(Array, NULL, false, NULL, NULL, true, 'series')
#4 {main}
[02-Nov-2016 17:44:29 America/New_York] MRBS POST: Array
(
[name] => eqwfwe
[description] => wefwefwef
[start_day] => 2
[start_month] => 11
[start_year] => 2016
[start_seconds] => 43200
[end_day] => 2
[end_month] => 11
[end_year] => 2016
[end_seconds] => 43200
[area] => 21
[rooms] => Array
(
[0] => 97
)
[type] => I
[confirmed] => 1
[rep_type] => 0
[rep_day] => Array
(
[0] => 3
)
[rep_num_weeks] => 1
[month_type] => 0
[month_absolute] => 2
[month_relative_ord] => 1
[month_relative_day] => WE
[rep_end_day] => 2
[rep_end_month] => 11
[rep_end_year] => 2016
[returl] => http://68.71.42.171/~skipresse/sk1m3d14/day.php?year=2016&month=11&day=2&area=21
[create_by] => p.lincourt
[rep_id] => 0
[edit_type] => series
)
[02-Nov-2016 17:44:29 America/New_York] MRBS SESSION: Array
(
[UserName] => p.lincourt
)
Here's the new line.
[02-Nov-2016 17:44:29 America/New_York] Column 'repeat_id' cannot be null
Sorry about that.
Original comment by: plincourt
Here's the last log
[02-Nov-2016 17:50:57 America/New_York] INSERT INTO mrbs_entry (`start_time`, `end_time`, `entry_type`, `repeat_id`, `room_id`, `create_by`, `modified_by`, `name`, `type`, `description`, `status`, `ical_uid`, `ical_sequence`, `ical_recur_id`) VALUES (1478102400, 1478102460, 0, NULL, 23, 'p.lincourt', '', 'ewfw', 'I', 'wefwef', 0, 'MRBS-581a5fc16ca17-325a18e8@68.71.42.171', 0, NULL)
[02-Nov-2016 17:50:57 America/New_York] Column 'repeat_id' cannot be null
[02-Nov-2016 17:50:57 America/New_York] MRBS: Fatal error: unfortunately the database is not available at the moment.
[02-Nov-2016 17:50:57 America/New_York] #0 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(636): fatal_error(true, 'Fatal error: un...')
#1 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(668): mrbsCreateEntry('mrbs_entry', Array)
#2 /home/skipresse/public_html/sk1m3d14/mrbs_sql.inc(1858): mrbsCreateSingleEntry(Array)
#3 /home/skipresse/public_html/sk1m3d14/edit_entry_handler.php(685): mrbsMakeBookings(Array, NULL, false, NULL, NULL, true, 'series')
#4 {main}
[02-Nov-2016 17:50:57 America/New_York] MRBS POST: Array
(
[name] => ewfw
[description] => wefwef
[start_day] => 2
[start_month] => 11
[start_year] => 2016
[start_seconds] => 43200
[end_day] => 2
[end_month] => 11
[end_year] => 2016
[end_seconds] => 43200
[area] => 5
[rooms] => Array
(
[0] => 23
)
[type] => I
[rep_type] => 0
[rep_day] => Array
(
[0] => 3
)
[rep_num_weeks] => 1
[month_type] => 0
[month_absolute] => 2
[month_relative_ord] => 1
[month_relative_day] => WE
[rep_end_day] => 2
[rep_end_month] => 11
[rep_end_year] => 2016
[returl] => http://68.71.42.171/~skipresse/sk1m3d14/day.php?year=2016&month=11&day=02&area=5&room=23
[create_by] => p.lincourt
[rep_id] => 0
[edit_type] => series
)
[02-Nov-2016 17:50:57 America/New_York] MRBS SESSION: Array
(
[UserName] => p.lincourt
)
Original comment by: plincourt
Your mrbs_entry table seems to have the wrong schema, the repeat_id column should be:
repeat_id int DEFAULT NULL,
along with:
FOREIGN KEY (repeat_id)
REFERENCES mrbs_repeat(id)
ON UPDATE CASCADE
ON DELETE CASCADE,
Are you by any chance using an old and/or customised MRBS?
Original comment by: jberanek
I have updated the database to accept NULL from the repeat_id field and everything is working. Thanks a lot for your help :) Really appreciate it.
Original comment by: plincourt
No, i have made the installation last month.
Original comment by: plincourt
Although it's now working, I don't quite understand how the database got into this state. I suspect something went wrong with the installation process, so I think you should expect other problems to surface in due course. If you haven't already got any existing bookings in the system then I'd recommend starting the installation process again. If you have got existing bookings in the system and don't want to lose them, then I'd check the table structures against the structure defined in tables.my.sql. The easiest way of doing this might be to dump the structure of your existing tables and compare it with a dump of the structure of a fresh install using a different table prefix or database. (And before you do anything I'd take a backup of your database just in case ...).
Original comment by: campbell-m
Hi,
I will backup and dump/compare the structure from a new install. Just to make sure eveything is the same. I have made a lot of testing yesterday and everything seems legit.
Thanks again for your time, Patrick
Original comment by: plincourt
How is this accomplished? Updating the database to accept NULL?
Original comment by: *anonymous
You can do it from phpMyAdmin. Go to Structure and then Edit (I think, or possibly Change) the column in question.
However, I assume the post above is from somebody other than the OP? If so, are you having the same problem? I am puzzled as to why people are meeting this problem and wonder whether there's a problem with the upgrade procedure. What is your upgrade history? In other words what version have you upgraded from and to?
Original comment by: campbell-m
Fatal error: unfortunately the database is not available at the moment.
Original comment by: *anonymous
I got the same error "Fatal error: unfortunately the database is not available at the moment." while opening the webpage. However, I can access the database from a simple DB connection test. My question is where can I find the log file and how to trace the error. Thanks!
Original comment by: *anonymous
The location of the log file will depend on your system and its configuration. It's often a file called error_log
in the directory that you're running the script. The attached test program should tell you the location.
If you can't find it then you can force errors to be displayed in the browser by adding the following lines to the bottom of internalconfig.inc.php:
error_reporting(-1);
ini_set('display_errors', '1');
Original comment by: campbell-m
Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/f86d7b11/af4c/8526/attachment/test.php
Thanks a lot for your reply. I got below error display after adding those lines.
Uncaught exception 'MRBS\DBException' in C:\inetpub\wwwroot\Meetingroom\lib\MRBS\DB.php at line 67 could not find driver SQL: Params:
#0 C:\inetpub\wwwroot\Meetingroom\lib\MRBS\DBFactory.php(25): MRBS\DB->__construct('localhost', 'mrbs', 'mrbs', 'mrbs', false, NULL)
#1 C:\inetpub\wwwroot\Meetingroom\dbsys.inc(40): MRBS\DBFactory::create('mysql', 'localhost', 'meba', 'mrbs', 'mrbs', false, NULL)
#2 C:\inetpub\wwwroot\Meetingroom\dbsys.inc(74): MRBS\db()
#3 C:\inetpub\wwwroot\Meetingroom\defaultincludes.inc(29): require_once('C:\\inetpub\\wwwr...')
#4 C:\inetpub\wwwroot\Meetingroom\index.php(9): require('C:\\inetpub\\wwwr...')
#5 {main}
MRBS GET: Array ( ) MRBS POST: Array ( )
Original comment by: *anonymous
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
Original comment by: campbell-m
Oh, thanks a lot for your guidance. It is working now. Highly appreciate!
Original comment by: *anonymous
Hello,
I'm getting a "Fatal error: unfortunately the database is not available at the moment." when a user try to make a new booking but the database is okay since we can add user and room with no problem.
Here's the log.
This log lead me to the mrbs_sql.inc on the line 630 to 635
I have take a good look at the table and made a fresh install but it won't work.
Thanks for your help. Patrick
Reported by: plincourt
Original Ticket: mrbs/support-requests/1083