HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[SOLVED] Broken MySQL database table

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#104913 (In Topic #20466)
Avatar

Well-settled

Greetings,

I just now experienced the following Critical Bail-out error on my Chat Lobby page, on attempting to start an IM conversation:

Critical error – bailing out

This is an error that has been elevated to critical error status because it occurred during the primary error mechanism reporting system itself (possibly due to it occuring within the standard output framework). It may be masking a secondary error that occurred before this, but was never output - if so, it is likely strongly related to this one, thus fixing this will fix the other.
Unfortunately a query has failed [SELECT DISTINCT member_id FROM oc_chat_active a LEFT JOIN oc_sessions s ON s.the_user=a.member_id WHERE (session_invisible=0 OR session_invisible IS NULL) AND date_and_time>=1412625386 AND room_id IS NULL] [Table './under283_ocpo872/oc_chat_active' is marked as crashed and should be repaired] (version: 9.0.9, PHP version: 5.3.28, URL: /ocportal/site/pg/chat/misc)

Stack trace…

File -> '/home/under283/public_html/ocportal/sources/failure.php'
Line -> 796
Function -> 'die_html_trace'
Args -> array

File -> '/home/under283/public_html/ocportal/sources/global2.php'
Line -> 1042
Function -> '_fatal_exit'
Args -> array

File -> '/home/under283/public_html/ocportal/sources/database/mysql.php'
Line -> 253
Function -> 'fatal_exit'
Args -> array

File -> '/home/under283/public_html/ocportal/sources/database.php'
Line -> 1127
Function -> 'db_query'
Class -> 'Database_Static_mysql'
Object -> Database_Static_mysql::__set_state(array( ))
Type -> '->'
Args -> array

File -> '/home/under283/public_html/ocportal/sources/database.php'
Line -> 951
Function -> '_query'
Class -> 'database_driver'
Object -> database_driver::__set_state(array( 'table_prefix' => 'oc_', 'connection_read' => array ( 0 => NULL, 1 => 'under283_ocpo872', ), 'connection_write' => array ( 0 => NULL, 1 => 'under283_ocpo872', ), 'text_lookup_original_cache' => array ( 9 => 'Site', 4 => '', 72 => '', 73 => '', 34 => 'Administrators', 35 => 'UPT.com Core Team', ), 'text_lookup_cache' => array ( 9 => '', 4 => '', 72 => 'return unserialize("a:6:{i:0;a:1:{i:0;a:5:{i:0;s:37:\"string_attach_5432a70f2b96e5.73857400\";i:1;a:0:{}i:2;i:1;i:3;s:0:\"\";i:4;s:0:\"\";}}i:1;a:0:{}i:2;s:10:\":container\";i:3;N;i:4;N;i:5;s:66:\"\$TPL_FUNCS[\'string_attach_5432a70f2b96e5.73857400\']=\"echo \\\"\\\";\";\n\";}"); ', 73 => '', 34 => '', 35 => '', ), 'table_exists_cache' => array ( ), 'static_ob' => Database_Static_mysql::__set_state(array( )), 'dedupe_mode' => false, ))
Type -> '->'
Args -> array ( 0 => 'SELECT DISTINCT member_id FROM oc_chat_active a LEFT JOIN oc_sessions s ON s.the_user=a.member_id WHERE (session_invisible=0 OR session_invisible IS NULL) AND date_and_time>=1412625386 AND room_id IS NULL', 1 => NULL, 2 => NULL, 3 => false, 4 => false, 5 => NULL, 6 => '', )

File -> '/home/under283/public_html/ocportal/sources/chat.php'
Line -> 970
Function -> 'query'
Class -> 'database_driver'
Object -> database_driver::__set_state(array( 'table_prefix' => 'oc_', 'connection_read' => array ( 0 => NULL, 1 => 'under283_ocpo872', ), 'connection_write' => array ( 0 => NULL, 1 => 'under283_ocpo872', ), 'text_lookup_original_cache' => array ( 9 => 'Site', 4 => '', 72 => '', 73 => '', 34 => 'Administrators', 35 => 'UPT.com Core Team', ), 'text_lookup_cache' => array ( 9 => '', 4 => '', 72 => 'return unserialize("a:6:{i:0;a:1:{i:0;a:5:{i:0;s:37:\"string_attach_5432a70f2b96e5.73857400\";i:1;a:0:{}i:2;i:1;i:3;s:0:\"\";i:4;s:0:\"\";}}i:1;a:0:{}i:2;s:10:\":container\";i:3;N;i:4;N;i:5;s:66:\"\$TPL_FUNCS[\'string_attach_5432a70f2b96e5.73857400\']=\"echo \\\"\\\";\";\n\";}"); ', 73 => '', 34 => '', 35 => '', ), 'table_exists_cache' => array ( ), 'static_ob' => Database_Static_mysql::__set_state(array( )), 'dedupe_mode' => false, ))
Type -> '->'
Args -> array ( 0 => 'SELECT DISTINCT member_id FROM oc_chat_active a LEFT JOIN oc_sessions s ON s.the_user=a.member_id WHERE (session_invisible=0 OR session_invisible IS NULL) AND date_and_time>=1412625386 AND room_id IS NULL', )

File -> '/home/under283/public_html/ocportal/sources/chat.php'
Line -> 942
Function -> 'get_chatters_in_room'
Args -> array ( 0 => NULL, )

File -> '/home/under283/public_html/ocportal/site/pages/modules/chat.php'
Line -> 429
Function -> 'enter_chat_lobby'
Args -> array ( )

File -> '/home/under283/public_html/ocportal/site/pages/modules/chat.php'
Line -> 372
Function -> 'chat_lobby'
Class -> 'Module_chat'
Object -> Module_chat::__set_state(array( ))
Type -> '->'
Args -> array ( )

File -> '/home/under283/public_html/ocportal/sources/zones.php'
Line -> 425
Function -> 'run'
Class -> 'Module_chat'
Object -> Module_chat::__set_state(array( ))
Type -> '->'
Args -> array ( )

File -> '/home/under283/public_html/ocportal/sources/site.php'
Line -> 861
Function -> 'load_module_page'
Args -> array ( 0 => 'site/pages/modules/chat.php', 1 => 'chat', )

File -> '/home/under283/public_html/ocportal/sources/site.php'
Line -> 646
Function -> 'request_page'
Args -> array ( 0 => 'chat', 1 => true, )

File -> '/home/under283/public_html/ocportal/site/index.php'
Line -> 39
Function -> 'do_site'
Args -> array ( )

Through PhpMyAdmin I see the indexes for the table ocf_chat_active have vanished. Under the "Operations" tab the options for proceeding with repairing it are "Empty the table (TRUNCATE)" or "Delete the table (DROP)".

Sadly, I'm completely unversed in database know-how, and so am at a loss as to how to proceed, and how to get everything back working. (For example, if I were to drop the table, would ocPortal auto-generate a working replacement?) Please can anybody advise me? 

Thanks in anticipation!
Back to the top
 
Posted
Rating:
#104917
Avatar

Community saint

Before doing anything else, you might want to export that table if phpmyadmin will allow you to. After backing up the table, select your database, and go to the SQL tab. Delete the code in the SQL query box and enter this:

REPAIR TABLE `ocp_chat_active`

See if that works.
Back to the top
 
Posted
Rating:
#104919
Avatar

Well-settled

Hi Jason and many thanks!

Please can you advise - should I opt for "Quick" export or "Custom" export, and am I right in assuming the export should be in MySQL format for easiest re-application?

Kind regards,

Richard
Back to the top
 
Posted
Rating:
#104920
Avatar

Community saint

The Quick option and SQL format should be adequate.
Back to the top
 
Posted
Rating:
#104921
Avatar

Well-settled

Great, very many thanks, Jason! 

Everything's fixed now and back in working order. After going ahead and exporting in both ways, I discovered that, by selecting the entire database, there's a dropdown at the foot of the page that includes a "Repair table" command that can be applied to individually selected tables. Worked a treat!

Really grateful for your help, Jason.

Good wishes,

Richard
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: