Critical error Critical error
 

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

Started by Richardgm, December 10, 2006, 08:43:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Richardgm

Everyone except the admin (me) gets this error:

There was an error while processing a database query

I have no idea why, and this is recent. I tried running the update script, but nothing changed.
..Thanks in advance

Richardgm

Aparantly I can't edit that post so here's the debug report:

USER:
------------------
Array
(
    [ID] => 4a55ac0d8f7315bfe4d33db28a102435
    [am] => 1
    [lang] => english
    [liv] => Array
        (
        )

    [search] => Array
        (
            [search] => 72.27.92.47
            [album] => search
            [newer_than] =>
            [older_than] =>
            [type] => AND
            [pic_raw_ip] => on
            [params] => Array
                (
                    [pic_raw_ip] => on
                )

        )

)

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

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

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg1410_filetypes; (0.012s)
    [1] => select * from cpg1410_plugins order by priority asc; (0.001s)
    [2] => delete from `ricmi_db`.cpg1410_sessions where time<1165733047 and remember=0; (0s)
    [3] => delete from `ricmi_db`.cpg1410_sessions where time<1164527047; (0s)
    [4] => select user_id from `ricmi_db`.cpg1410_sessions where session_id=md5("b54758f70649325e4088bb1022ac190871029581c57f9e93c126222ade9b6b93"); (0.031s)
    [5] => select user_id as id, user_password as password from `ricmi_db`.cpg1410_users where user_id=1 (0.009s)
    [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 `ricmi_db`.cpg1410_users AS u INNER JOIN `ricmi_db`.cpg1410_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0.006s)
    [7] => SELECT user_group_list FROM `ricmi_db`.cpg1410_users AS u WHERE user_id='1' and user_group_list <> ''; (0.002s)
    [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 cpg1410_usergroups WHERE group_id in (1) (0.026s)
    [9] => SELECT group_name FROM  cpg1410_usergroups WHERE group_id= 1 (0.008s)
    [10] => update `ricmi_db`.cpg1410_sessions set time='1165736648' where session_id=md5('b54758f70649325e4088bb1022ac190871029581c57f9e93c126222ade9b6b93'); (0.015s)
    [11] => SELECT user_favpics FROM cpg1410_favpics WHERE user_id = 1 (0.203s)
    [12] => DELETE FROM cpg1410_mod_online WHERE last_action < NOW() - INTERVAL 10 MINUTE (0.002s)
    [13] => REPLACE INTO cpg1410_mod_online (user_id, user_name, user_ip, last_action) VALUES ('1', 'admin', '72.252.34.31', NOW()) (0.002s)
    [14] => SELECT count(*) FROM  cpg1410_pms WHERE owner=1 (0.007s)
    [15] => SELECT count(*) FROM  cpg1410_pms WHERE owner=1 AND showed='0' (0s)
    [16] => SELECT count(*) FROM  cpg1410_buddy WHERE user_id=1 (0s)
    [17] => SELECT count(*) FROM  cpg1410_buddy_req WHERE buddy_to=1 (0.001s)
    [18] => DELETE FROM cpg1410_banned WHERE expiry < '2006-12-10 02:44:08' (0.001s)
    [19] => SELECT * FROM cpg1410_banned WHERE (ip_addr='72.252.34.31' OR ip_addr='72.252.34.31' OR user_id=1) AND brute_force=0 (0.01s)
    [20] => SELECT cid, name, description, thumb FROM cpg1410_categories WHERE parent = ''  ORDER BY name (0.001s)
    [21] => SELECT aid FROM cpg1410_albums WHERE category = 3 (0.001s)
    [22] => SELECT count(*) FROM cpg1410_pictures as p, cpg1410_albums as a WHERE p.aid = a.aid AND approved='YES' AND category = 3 (0s)
    [23] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg1410_pictures WHERE pid='275' (0.002s)
    [24] => SELECT count(*) FROM cpg1410_albums as a WHERE category = '3' (0.012s)
    [25] => SELECT a.aid, a.title, a.description, visibility, filepath, filename, url_prefix, pwidth, pheight FROM cpg1410_albums as a LEFT JOIN cpg1410_pictures as p ON a.thumb=p.pid WHERE category=3 ORDER BY a.pos LIMIT 0,6 (0.013s)
    [26] => SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword FROM cpg1410_albums AS a  LEFT JOIN cpg1410_pictures AS p ON a.aid = p.aid AND p.approved =  'YES' WHERE a.aid IN (6, 5, 7, 10, 11, 12)GROUP BY a.aid (0.009s)
    [27] => SELECT cid, name, description, thumb FROM cpg1410_categories WHERE parent = '3'  ORDER BY name (0.017s)
    [28] => SELECT aid FROM cpg1410_albums as a WHERE category>=10000 (0.02s)
    [29] => SELECT count(*) FROM cpg1410_pictures as p, cpg1410_albums as a WHERE p.aid = a.aid AND approved='YES' AND category >= 10000 (0s)
    [30] => SELECT cid, name, description, thumb FROM cpg1410_categories WHERE parent = '1'  ORDER BY name (0s)
    [31] => SELECT aid FROM cpg1410_albums as a WHERE category = '0' (0.01s)
    [32] => SELECT count(*) FROM cpg1410_albums as a WHERE 1 (0.002s)
    [33] => SELECT count(*) FROM cpg1410_categories WHERE 1 (0.008s)
    [34] => SELECT count(*) FROM cpg1410_pictures as p LEFT JOIN cpg1410_albums as a ON a.aid=p.aid WHERE 1 AND approved='YES' (0s)
    [35] => SELECT sum(hits) FROM cpg1410_pictures as p LEFT JOIN cpg1410_albums as a ON p.aid=a.aid WHERE 1 (0s)
    [36] => SELECT count(*) FROM cpg1410_comments as c LEFT JOIN cpg1410_pictures as p ON c.pid=p.pid LEFT JOIN cpg1410_albums as a ON a.aid=p.aid WHERE 1 (0.009s)
    [37] => SELECT COUNT(*) FROM cpg1410_pictures WHERE approved = 'NO' (0.02s)
    [38] => SELECT count(*) FROM cpg1410_albums as a WHERE category = '0' (0.016s)
    [39] => SELECT COUNT(*) from cpg1410_pictures WHERE approved = 'YES'  (0.003s)
    [40] => SELECT * FROM cpg1410_pictures WHERE approved = 'YES'  ORDER BY RAND() LIMIT 4 (0.037s)
    [41] => SELECT count(*) from cpg1410_comments where pid=241 and msg_id!=0 (0.009s)
    [42] => SELECT count(*) from cpg1410_comments where pid=248 and msg_id!=0 (0.023s)
    [43] => SELECT count(*) from cpg1410_comments where pid=149 and msg_id!=0 (0.046s)
    [44] => SELECT count(*) from cpg1410_comments where pid=317 and msg_id!=0 (0.023s)
    [45] => SELECT COUNT(*) FROM `ricmi_db`.cpg1410_users (0.001s)
    [46] => SELECT COUNT(*) FROM cpg1410_mod_online (0s)
    [47] => SELECT COUNT(*) FROM cpg1410_mod_online WHERE user_id <> 0 (0.008s)
    [48] => SELECT user_id, user_name FROM `ricmi_db`.cpg1410_users ORDER BY user_id DESC LIMIT 1 (0.008s)
    [49] => SELECT user_id, user_name FROM cpg1410_mod_online WHERE user_id <> 0 (0.001s)
    [50] => SELECT user_id,user_lastvisit FROM `ricmi_db`.cpg1410_users WHERE user_lastvisit LIKE '2006-12-10%' (0.007s)
    [51] => SELECT user_name as user_name FROM `ricmi_db`.cpg1410_users WHERE user_id = '1' (0s)
    [52] => SELECT user_name as user_name FROM `ricmi_db`.cpg1410_users WHERE user_id = '2' (0.008s)
)

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

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

==========================
VERSION INFO :
------------------
PHP version: 4.4.0 - OK
------------------
mySQL version: 4.1.11-Debian_4sarge5
------------------
Coppermine version: 1.4.10 modpack v1(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 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
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 3.23.56
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.1.1
Linked Version 1.2.1.1
==========================
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/local/lib/php | .:/usr/local/lib/php
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | me@localhost.com | me@localhost.com
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 | 30 | 30
max_input_time | -1 | -1
upload_max_filesize | 10M | 10M
post_max_size | 8M | 8M
==========================
Page generated in 0.763 seconds - 53 queries in 0.65 seconds - Album set : ; Meta set: ;

Nibbler

Post the actual error message.

Richardgm

That is it:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fjamaicacollege.org%2FRichard%2Ferror.JPG&hash=0eeb76b2ff403074fa71b61d152cf5e0455912ca)

:-\

Richardgm

Oh sorry:

While executing query "INSERT INTO cpg1410_hit_stats
                          SET
                            pid = 217,
                            search_phrase = '',
                            Ip   = '72.252.34.31',
                            sdate = '1165775727',
                            referer='http%3A%2F%2Fpictures.jamaicacollege.org%2Findex.php',
                            browser = 'Unknown',
                            os = 'Windows XP'" on 0

mySQL error: Unknown column 'Ip' in 'field list'

Nibbler

Check the table using phpmyadmin and make sure the `ip` field exists. If you don't need hit stats then just disable them.

Richardgm

Ok, I did delete both the Ip field and browser field because I thought I didn't need that info, so I re added it, and voila! things seem to be working again. What can I do so that CPG doesn't log or NEED that info? I want stats, just not those.

Thanks for your reply.

Nibbler

It would have been useful had you said that to begin with...

If you want to remove it then modify the add_hit() function (include/functions.inc.php)


        // Insert the record in database
        $query = "INSERT INTO {$CONFIG['TABLE_HIT_STATS']}
                          SET
                            pid = $pid,
                            search_phrase = '$query_term',
                            Ip   = '$raw_ip',
                            sdate = '$time',
                            referer='$referer',
                            browser = '$browser',
                            os = '$os'";

Richardgm