[SOLVED] An error has occurred while interacting with the database...

putee

Joined: 2010-02-11
Posts: 9
Posted: Fri, 2010-02-12 10:54

Hello All,

I've been running gallery2 for years. My server's hardware was upgraded few months ago and recently I was not able to access anything --> following error appeared:
An error has occurred while interacting with the database.

the URL to my Gallery: http://www.puterakembara.org/gallery2/main.php
the version of Gallery: version 2.1 blackjack
the version of PHP: 5.2.2
the version of Apache: Apache/2.0.52 (Red Hat)
operating system and hardware: Linux puterakembara.org 2.6.9-89.0.20.EL.JLsmp #1 SMP Tue Feb 2 17:26:16 EST 2010 i686 DELL server
web browser and version : Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5
mysql : 5.0.67

I've tried changing "mysqlt" or "mysqli" in config.php without success.the default was "mysql"

* Can anyone help me howto debug this error
* Whether I have dbase corrupt or not?
* Best solution to fix problem
* Will upgrading gallery2 to latest version will help solving the problem???

Thank you in advance,

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2010-02-12 11:51

Put your gallery in debug mode and post the stack trace.
FAQ: How to set/use Gallery in debug mode?

 
putee

Joined: 2010-02-11
Posts: 9
Posted: Fri, 2010-02-12 12:34

Thanks alecmyers,

here below the debug output - does not look good - any idea how to fix the problem?

=======================================================================================

Debug Output

file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../config.php) file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../plugins/index.modules) file_exists(/var/www/html/gallery2/g2data2/cache/module/_all/0/0/GalleryFactoryHelper_loadRegistry.inc) Unimplemented: GalleryUrlGenerator getParameter language.useBrowserPref for core plugin file_exists(/var/www/html/gallery2/g2data2/cache/module/core/0/0/0.inc) Warning: Unable to select locale en_GB controller , view Loading plugin core Class not defined, trying to include it. file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../modules/core/module.inc) core plugin successfully instantiated file_exists(/var/www/html/gallery2/g2data2/versions.dat) file(/var/www/html/gallery2/g2data2/versions.dat, ) getParameter id.anonymousUser for core plugin [1265977488] can't guarantee 5 -- extending! file_exists(/var/www/html/gallery2/g2data2/cache/entity/0/0/5.inc) Loading plugin core core plugin successfully instantiated Check the version of the core plugin file_exists(/var/www/html/gallery2/g2data2/cache/module/_all/0/0/GalleryPluginHelper_fetchPluginStatus.inc) The version of the core plugin is ok file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../modules/core/ShowItem.inc) getParameter acceleration for core plugin getParameter id.anonymousUser for core plugin getParameter id.anonymousUser for core plugin getParameter id.adminGroup for core plugin
(mysqlt): SET NAMES "utf8"
(mysqlt): SELECT g2_UserGroupMap.g_userId FROM g2_UserGroupMap WHERE g2_UserGroupMap.g_userId = 5 AND g2_UserGroupMap.g_groupId = 3 LIMIT 1
file_exists(/var/www/html/gallery2/g2data2/cache/entity/3/0/3068.inc) file_exists(/var/www/html/gallery2/g2data2/cache/entity/3/0/3066.inc) getParameter default.theme for core plugin Loading plugin matrix Class not defined, trying to include it. file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../config.php) file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../plugins/index.themes) file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../themes/matrix/theme.inc) matrix plugin successfully instantiated Check the version of the matrix plugin file_exists(/var/www/html/gallery2/g2data2/cache/theme/_all/0/0/GalleryPluginHelper_fetchPluginStatus.inc) The version of the matrix plugin is ok file_exists(/var/www/html/gallery2/g2data2/cache/theme/matrix/0/0/0.inc) file_exists(/var/www/html/gallery2/g2data2/cache/theme/matrix/3/0/3066.inc)
(mysqlt): SELECT g2_Group.g_id, g2_Group.g_groupName FROM g2_UserGroupMap, g2_Group WHERE g2_Group.g_id = g2_UserGroupMap.g_groupId AND g2_UserGroupMap.g_userId = 5 ORDER BY g2_Group.g_groupName LIMIT 18446744073709551615
(mysqlt): SELECT g2_PermissionSetMap.g_module, g2_PermissionSetMap.g_permission, g2_PermissionSetMap.g_description, g2_PermissionSetMap.g_bits, g2_PermissionSetMap.g_flags FROM g2_PermissionSetMap
realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_core -> /var/www/html/gallery2/modules/core/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_comment -> /var/www/html/gallery2/modules/comment/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_cart -> /var/www/html/gallery2/modules/cart/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_fotokasten -> /var/www/html/gallery2/modules/fotokasten/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_photoaccess -> /var/www/html/gallery2/modules/photoaccess/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_rating -> /var/www/html/gallery2/modules/rating/locale realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: modules_shutterfly -> /var/www/html/gallery2/modules/shutterfly/locale
(mysqlt): SELECT DISTINCT g2_AccessMap.g_accessListId FROM g2_AccessMap WHERE g2_AccessMap.g_userOrGroupId IN (5,4) AND g2_AccessMap.g_permission & 1 = 1
(mysqlt): SELECT g2_AccessSubscriberMap.g_itemId FROM g2_AccessSubscriberMap WHERE g2_AccessSubscriberMap.g_itemId = 3068 AND g2_AccessSubscriberMap.g_accessListId IN (635,2946,2959,3061,3067,3087,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221) LIMIT 1
file_exists(/var/www/html/gallery2/modules/core/classes/../../../themes/local/matrix) getParameter misc.markup for core plugin file_exists(/var/www/html/gallery2/modules/core/Preloads.inc) file_exists(/var/www/html/gallery2/modules/search/Preloads.inc) file_exists(/var/www/html/gallery2/modules/albumselect/Preloads.inc) file_exists(/var/www/html/gallery2/modules/exif/Preloads.inc) file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../modules/icons/classes/IconsImpl.class) getParameter iconpack for icons plugin file_exists(/var/www/html/gallery2/g2data2/cache/module/icons/0/0/0.inc) file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../modules/colorpack/classes/ColorPackImpl.class) getParameter acceleration for core plugin getParameter id.anonymousUser for core plugin getParameter acceleration for core plugin getParameter id.anonymousUser for core plugin mysqlt error: [145: Table './gallery/g2_CacheMap' is marked as crashed and should be repaired] in EXECUTE(" SELECT g2_CacheMap.g_value FROM g2_CacheMap WHERE g2_CacheMap.g_key = '8ea80400c43528254d4fce3cc9b7e02e' AND g2_CacheMap.g_type = 'template' AND g2_CacheMap.g_userId = 5 AND g2_CacheMap.g_timestamp > 1265976588 ")
(mysqlt): SELECT g2_CacheMap.g_value FROM g2_CacheMap WHERE g2_CacheMap.g_key = '8ea80400c43528254d4fce3cc9b7e02e' AND g2_CacheMap.g_type = 'template' AND g2_CacheMap.g_userId = 5 AND g2_CacheMap.g_timestamp > 1265976588
145: Table './gallery/g2_CacheMap' is marked as crashed and should be repaired

ADOConnection._Execute(
SELECT
g2_CacheMap.g_value
FROM
g2_CacheMap
WHERE
g2_CacheMap.g_key = '8e...) %
line 836, file: adodb.inc.php
ADOConnection.Execute(
SELECT
g2_CacheMap.g_value
FROM
g2_CacheMap
WHERE
g2_CacheMap.g_key = ?
..., Array[4]) % line 469, file: GalleryStorage.class
GalleryStorage.search(
SELECT
[GalleryCacheMap::value]
FROM
[GalleryCacheMap]
WHERE
[GalleryCach..., Array[4]) %
line 671, file: GalleryDataCache.class
GalleryDataCache.getPageData(template, Array[5]) % line 1109, file: GalleryTheme.class
GalleryTheme.loadCommonTemplateData(Object:GalleryTemplate,
Object:GalleryUnknownItem, Array[15], Array[8]) % line 97, file: theme.inc
getParameter default.theme for core plugin Loading plugin matrix matrix plugin successfully instantiated Check the version of the matrix plugin The version of the matrix plugin is ok Loading plugin core core plugin successfully instantiated Check the version of the core plugin The version of the core plugin is ok file_exists(/var/www/html/gallery2/modules/core/classes/helpers/../../../../modules/core/ErrorPage.inc) getParameter id.adminGroup for core plugin realpath(/var/www/html/gallery2/modules/core/classes/../../../) file_exists(/var/www/html/gallery2/g2data2/smarty/templates_c/%%1748731597) is_dir(/var/www/html/gallery2/g2data2/smarty/templates_c/%%1748731597) file_exists(/var/www/html/gallery2/g2data2/smarty/templates_c/%%1748731597) is_writeable(/var/www/html/gallery2/g2data2/smarty/templates_c/%%1748731597) file_exists(/var/www/html/gallery2/g2data2/smarty/templates_c/%%1748731597/v_9) file_exists(/var/www/html/gallery2/modules/core/classes/../../../lib/javascript/local/BlockToggle.js) realpath(/var/www/html/gallery2/modules/core/classes/../../..) Binding text domain: themes_matrix -> /var/www/html/gallery2/themes/matrix/locale file_exists(/var/www/html/gallery2/modules/core/../../themes/matrix/local/theme.css) file_exists(/var/www/html/gallery2/modules/core/classes/../../../themes/matrix/local/theme.css)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2010-02-12 12:39

It's not hard to spot this:

Quote:
mysqlt error: [145: Table './gallery/g2_CacheMap' is marked as crashed and should be repaired] in EXECUTE(" SELECT g2_CacheMap....
145: Table './gallery/g2_CacheMap' is marked as crashed and should be repaired

Do some online research on how to repair a crashed MySQL table. If that doesn't work, I'm pretty sure (don't quote me) you can just empty that table.

 
putee

Joined: 2010-02-11
Posts: 9
Posted: Fri, 2010-02-12 12:47

I don't know how to repair this - most appreciated if you can assist me.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2010-02-12 13:12

I'm afraid I don't know anything about MySQL so I can't help with the repair - maybe someone else can jump in.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-02-12 13:19

You host has probably supplied you with a database tool like phpMyAdmin
You can easily repair tables from there. Otherwise ask your host to repair it for you.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
putee

Joined: 2010-02-11
Posts: 9
Posted: Fri, 2010-02-12 13:32

Hi Alec,

I was able to run REPAIR TABLE from my phpMyAdmin but the result is negative so as per your advice I emptied the table and it work smoothly!
thank you so much for saving my 1600+ photos in the gallery.

 
mrkite

Joined: 2005-02-21
Posts: 1
Posted: Fri, 2010-05-07 17:51

Just had the same problem with the g2_CacheMap table. Couldn't repair it, but emptying it worked for me, also.