Critical Error on main table Critical Error on main table
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Critical Error on main table

Started by stardust, October 09, 2008, 09:52:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stardust

Gallery link: http://www.itvxq.net/

"Critical error
There was an error while processing a database query  "'

Usually when I get database errors, the whole gallery is affected, but it seems like it's just the main category table that is affected. Pictures are still viewable through Last Comments (click on a picture, then a subcategory in "breadcrumb" links) but for some reason the main categories aren't working.

I tried searching the forum but I can't find anything on this, so how can I fix it?

stardust

Also, I haven't uploaded or updated anything with the gallery at all today; the last time I updated was 2 AM yesterday (uploading pictures) but the site was working fine all day yesterday. I honestly don't know how this problem occurred.

Joachim Müller

Enabled debug mode in coppermine's config to see the actual query that fails. If you can't access coppermine's config due to the error, manually enable debug_mode as suggested in the tutorial http://coppermine-gallery.net/tutorial/debug_mode.php
Has been asked and answered many times over - I find it hard to believe that you haven't found a similar answer to a similar question when searching the board for your issue.

stardust

Sorry, I've seen many critical error threads but they didn't seem like mine.

Here is what I got when I enabled the debug mode:
QuoteWhile executing query "SELECT *, UNIX_TIMESTAMP(mtime) as mtime FROM cpg14x_pictures WHERE approved = 'YES' and hits > 0  ORDER BY mtime DESC  LIMIT 0 ,8" on 0

mySQL error: Table 'cpg14x_pictures' is marked as crashed and should be repaired
How can I repair the table?

Here is the debug info:
USER:
------------------
Array
(
    [ID] => 366caf446ae7643131abc9ec8f3c5288
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 20686
            [1] => 20685
            [2] => 20684
            [3] => 11704
            [4] => 20636
        )

    [search] => Array
        (
            [search] => earring
            [params] => Array
                (
                    [filename] => 1
                    [keywords] => 1
                    [caption] => 1
                    [title] => 1
                )

        )

    [lap] => 2
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => Admin
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 0
    [can_send_ecards] => 0
    [ufc_max] => 1
    [ufc_min] => 1
    [custom_user_upload] => 0
    [num_file_upload] => 10
    [num_URI_upload] => 0
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 0
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 1
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg14x_filetypes; (0s)
    [1] => select * from cpg14x_plugins order by priority asc; (0s)
    [2] => delete from `itvxqnet_cpg`.cpg14x_sessions where time<1223645357 and remember=0; (0.002s)
    [3] => delete from `itvxqnet_cpg`.cpg14x_sessions where time<1222439357; (0.001s)
    [4] => select user_id from `itvxqnet_cpg`.cpg14x_sessions where session_id = 'f1ef8dfd8c30d0d7acf77f0fec4232e2' (0s)
    [5] => select user_id as id, user_password as password from `itvxqnet_cpg`.cpg14x_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.avatar_url AS avatar_url, u.enable_admin_email AS notify, u.auto_subscribe_post AS auto_subscribe_post, u.auto_subscribe_comment AS auto_subscribe_comment, u.user_group+100 AS group_id FROM `itvxqnet_cpg`.cpg14x_users AS u INNER JOIN `itvxqnet_cpg`.cpg14x_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `itvxqnet_cpg`.cpg14x_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg14x_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg14x_usergroups WHERE group_id= 1 (0s)
    [10] => update `itvxqnet_cpg`.cpg14x_sessions set time='1223648957' where session_id = 'f1ef8dfd8c30d0d7acf77f0fec4232e2' (0s)
    [11] => SELECT user_favpics FROM cpg14x_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg14x_mod_online WHERE last_action < NOW() - INTERVAL 10 MINUTE (0s)
    [13] => REPLACE INTO cpg14x_mod_online (user_id, user_name, user_ip, last_action) VALUES ('1', 'Admin', '65.182.62.141', NOW()) (0s)
    [14] => SHOW TABLES LIKE 'cpg14x_cms_config' (0s)
    [15] => SELECT * FROM cpg14x_cms_config (0s)
    [16] => SELECT count(*) FROM  cpg14x_pms WHERE owner=1 (0s)
    [17] => SELECT count(*) FROM  cpg14x_pms WHERE owner=1 AND showed='0' (0s)
    [18] => SELECT count(*) FROM  cpg14x_buddy WHERE user_id=1 (0s)
    [19] => SELECT count(*) FROM  cpg14x_buddy_req WHERE buddy_to=1 (0s)
    [20] => DELETE FROM cpg14x_banned WHERE expiry < '2008-10-10 10:29:17' (0s)
    [21] => SELECT * FROM cpg14x_banned WHERE (ip_addr='65.182.62.141' OR ip_addr='65.182.62.141' OR user_id=1) AND brute_force=0 (0s)
    [22] => SELECT cid, name, description, thumb FROM cpg14x_categories WHERE parent = ''  ORDER BY pos (0s)
    [23] => SELECT aid FROM cpg14x_albums as a WHERE category>=10000 (0s)
    [24] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category >= 10000 (0s)
    [25] => SELECT aid FROM cpg14x_albums WHERE category = 3 (0s)
    [26] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 3 (0s)
    [27] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '3' (0s)
    [28] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=3 ORDER BY a.pos LIMIT 0,1 (0s)
    [29] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (161)GROUP BY a.aid (0s)
    [30] => SELECT aid FROM cpg14x_albums WHERE category = 24 (0s)
    [31] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 24 (0s)
    [32] => SELECT aid FROM cpg14x_albums WHERE category = 4 (0s)
    [33] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 4 (0s)
    [34] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '4' (0s)
    [35] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=4 ORDER BY a.pos LIMIT 0,1 (0s)
    [36] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (261)GROUP BY a.aid (0s)
    [37] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='4344' (0s)
    [38] => SELECT aid FROM cpg14x_albums WHERE category = 6 (0s)
    [39] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 6 (0s)
    [40] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '6' (0s)
    [41] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=6 ORDER BY a.pos LIMIT 0,1 (0s)
    [42] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (260)GROUP BY a.aid (0s)
    [43] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='4351' (0s)
    [44] => SELECT aid FROM cpg14x_albums WHERE category = 5 (0s)
    [45] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 5 (0s)
    [46] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '5' (0s)
    [47] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=5 ORDER BY a.pos LIMIT 0,1 (0s)
    [48] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (519)GROUP BY a.aid (0s)
    [49] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='10650' (0s)
    [50] => SELECT aid FROM cpg14x_albums WHERE category = 2 (0s)
    [51] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 2 (0s)
    [52] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '2' (0s)
    [53] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=2 ORDER BY a.pos LIMIT 0,7 (0s)
    [54] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (377, 249, 528, 376, 756, 730, 591)GROUP BY a.aid (0.002s)
    [55] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='6769' (0s)
    [56] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='4628' (0s)
    [57] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='19561' (0s)
    [58] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='6600' (0s)
    [59] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='16850' (0s)
    [60] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='16336' (0s)
    [61] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='13031' (0s)
    [62] => SELECT aid FROM cpg14x_albums WHERE category = 30 (0s)
    [63] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 30 (0s)
    [64] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '30' (0s)
    [65] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=30 ORDER BY a.pos LIMIT 0,8 (0s)
    [66] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (313, 370, 1011, 489, 688, 408, 382, 314)GROUP BY a.aid (0.002s)
    [67] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='5658' (0s)
    [68] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='13208' (0s)
    [69] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='20127' (0s)
    [70] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='10180' (0s)
    [71] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='15176' (0s)
    [72] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='19501' (0s)
    [73] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='6883' (0s)
    [74] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='5661' (0s)
    [75] => SELECT aid FROM cpg14x_albums WHERE category = 78 (0s)
    [76] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 78 (0s)
    [77] => SELECT aid FROM cpg14x_albums WHERE category = 10 (0s)
    [78] => SELECT count(*) FROM cpg14x_pictures as p, cpg14x_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 10 (0s)
    [79] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '10' (0s)
    [80] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_albums as a LEFT JOIN cpg14x_pictures as p ON a.thumb=p.pid WHERE category=10 ORDER BY a.pos LIMIT 0,6 (0s)
    [81] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg14x_albums AS a  LEFT JOIN cpg14x_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (694, 574, 753, 800, 777, 957)GROUP BY a.aid (0.001s)
    [82] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='17529' (0s)
    [83] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='16281' (0s)
    [84] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='17245' (0s)
    [85] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='16911' (0s)
    [86] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg14x_pictures WHERE pid='18903' (0s)
    [87] => SELECT aid FROM cpg14x_albums as a WHERE category = '0' (0s)
    [88] => SELECT count(*) FROM cpg14x_albums as a WHERE 1 (0s)
    [89] => SELECT count(*) FROM cpg14x_categories WHERE 1 (0s)
    [90] => SELECT count(*) FROM cpg14x_pictures as p LEFT JOIN cpg14x_albums as a ON a.aid=p.aid WHERE 1 AND approved='YES' (0.017s)
    [91] => SELECT sum(hits) FROM cpg14x_pictures as p LEFT JOIN cpg14x_albums as a ON p.aid=a.aid WHERE 1 (0.056s)
    [92] => SELECT count(*) FROM cpg14x_comments as c LEFT JOIN cpg14x_pictures as p ON c.pid=p.pid LEFT JOIN cpg14x_albums as a ON a.aid=p.aid WHERE 1 (0.01s)
    [93] => SELECT COUNT(*) FROM cpg14x_pictures WHERE approved = 'NO' (0s)
    [94] => SELECT * FROM cpg14x_cms WHERE conid='0' AND type='0' ORDER BY cpos (0s)
    [95] => SELECT count(cpg14x_albums.aid) FROM cpg14x_pictures,cpg14x_albums WHERE cpg14x_pictures.aid = cpg14x_albums.aid AND approved = 'YES'  GROUP  BY cpg14x_pictures.aid (0.027s)
    [96] => SELECT *,cpg14x_albums.title AS title,cpg14x_albums.aid AS aid FROM cpg14x_pictures,cpg14x_albums WHERE cpg14x_pictures.aid = cpg14x_albums.aid AND approved = 'YES'  GROUP BY cpg14x_pictures.aid ORDER BY cpg14x_pictures.ctime DESC  LIMIT 0 ,8 (0.199s)
    [97] => SELECT count(*) FROM cpg14x_albums as a WHERE category = '0' (0s)
    [98] => SELECT COUNT(*) from cpg14x_pictures WHERE approved = 'YES'  (0.011s)
    [99] => SELECT * FROM cpg14x_pictures WHERE approved = 'YES'  ORDER BY pid DESC  LIMIT 0 ,8 (0s)
    [100] => SELECT COUNT(*) from cpg14x_pictures WHERE approved = 'YES' and hits > 0  (0.054s)
    [101] => SELECT *, UNIX_TIMESTAMP(mtime) as mtime FROM cpg14x_pictures WHERE approved = 'YES' and hits > 0  ORDER BY mtime DESC  LIMIT 0 ,8 (0.055s)
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 5.2.6 - OK
------------------
mySQL version: 5.0.45-community-log
------------------
Coppermine version: 1.4.18(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.34 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 5.0.45
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib64 -lmysqlclient_r 
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.1.2
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 90 | 90
max_input_time | 90 | 90
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.628 seconds - 102 queries in 0.437 seconds - Album set : ; Meta set: ;