Critical Fault when get back to index Critical Fault when get back to index
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Critical Fault when get back to index

Started by aemer, March 01, 2004, 09:49:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aemer

Well i came along a new problem. I made categories on my main page "www.bigpartypics.ch/cpg".

The problem is: when i click on an album, everything is fine and i can browse pics. but when i click on "alben-übersicht" which is albums overview, it shoud show the index (/cpg) but i get an critical error "There was an error while processing a database query". and ist shows me "http://bigpartypics.ch/cpg/index.php?cat=6" in the address line of internet explorer. Any solution?

Very appreciated, thx!

Joachim Müller

when encountering a error saying
QuoteThere was an error while processing a database query
, you should enable debug mode (in coppermine config at the very bottom) and check the additional output (it will tell you on which query the error occured).

GauGau

aemer

hey thx for the quick answer gaugau. when i activate debug mode i get a whole load of stuff.. bud sadly i dont understand it.. the error which i described is this:

While executing query "SELECT c.pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, msg_id, author_id, msg_author, UNIX_TIMESTAMP(msg_date) as msg_date, msg_body, aid FROM cpg11d_comments as c, cpg11d_pictures as p WHERE approved = 'YES' AND c.pid = p.pid AND cpg11d_pictures.aid IN (15,13,14,16)  ORDER by msg_id DESC  LIMIT 0 ,4" on 0

mySQL error: Unknown table 'cpg11d_pictures' in where clause

and its in this file:Datei: ...cpg/include/functions.inc.php - Zeile: 105


but on every page i get some errors(which i guess didnt affect the functionality yet) for example on the index page i get this:
Notice: Undefined offset: 2 in /home/www/web409/html/cpg/index.php on line 555

Notice: Undefined index: user_id in /home/www/web409/html/cpg/include/functions.inc.php on line 772

Notice: Undefined index: user_id in /home/www/web409/html/cpg/include/functions.inc.php on line 772

Notice: Undefined index: user_id in /home/www/web409/html/cpg/include/functions.inc.php on line 772

Notice: Undefined index: user_id in /home/www/web409/html/cpg/include/functions.inc.php on line 772


is this an important error?

Thanks for help!

Joachim Müller

ignore the notices, only the warnings and errors are relevant. Where do you have this code from? Did you modify anything in /include/functions.inc.php? Doesn't look very familiar to me...
Maybe you could a fresh copy of the file and overwrite the existing one on the server, just to be sure.

GauGau

aemer

hm strange. well i followed your hint and i downloaded coppermine again, and overwrote the functions.inc.php on my server. still get the same error... it has sumting to do that it doesnt redirect correctly. i guess i got this problem since i use categories! it sould diredt me to index.php i guess (at least this would work) but as said it directs me to index.php?cat=6 and i dunno where that cat=6 cames form and for what it sould be..

i played a liltte and found out if i click on an album in antother categorie it rederiects me to like index.php?cat=4 so i really guess this is a problem with the categories.

you know what the problem is? or you need any more infos? i hope you can help, thank you very much!

Casper

The cats are correct.  The 'album list' link from the album page takes you to the category page which that album is in.

Try uploading a fresh copy of displayimage.php and thumbnails.php. as one of these may have become corrupted.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

aemer

i followed your odrder casper but this dint help, still same problem :( any other suggestions please?!

aemer

i found sumthing out that maybe helps...

the link just doesnt work when its for example called :

http://www.bigpartypics.ch/cpg/index.php?cat=6

but when you write sumthing else than cat, for ex

http://www.bigpartypics.ch/cpg/index.php?anything=6

it works again. is this maybe a problem with the languaga? (that i use german and not english) or is it just a code problem? would be great if there was a solution.. otherwise i guess i have to take out categories which would pretty suck cuz i like them.

btw. does anybody else get thsi problem or is it just me?

thx

Casper

This is not caused by your language file, or your theme, I tried and it does not work in default theme or english language.

I think it may be a problem with your categories table.  Use your database tool, such as phpMyAdmin, to check the table.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

aemer

Hi guys

Found the error in the sql statement above:

This:
AND c.pid = p.pid AND cpg11d_pictures.aid IN (15,13,14,16)  ORDER by

should read like this
AND c.pid = p.pid AND p.aid IN (15,13,14,16)  ORDER by

Then it works (controlled in phpMyAdmin).

Any hints where this statement is hidden in the coppermine code. Can't find it.

THX

aemer

doesnt anybody got an answer? its pretty important!! Thanks!

aemer

hey im sorry to post again, but i didnt get an answer on this for a looong time.. cant anybody help me please? i would be so thankful!

Joachim Müller

queries are built dynamically in coppermine, that's why you can't do a search for the query in the coppermine code. You'll have to give us a hint on what exact page the query exists (deep link).

GauGau

P.S. If you haven't got an answer after some days to your question, you should reply *bump*.

aemer

hm well i dunno exactly what you mean with deep link but i try to give you as much information as i can (if you need to know more, im better in talkin german ;)) well the error occurs every time im in an album and wanna go back to index. if you click on any album on http://bigpartypics.ch/cpg/ and then wanna go back to index (alben übersicht) it gives a wrong url like (http://bigpartypics.ch/cpg/index.php?cat=7) well the (cat=7) doesnt work. if you write like (kat=7) or (anything) it works. so there there just souldnt stand cat=7.

so when im in an album and wanna go back to index over (albem übersicht) i get this error :

QuoteWhile executing query "SELECT c.pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, msg_id, author_id, msg_author, UNIX_TIMESTAMP(msg_date) as msg_date, msg_body, aid FROM cpg11d_comments as c, cpg11d_pictures as p WHERE approved = 'YES' AND c.pid = p.pid AND cpg11d_pictures.aid IN (17,18)  ORDER by msg_id DESC  LIMIT 0 ,4" on 0
in this Datei: /home/www/web409/html/cpg/include/functions.inc.php - Zeile: 105

line 105 in my functions.inc.php reads like this :
cpg_die(CRITICAL_ERROR, $out, __FILE__, __LINE__);

debug info reads like this:USER:
Array
(
    [ID] => d334b713eba57e5e1ee88f56324e83a8
    [am] => 1
    [liv] => Array
        (
            [0] => 601
            [1] => 386
        )

)

 
 
USER DATA:
Array
(
    [0] => 2
    [user_id] => 2
    [1] => admin
    [user_name] => admin
    [2] => 1
    [user_level] => 1
    [group_quota] => 0
    [can_rate_pictures] => 3
    [can_send_ecards] => 3
    [can_post_comments] => 3
    [can_upload_pictures] => 1
    [can_create_albums] => 2
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
)

 
 
Queries:
Array
(
    [0] => SELECT user_id, username as user_name, user_level FROM `usr_web409_4`.phpbb_users WHERE user_id='2' AND user_password='9094a8358ac47c1d4a3d6b32bc057c9a'
    [1] => SELECT (ug.group_id + 5) as group_id FROM `usr_web409_4`.phpbb_user_group as ug LEFT JOIN `usr_web409_4`.phpbb_groups as g ON ug.group_id = g.group_id WHERE user_id = 2 AND user_pending = 0 AND group_single_user = 0
    [2] => SELECT  group_quota as gq,                 can_rate_pictures as crp,                 can_send_ecards as cse,                 can_post_comments as cpc,                 can_upload_pictures as cup,                 can_create_albums as cca,                 pub_upl_need_approval as puna,                 priv_upl_need_approval as pruna FROM cpg11d_usergroups WHERE group_id IN (1,2,8)
    [3] => DELETE FROM cpg11d_banned WHERE expiry < 1080982752
    [4] => SELECT * FROM cpg11d_banned WHERE ip_addr='81.62.183.74' OR ip_addr='81.62.183.74' OR user_id=2
    [5] => SELECT name, parent FROM cpg11d_categories WHERE cid = '7'
    [6] => SELECT cid, name, description FROM cpg11d_categories WHERE parent = '7'  ORDER BY pos
    [7] => SELECT aid FROM cpg11d_albums WHERE category = '7'
    [8] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND cpg11d_pictures.aid IN (17,18)
    [9] => SELECT *,cpg11d_albums.title AS title,cpg11d_albums.aid AS aid  FROM cpg11d_pictures,cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND approved = 'YES' AND cpg11d_pictures.aid IN (17,18)  GROUP  BY cpg11d_pictures.aid ORDER BY cpg11d_pictures.ctime DESC  LIMIT 0 ,4
    [10] => SELECT count(*) FROM cpg11d_albums WHERE category = '7'
    [11] => SELECT a.aid, a.title, a.description, visibility, filepath,                 filename, url_prefix, pwidth, pheight FROM cpg11d_albums as a LEFT JOIN cpg11d_pictures as p ON thumb=pid WHERE category = '7' ORDER BY mtime LIMIT 0,2
    [12] => SELECT aid, count(pid) as pic_count, max(pid) as last_pid, max(ctime) as last_upload FROM cpg11d_pictures WHERE aid IN (17, 18) AND approved = 'YES' GROUP BY aid
    [13] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg11d_pictures WHERE pid='649'
    [14] => SELECT COUNT(*) from cpg11d_comments, cpg11d_pictures  WHERE approved = 'YES' AND cpg11d_comments.pid = cpg11d_pictures.pid AND cpg11d_pictures.aid IN (17,18)
    [15] => SELECT c.pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, msg_id, author_id, msg_author, UNIX_TIMESTAMP(msg_date) as msg_date, msg_body, aid FROM cpg11d_comments as c, cpg11d_pictures as p WHERE approved = 'YES' AND c.pid = p.pid AND cpg11d_pictures.aid IN (17,18)  ORDER by msg_id DESC  LIMIT 0 ,4
)

 
GET :
Array
(
    [cat] => 7
)

 
POST :
Array
(
)
 



does this help you or do you need any other information?

thank you very much!!

Joachim Müller

ah, I see. I think there have been reports on this happening, but I don't recall the thread or the answer how to solve this. Maybe a search on this board might help.

You might also want to consider to upgrade to cpg1.3.0, which is still in beta status, but at least the front-end your users will see should be pretty stable and safe to use (backup your data before of course).

GauGau