Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Critical Error; There was an error while processing a databse querry.  (Read 4752 times)

0 Members and 1 Guest are viewing this topic.

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9

I am using coppermine ver 1.4.18 with joomla ver; 1.0.15 using the bridge by mehdiplugins.com. everything was working well until I tried to make upload by admin to private album possible. I managed to fixed that based on a solution that I found in this forum however my batch upload start to come up with the above title error.
I am a newbie and tried to read the section asking for support in this forum and I believe I am supposed to give the site's name i.e. tongacatholicschools.com
and the test user info username; Siulolo and password is apifoou. I hope I was able to follow according to the way I should post for help in this forum. Please let me know if I can be of any further assistance to resolved this issue.

Thank you in advance for any assistance.
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #1 on: October 29, 2008, 08:38:31 am »

Just an update based on looking around in this forum http://forum.coppermine-gallery.net/index.php/topic,10409.0.html. I ran a repair querry of the php table cpg140_pictures SQL and ended with the following result'

Host: MySQLHost
Database : dxxxxxxxxxxxxx
Generation Time: Oct 28, 2008 at 11:56 PM
Generated by: phpMyAdmin 2.4.0
SQL-query: REPAIR TABLE cpg140_pictures;
Table    Op    Msg_type    Msg_text
d6xxxxxxxxxx.cpg140_pictures    repair    error    Table 'd6xxxxxxxxxx.cpg140_pictures' doesn't exist
I wonder whether to change the pictures to album on the repair querry ...just a thought as mentioned earlier I am new to this.

Please note that I have changed the database name for security reason; but willing to provide if its warrant for troubleshooting/solution

I also check the permission on my gallery directory and they are all 755 as recommended. I will keep looking but surely appreciate any help.

Thanks
Logged

Nibbler

  • Guest
Re: Critical Error; There was an error while processing a databse querry.
« Reply #2 on: October 29, 2008, 01:13:58 pm »

Enable debug mode in config and post the actual mysql error message you get when you replicate the issue.
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #3 on: October 29, 2008, 03:54:16 pm »

Thank you for responding Nibbler!

I tried to replicate the issue and the following debug show up:
Quote
USER:
------------------
Array
(
    [ID] => 45dd12c29b37ffbad1ab2d7efd8b47b4
    [am] => 1
    [lang] => english
    [liv] => Array
        (
           
  • => 298
  • [1] => 481
                [2] => 491
                [3] => 482
                [4] => 478
            )

    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
       
[user_id] => 62
    [user_name] => admin
    [groups] => Array
        (
           
  • => 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] => 10
    [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
(
   
  • => SELECT extension, mime, content, player FROM cpg1410_filetypes; (0.001s)
  • [1] => select * from cpg1410_plugins order by priority asc; (0s)
        [2] => SELECT * FROM cpg1410_bridge (0s)
        [3] => 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.003s)
        [4] => SELECT group_name FROM  cpg1410_usergroups WHERE group_id= 1 (0.01s)
        [5] => SELECT user_favpics FROM cpg1410_favpics WHERE user_id = 62 (0.001s)
        [6] => DELETE FROM cpg1410_banned WHERE expiry < '2008-10-29 14:34:38' (0.821s)
        [7] => SELECT * FROM cpg1410_banned WHERE (ip_addr='68.187.33.157' OR ip_addr='68.187.33.157' OR user_id=62) AND brute_force=0 (0.004s)
        [8] => SELECT aid, title FROM cpg1410_albums WHERE 1 (0s)
        [9] => SELECT COUNT(*) FROM cpg1410_pictures WHERE approved = 'NO' (0.002s)
        [10] => SELECT filepath, filename FROM cpg1410_pictures WHERE filepath LIKE 'BBQ Maikakalapu%' (0.01s)
        [11] => SELECT aid, title FROM cpg1410_albums WHERE category = 0 (0.725s)
        [12] => SELECT DISTINCT a.aid as aid, a.title as title, c.name as cname FROM cpg1410_albums as a, cpg1410_categories as c WHERE a.category = c.cid AND a.category < '10000' (0.002s)
        [13] => SELECT aid, IF(category > 10000, CONCAT('* ', title), CONCAT(' ', title)) AS title FROM  WHERE category = 10062 ORDER BY title (0.02s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
       
[startdir] => BBQ Maikakalapu
)

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

==========================
VERSION INFO :
------------------
PHP version: 5.2.2 - OK
------------------
mySQL version: 5.0.24a-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:
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 2
Client API version 5.0.24a
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/nf/include/mysql
MYSQL_LIBS -L/usr/local/nf/lib/mysql -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.1.3
Linked Version 1.1.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | /usr/local/php/bin | /usr/local/php/bin
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/local/nf/php5/lib/php | .:/usr/local/nf/php5/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 | 30 | 30
max_input_time | -1 | -1
upload_max_filesize | 20000000 | 20000000
post_max_size | 8M | 8M
==========================
Page generated in 2.44 seconds - 14 queries in 1.599 seconds - Album set : ; Meta set: ;

The following message shows up for the first time right under the error message "There was an error while processing a database query."for the the first time
Quote
While executing query "SELECT aid, IF(category > 10000, CONCAT('* ', title), CONCAT(' ', title)) AS title FROM  WHERE category = 10062 ORDER BY title" on 0

mySQL error:

File: /mnt/w0111/d01/s30/b01692dd/www/apifoou.com/apifoougallery/include/functions.inc.php - Line: 249 

If anything else I can be helped with please let me know.

Thank you so much.
Logged

Nibbler

  • Guest
Re: Critical Error; There was an error while processing a databse querry.
« Reply #4 on: October 29, 2008, 04:28:33 pm »

That's an error caused by your custom coding. Post what you have changed.
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #5 on: October 29, 2008, 07:55:26 pm »

Thank you for the quick response.

I did the the following modifications based on this thread; http://forum.coppermine-gallery.net/index.php/topic,26386.0.html. Specifically  on the following post;
Ok if you wish to upload to user's personal gallery here is a small mod for it. This will allow you to create an album for user as well.

Edit albmgr.php

ADD

Code: [Select]
    $query = "SELECT user_id, user_name FROM {$CONFIG['TABLE_USERS']} WHERE user_id > 1";
    $result1 = cpg_db_query($query);
    $rowset1 = cpg_db_fetch_rowset($result1);
    foreach ($rowset1 as $row1) {
      $CAT_LIST[] = array(FIRST_USER_CAT + $row1['user_id'], '*'.$row1['user_name'].'*');
    }

just after (somewhere around line 365)

Code: [Select]
    $CAT_LIST[] = array(0, $lang_albmgr_php['no_category']);
    alb_get_subcat_data(0, '');

then edit upload.php

Replace(Around line 850)

Code: [Select]
if (USER_ID) {
    $user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' ORDER BY title");

with

Code: [Select]
if (USER_ID) {
    if (GALLERY_ADMIN_MODE) {
      $user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category>'" . FIRST_USER_CAT . "' ORDER BY title");
    } else {
      $user_albums = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' ORDER BY title");
    }

HTH

Abbas

Change

Code: [Select]
$query = "SELECT user_id, user_name FROM {$CONFIG['TABLE_USERS']} WHERE user_id > 1";
to

Code: [Select]
$query = "SELECT {$cpg_udb->field['user_id']} AS user_id, {$cpg_udb->field['username']} AS user_name FROM {$cpg_udb->usertable}  WHERE {$cpg_udb->field['user_id']} > 1";
Also

Code: [Select]
$result1 = cpg_db_query($query);
to

Code: [Select]
$result1 = cpg_db_query($query, $cpg_udb->link_id);

I have been revisited the modifications to see if I can pick up anything else but I know and accept my limits that I need lots of help not only to solve this problem but to learn about this great project.

I have also attached both my upload.php & albmgr.php files in case you may need it. In the meantime I'll keep looking and learning...LOL

Thank you so much.
Logged

Nibbler

  • Guest
Re: Critical Error; There was an error while processing a databse querry.
« Reply #6 on: October 29, 2008, 08:27:07 pm »

Attach bridge/udb_base.inc.php, that's where the problem is.
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #7 on: October 29, 2008, 09:36:45 pm »

Thank you so much,

Please find the attached bridge/udb_base.inc.php file

Logged

Nibbler

  • Guest
Re: Critical Error; There was an error while processing a databse querry.
« Reply #8 on: October 29, 2008, 10:07:21 pm »

Fix this

Code: [Select]
                        $sql = "SELECT aid, IF(category > " . FIRST_USER_CAT . ", CONCAT('* ', title), CONCAT(' ', title)) AS title " . "FROM {$CONFIG['TABL

E_ALBUMS']} " . "ORDER BY title";

Make that all in one line.
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #9 on: October 29, 2008, 10:46:11 pm »

Hi Nibbler,

This is what I have done please correct me on what I have done wrong. So, steps taken are as follows.

1) Open udb_base.inc.php file
2) about line 623 fixed/change this;
Quote
$sql = "SELECT aid, IF(category > " . FIRST_USER_CAT . ", CONCAT('* ', title), CONCAT(' ', title)) AS title " . "FROM {$CONFIG['TABL
      E_ALBUMS']}WHERE category = ".(FIRST_USER_CAT+USER_ID)." ORDER BY title";

into this 
Quote
$sql = "SELECT aid, IF(category > " . FIRST_USER_CAT . ", CONCAT('* ', title), CONCAT(' ', title)) AS title " . "FROM {$CONFIG['TABL

      E_ALBUMS']} " . "ORDER BY title";
then save and upload.
3) I Cleared the cache then refresh my browser
4) Checked out the Batch add files feature to see if its fix.

Unfortunately I still end up with the same error message.

Thanks!
Logged

Nibbler

  • Guest
Re: Critical Error; There was an error while processing a databse querry.
« Reply #10 on: October 29, 2008, 10:48:04 pm »

Put it all on the same line, like this:

Code: [Select]
$sql = "SELECT aid, IF(category > " . FIRST_USER_CAT . ", CONCAT('* ', title), CONCAT(' ', title)) AS title " . "FROM {$CONFIG['TABLE_ALBUMS']} " . "ORDER BY title";
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9

Thank you so much Nibbler.

Your solution fix it and I am very grateful for that. My non profit website is once again save by the benevolent of CPG open source intiative. 

I sure appreciate the first class service which speak volume to this first class product. 

Thanks a millionsssssssssssssssss!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Critical Error; There was an error while processing a databse querry.
« Reply #12 on: October 29, 2008, 11:52:10 pm »

Thanks for returning and resolving your thread. You might consider donating a translation into Tongan ;-)
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #13 on: October 30, 2008, 12:16:12 am »

That's the least I can do is complying with the rules of this forum. Talking about donation and Tongans, from this Tongan NewBIE CPG I'll be more then happy to make a small token contribution to CPG if I could. I guess there is a  donation feature here so I can do that, otherwise please let me know.


Thanks Tongan Times ;)
Logged

lotvot

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Critical Error; There was an error while processing a databse querry.
« Reply #14 on: October 30, 2008, 12:19:28 am »

sorry I missread that message but if translation is something I can do I'll be more then happy to give it a shot. Just let me know!

Thanks again
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Critical Error; There was an error while processing a databse querry.
« Reply #15 on: October 30, 2008, 07:31:58 am »

Yes, I was indeed talking about donating a language file, i.e. creating a translation into Tongan. But don't underestimate the effort that is needed to perform a translation: coppermine is using language files, where all strings reside that need translation. That file contains 2650 lines!
If you're actually willing to translate coppermine into Tongan, please read the initial posting of the sticky announcement thread [Help wanted]: Translations for CPG1.4.x and the translator guide that comes with your copy of coppermine (available online as well: http://coppermine-gallery.net/demo/cpg14x/docs/translation.htm)
Logged
Pages: [1]   Go Up
 

Page created in 0.058 seconds with 19 queries.