Issues when uploading pictures - ERROR_STORAGE_FAILURE - can't fix it

skuba

Joined: 2004-05-06
Posts: 103
Posted: Fri, 2012-08-03 21:36

Today I tried uploading some picture to my Gallery 2 and got error, I have tried several things and still have the problem. I really hope one of you can help me.

Error message

Quote:
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1007 (GalleryCoreApi::error)
in modules/core/classes/GalleryStorage.class at line 521 (GalleryStorageExtras::addMapEntry)
in modules/core/classes/GalleryCoreApi.class at line 2955 (GalleryStorage::addMapEntry)
in modules/core/classes/GalleryEntity.class at line 271 (GalleryCoreApi::addMapEntry)
in modules/core/classes/GalleryItem.class at line 414 (GalleryEntity::save)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 183 (GalleryItem::save)
in modules/core/classes/GalleryCoreApi.class at line 1668 (GalleryItemHelper_medium::addItemToAlbum)
in modules/core/ItemAddFromBrowser.inc at line 99 (GalleryCoreApi::addItemToAlbum)
in modules/core/ItemAdd.inc at line 159 (ItemAddFromBrowser::handleRequest)
in ??? at line 0 (ItemAddController::handleRequestWithProgressBar)
in modules/core/classes/GalleryTemplateAdapter.class at line 1092
in /home/snow07/g2data-old/smarty/templates_c/%%4026596137/snow/%%77^773^7731C556%%theme.tpl.php at line 69 (GalleryTemplateAdapter::trailer)
in lib/smarty/Smarty.class.php at line 1255
in modules/core/classes/GallerySmarty.class at line 61 (Smarty::fetch)
in modules/core/classes/GalleryTemplate.class at line 241 (GallerySmarty::fetch)
in main.php at line 506 (GalleryTemplate::display)
in main.php at line 104
in main.php at line 88

I have researched the error on the FAQs and forum and tried a few things but they didn't solve the problem.

- I checked folder permissions, and the g2data folder is correctly set to 777
- I checked g2_SequenceId table and the value is ok
- I turned on debug mode and this seems to be the error it gave me.

Quote:
Query: SELECT g_itemId FROM g2_ImageBlockDisabledMap WHERE g_itemId=29454 failed. Table 'REDACTED.g2_ImageBlockDisabledMap' doesn't exist
1146: Table 'REDACTED.g2_ImageBlockDisabledMap' doesn't exist

I am not sure this is all you need. I can post the entire thing here if will help.

I tried to repair this table, but it's can't be repaired, and actually there is no data in it.

Here is my systems details.

Quote:
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.5 apache2handler
Webserver = Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.5
Database = mysqli 5.0.95-community-log, lock.system=flock
Toolkits = Exif, Getid3, LinkItemToolkit, Thumbnail, SquareThumb, ArchiveUpload, ImageMagick, NetPBM, Gd
Acceleration = none, none
Operating system = Linux snowbrasil.fbyneserv.com 2.6.32-042stab057.1 #1 SMP Fri Jun 22 02:17:07 MSD 2012 x86_64
Default theme = snow
gettext = enabled
Locale = pt_BR
Browser = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Rows in GalleryAccessMap table = 17
Rows in GalleryAccessSubscriberMap table = 2149
Rows in GalleryUser table = 3
Rows in GalleryItem table = 2137
Rows in GalleryAlbumItem table = 90
Rows in GalleryCacheMap table = 0

I hope you can point me in the right direction to fix this.

Thanks so much

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-08-03 22:17

See if you can empty or repair the g2_ImageBlockDisabledMap table in phpMyAdmin or similar tool

you could also uninstall/re-install the imageblock module

-s

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Fri, 2012-08-03 22:58

Ok, so at first I tried to uninstall the Image Block plugin and got an error.

Quote:
Error Detail -
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1630 (GalleryCoreApi::error)
in modules/core/classes/GalleryStorage.class at line 789 (GalleryStorageExtras::unconfigureStore)
in modules/core/classes/GalleryModule.class at line 305 (GalleryStorage::unconfigureStore)
in modules/core/PluginCallback.inc at line 285 (GalleryModule::uninstall)
in modules/core/PluginCallback.inc at line 67 (PluginCallbackView::handleCallback)
in main.php at line 450 (PluginCallbackView::renderImmediate)
in main.php at line 104
in main.php at line 88
System Information
Gallery version 2.3
PHP version 5.2.5 apache2handler
Webserver Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.5
Database mysqli 5.0.95-community-log
Toolkits SquareThumb, ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux snowbrasil.fbyneserv.com 2.6.32-042stab057.1 #1 SMP Fri Jun 22 02:17:07 MSD 2012 x86_64
Browser

But after I turned on buffered debug, it went through. So I tried uploading a picture again with debug on, and for the same ERROR_STORAGE_FAILURE...

In the debug output, these seems to be the last nines related to the error. I am assuming I don't need to post the entire debug output.

Quote:
(mysqli): BEGIN
mysqli error: [1062: Duplicate entry '29938' for key 1] in EXECUTE("INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (29938,12)")
(mysqli): INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (29938,12)
Query: INSERT INTO g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES (29938,12) failed. Duplicate entry '29938' for key 1
1062: Duplicate entry '29938' for key 1

ADOConnection._Execute(INSERT INTO
g2_AccessSubscriberMap (g_itemId, g_accessListId) VALUES
(29938,12)) % line 872, file: adodb.inc.php

ADOConnection.Execute(INSERT INTO g2_AccessSubscriberMap
(g_itemId, g_accessListId) VALUES (?,?), Array[2]) % line 1004, file: GalleryStorageExtras.class

GalleryStorageExtras.addMapEntry(GalleryAccessSubscriberMap,
Array[2], false) % line 521, file: GalleryStorage.class

GalleryStorage.addMapEntry(GalleryAccessSubscriberMap,
Array[2], false) % line 2955, file: GalleryCoreApi.class

GalleryCoreApi.addMapEntry(GalleryAccessSubscriberMap,
Array[2]) % line 271, file: GalleryEntity.class

Anything else I can try? Thanks much

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2012-08-04 00:01

can you view and delete this item?
yoursite.com/gallery2/main.php?g2_itemId=29938

-s

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Sat, 2012-08-04 18:56

Item not found, but I see the line on the AccessSubscriberMap tablet.
I tried some other g2_itemID, and the latest one that works is the 29930.

In other words, all items added after, from 29935 to 29950 are missing. I am pretty sure these refer to all the tries yesterday to upload pictures without success. Although in the g2data folder I see a couple of the pictures that I tried to upload.

Should I manually delete them from the tables? Any other table I would need to work on besides AccessSubscriberMap?

Quote:
Edit Inline Edit Copy Delete 29930 12
Edit Inline Edit Copy Delete 29935 12
Edit Inline Edit Copy Delete 29936 12
Edit Inline Edit Copy Delete 29937 12
Edit Inline Edit Copy Delete 29938 12
Edit Inline Edit Copy Delete 29939 12
Edit Inline Edit Copy Delete 29940 12
Edit Inline Edit Copy Delete 29943 12
Edit Inline Edit Copy Delete 29944 12
Edit Inline Edit Copy Delete 29945 12
Edit Inline Edit Copy Delete 29950 12

Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2012-08-04 18:53

I have a script that will remove those http://www.flashyourweb.com/filemgmt/index.php?id=45

-s

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Sat, 2012-08-04 22:30

Thanks so much for the script. But it didn't find any errors, what was actually odd.

I was taking a look on admin event logs and found out there have been several Storage errors even on dates I didn't try to upload or change anything. The last time I uploaded something was on July 17th, and then I tried again 2 days ago when I got errors uploading files.

Quote:
ate Type Location Client Summary
Sex 27 Jul 2012 17:35:31 EDT Gallery Error Link 65.52.109.9 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 17:04:26 EDT Gallery Error Link 66.249.72.244 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:58:54 EDT Gallery Error Link 213.186.119.136 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:56:28 EDT Gallery Error Link 213.186.127.13 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:44:47 EDT Gallery Error Link 207.46.13.160 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:30:30 EDT Gallery Error Link 213.186.122.3 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:29:47 EDT Gallery Error Link 213.186.119.137 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:27:59 EDT Gallery Error Link 65.52.110.147 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 16:12:22 EDT Gallery Error Link 66.249.72.244 ERROR_STORAGE_FAILURE
Sex 27 Jul 2012 15:41:55 EDT Gallery Error Link 200.186.13.158 ERROR_BAD_PARAMETER
Sex 27 Jul 2012 15:41:27 EDT Gallery Error Link 200.186.13.158 ERROR_BAD_PARAMETER
Sex 27 Jul 2012 15:41:27 EDT Gallery Error Link 200.186.13.158 ERROR_BAD_PARAMETER
Sex 27 Jul 2012 15:40:12 EDT Gallery Error Link 200.186.13.158 ERROR_BAD_PARAMETER
Sex 27 Jul 2012 15:40:11 EDT Gallery Error Link 200.186.13.158 ERROR_BAD_PARAMETER
Sex 27 Jul 2012 07:42:29 EDT Gallery Error Link 95.133.245.37 Parent 3417 path index.php
Sex 27 Jul 2012 07:42:26 EDT Gallery Error Link 95.133.245.37 Parent 3417 path index.php
Sex 27 Jul 2012 07:42:24 EDT Gallery Error Link 95.133.245.37 Parent 3417 path index.php
Ter 24 Jul 2012 15:05:28 EDT Gallery Error Link 186.241.226.65 malicious url
Dom 22 Jul 2012 21:04:58 EDT Gallery Error Link 186.241.231.157 malicious url
Dom 22 Jul 2012 21:04:57 EDT Gallery Error Link 186.241.231.157 malicious url

I also see some collision errors, not sure what they mean

Quote:
Sex 20 Jul 2012 07:12:44 EDT Gallery Error Link 213.186.127.3 ERROR_COLLISION
Sex 20 Jul 2012 07:11:32 EDT Gallery Error Link 213.186.127.28 ERROR_COLLISION
Sex 20 Jul 2012 07:10:33 EDT Gallery Error Link 213.186.119.138 ERROR_COLLISION
Sex 20 Jul 2012 07:07:08 EDT Gallery Error Link 213.186.122.3 ERROR_COLLISION
Sex 20 Jul 2012 07:05:14 EDT Gallery Error Link 213.186.127.7 ERROR_COLLISION
Sex 20 Jul 2012 07:03:30 EDT Gallery Error Link 213.186.119.141 ERROR_COLLISION
Sex 20 Jul 2012 06:54:32 EDT Gallery Error Link 213.186.122.2 ERROR_COLLISION
Sex 20 Jul 2012 06:39:51 EDT Gallery Error Link 213.186.127.10 ERROR_COLLISION
Sex 20 Jul 2012 06:39:02 EDT Gallery Error Link 213.186.119.134 ERROR_COLLISION
Sex 20 Jul 2012 06:37:47 EDT Gallery Error Link 213.186.127.9 ERROR_COLLISION
Sex 20 Jul 2012 06:36:06 EDT Gallery Error Link 213.186.127.12 ERROR_COLLISION
Sex 20 Jul 2012 06:35:35 EDT Gallery Error Link 212.113.37.105 ERROR_COLLISION
Sex 20 Jul 2012 06:25:09 EDT Gallery Error Link 213.186.120.196 ERROR_COLLISION
Sex 20 Jul 2012 06:22:59 EDT Gallery Error Link 213.186.119.131 ERROR_COLLISION
Sex 20 Jul 2012 06:19:20 EDT Gallery Error Link 212.113.35.162 ERROR_COLLISION
Sex 20 Jul 2012 06:19:08 EDT Gallery Error Link 213.186.127.9 ERROR_COLLISION
Sex 20 Jul 2012 06:15:57 EDT Gallery Error Link 213.186.127.13 ERROR_COLLISION
Sex 20 Jul 2012 06:13:51 EDT Gallery Error Link 213.186.119.135 ERROR_COLLISION
Sex 20 Jul 2012 06:05:21 EDT Gallery Error Link 213.186.127.3 ERROR_COLLISION
Sex 20 Jul 2012 06:00:40 EDT Gallery Error Link 212.113.37.105 ERROR_COLLISION

Not sure what else to do. I don't have a recent backup.

My VPN has recently moved me to a new server, and it was on the next day that I had some issues with mysql, and they said they identified a corrupted table g2_SessionMap.

Thanks

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Sat, 2012-08-04 22:35

Important update. I tried uploading an item in a different album and had no issues. It seems the errors are when I tried to upload to one specific album. So I am hoping there is a way I can manually fix this in the database.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2012-08-04 23:14

Move all the viewable items out of that album -> delete the album -> re-create album -> move items back

-s

 
g8rbuilder
g8rbuilder's picture

Joined: 2012-08-05
Posts: 1
Posted: Sun, 2012-08-05 15:01

Suprsidr - I had the same situation and used your script to remove the tables. Worked like a charm. Thanks for you help and your comments on the forum. - Dave

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 00:22

Super odd, I was trying to add images to another album, or create a brand new album, or add images to the problematic album and always getting those storage errors (duplicate entry on debug). But I kept trying to do the same things, adding images, creating album, etc...and eventually it started working (except that it didn't create a thumbnail)

Then I tried to delete a test folder I had just created and got the error

Quote:
Error (ERROR_STORAGE_FAILURE)

From debug

Quote:
Query: DELETE FROM g2_ItemHiddenMap WHERE g_itemId=29954 failed. Table 'redacted.g2_ItemHiddenMap' doesn't exist
1146: Table 'redacated.g2_ItemHiddenMap' doesn't exist

ADOConnection._Execute(DELETE FROM
g2_ItemHiddenMap WHERE g_itemId=29954) %
line 872, file: adodb.inc.php

ADOConnection.Execute(DELETE FROM g2_ItemHiddenMap WHERE
g_itemId=?, Array[1]) % line 1110, file:
GalleryStorageExtras.class

GalleryStorageExtras.removeMapEntry(ItemHiddenMap,
Array[1]) % line 533, file: GalleryStorage.class

GalleryStorage.removeMapEntry(ItemHiddenMap,
Array[1]) % line 2935, file: GalleryCoreApi.class

GalleryCoreApi.removeMapEntry(ItemHiddenMap,
Array[1]) % line 206, file: module.inc

So first I was getting errors for duplicate entry, then after successfully adding stuff, I get error for non existant entry.

Is the DB doomed?

I don't have a recent backup and would very much like to fix it.

Thanks so much

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2012-08-08 01:28

try uninstalling the hidden items module

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 00:22

Great news! I deactivated the hidden items module and was able to upload new pictures and create new albums. I even moved a newly uploaded picture to another album. No errors!!!

My concern is now if I continue using this DB and it will keep getting bigger, would I run into bigger issues? What could I do to prevent them?

- Is it still a good idea to move all photos from the problematic album to a new album? I couldn't figure out how to move all photos in one album, only to move one at a time.

- I tried backing up the database using the maintenance options, and still got storage error and it pointed to the hidden map module:

Quote:
(mysqli): SELECT COUNT(*) FROM g2_ItemHiddenMap
Query: SELECT COUNT(*) FROM g2_ItemHiddenMap failed. Table 'redacted.g2_ItemHiddenMap' doesn't exist
1146: Table 'redacted.g2_ItemHiddenMap' doesn't exist

- I tried to completely uninstall the item hidden module, and to delete it, and got storage errors. The debut output didn't really say what the error was.

Any ideas what else I could try?

Thanks so much for helping

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2012-08-08 11:06

recreate the table in your DB tool

CREATE TABLE `g2_ItemHiddenMap` (
  `g_itemId` int(11) NOT NULL,
  PRIMARY KEY (`g_itemId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 00:24

It says the table already exists. But when I look in PHPMyAdmin under Structure it doesn't show up. Once I switch to Search, it's listed as one of the options, but when I do a wildcard search it find the table but no matches in it.

Seems like the ItemHiddenMap is indeed hidden :-)

Do I need to maybe delete it and recreate?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-08-09 00:44

yes that table probably crashed. You may be able to repair it.

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 01:11

If I try to repair it I get that ir doesn't exist

Quote:
Table 'redacted.g2_ItemHiddenMap' doesn't exist

But if I try to create it I get that it already exists

Quote:
#1050 - Table 'g2_ItemHiddenMap' already exists

But I think that even if it found the table it wouldn't be able to repair it. Because when I try to run a repair in the entire database it fails for every table:

Quote:
........
redacted.g2_AccessMap
note : The storage engine for the table doesn't support repair
redacted.g2_AccessSubscriberMap
note : The storage engine for the table doesn't support repair
redacted.g2_AlbumItem
note : The storage engine for the table doesn't support repair
.........

Except these 3:

g2_SequenceEventLog , g2_SequenceId ,g2_SequenceLock and g2_SessionMap

Any other ideas?

Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-08-09 01:46

so you executed the following SQL:
REPAIR TABLE `g2_ItemHiddenMap`
and it failed?

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 03:30

Yes

Quote:
Table Op Msg_type Msg_text
redacted.g2_ItemHiddenMap repair Error Table 'redacted.g2_ItemHiddenMap' doesn't exist
redacted.g2_ItemHiddenMap repair status Operation failed

Thanks

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 17:09

Any suggestions?

Couldn't it also be a problem the fact the engine used is InnoDB? My hosting tells me that InnoDB engine doesn't support repairing DBs.

Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-08-09 17:24

export your entire db to simple sql document
open your exported sql document in a text editor
remove the mangled g2_ItemHiddenMap table

empty your db or you may have to delete it and re-create it if you still cannot remove this table
import edited sql
create g2_ItemHiddenMap table w/ snippet from above (as gallery is going to expect it)

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 18:34

So, the guys at my VPS support moved the .frm file for the ItemHiddenMap table outside the folder of the database and then I was able to recreate it.
So now I was just able to upload several pictures. I was also able to run a full backup through the admin interface.

I couldn't do a full repair through phpmyadmin or webhostmanager, apparently because InnoDB engine doesn't allow it. Can this be a problem in the future?

Do you still recommend I move all pictures from the formely problematic album to a new album? Couldn't you please let me know how to do that?

Thanks for all the help, I am immensely grateful.

Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-08-09 19:11
Quote:
So, the guys at my VPS support moved the .frm

I'm glad that worked, but you should not play w/ those files.

One issue I've run into is that InnoDB files can grow large and there is no way to truncate them without deleting and recreating tables.
My old server the /var partition ran out of space because of this.

Now would be a good time to remove any modules you are not using.
Like if you are not hiding items, remove the hiddenItems module.
Also if you don't use exif remove it, getId3 has absolutely no use whatsoever...

Then make a backup of your DB

Quote:
Do you still recommend I move all pictures from the formely problematic album to a new album?

Only if it is still erroring

-s
All New jQuery Minislideshow for G2/G3

 
skuba

Joined: 2004-05-06
Posts: 103
Posted: Thu, 2012-08-09 22:52

Thank for all the help, very much appreciated. I hope this post helps others in the future.