synchronization cache and database
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
Hi, I'm italian and I don't know if I can explain in the right way our problem. We are the admins of twilightersitalia.com and we have installed gallery2. could you help us??!! thank you |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
You should never delete or add images from or to, or otherwise directly interact with, your g2data folder. Now that you have done this, your options are: 1. The easy way is to ask your host to restore that folder from their backup archives and then delete the album from within G2. To get a dump of the items ids, take the code below and put it into your theme.tpl near the bottom just before the {g->debug}. It should list all the item ids of items within each album. Type them into excel, sort the list and delete duplicates. (IMPORTANT: Add item id '0' to your list ... i.e. do not delete item id '0') {if $theme.pageType == 'album'} {if count($theme.children)} {foreach from=$theme.children item=child} <div>{$child.id}</div> {/foreach} {/if} {/if} Remove the code once you are done ... also remove whatever malware it is that Google says your site is distributing (http://google.com/safebrowsing/diagnostic?tpl=safari&site=twilightersitalia.com&hl=en-us) If you can't navigate the site at all, then options 1 or 2 are about all I can think of that you can do. -- |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I've written a script to help http://gallery.menalto.com/node/97273#comment-349875 -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Nice one. This assumes the user knows the Item ids of the missing items so will need to be combined with Option 3 above. I suppose it could be expanded to recurse through the albums get the current ids, compare this with a list of those in the db and delete the extras. OP will have to do this or hire someone to write this up for him. Hopefully he will post the resulting script here for possible pushing into the lib/support scripts. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Ok, I've updated the script to search for lost or missing items automatically either by album, or recursively from root. -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Cool. Taking a quick look at it though, I think you may need to amend it a bit so that the HTML runs first and the user can input the path to G2. At the moment, it is referencing global gallery and the configs in config.php as well as embed.php but can't know where these are located. Structure probably should be a form asking for the path to G2 and then run "init(path_to_g2);" so that you can "require once path_to_g2 . embed.php;" Also not sure where user will input specific id. Well done all the same. -- |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
No. Embed and config are located in their root of their G2 directory, which is where I instruct them to put it. -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Ha, I see ... Wasn't aware. -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
thank you so much, really!! ** but Aruba have already restore the gallery database, but nothing have changed... so I wanted to try your script suprsidr, but where I can find the itemID for the folder that we have deleted from ftp? thanks again!! |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
I also tried to put the code of Dayo in theme.tpl, but when I go to the gallery it shows only a blank page with Error... |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
The theme.tpl thing will not work since g2 is down. The idea with the script is that you put it into your G2 folder and navigate to it in your browser. It should then find the missing items for you and remove references to them from your db. -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
and so the problem is: why the gallery is down?? we've already done the restore of the backup in the database... |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I guess, maybe I'll add a form with an album list selector to let the user to choose where to start from. -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
kiucci wrote:
and so the problem is: why the gallery is down?? we've already done the restore of the backup in the database... Restoring the database has no relevance to your issue which is that you manually deleted a folder. This is why your gallery is down. If you go back and read through this thread, you will see that no one recommended restoring the database as a solution. Run the script to fix the problem. |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
sorry >.< when I run the script, it shows: GalleryEmbed::init failed, here is the error message: Error (ERROR_STORAGE_FAILURE) * in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 203 (GalleryCoreApi::error) ?? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I've never run it on a site that is down. I'm wondering if changing line 39 of missingObjectFix.php to: -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
kiucci wrote:
sorry >.< Sorry for coming across so harsh. I now doubt if the script will work for you as it uses the G2 Embed (tries to create a G2 instance when the site is down). Additionally, your site has in all likelihood been hacked as your host, Aruba, has some bad outfits on their servers as per the Google warning and heaven knows what they have changed on your site. Your best bet is to try the option involving the waybackmachine and hope your virtual neighbours have not vandalised the site and only added malware distribution to your setup. You will of course need to get to the root of how the malware got put on your site (assuming you didn't put it there yourself) or you will get hacked again soon. -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
oh my god, I didn't understand anything @.@ the script with the change doesn't work at all. I'm searching in waybackmachine but there isn't the the last day with the folder that we deleted, it was the 21th June, but the waybackmachine stops at 30th April ç_ç |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
oh...sorry, but I want to thank you so much for the help ** |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
I think your problem goes beyond simply deleting that folder. As a last throw of the dice, recreate an empty version of the folder directly in location in g2data it was before and try running the script. If this doesn't work then you probably have to get a new installation.
-- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
I can try to recreate what folder? and where? |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
The folder you deleted. Try to recreate it (empty) in the same location it was before deletion and then rerun the script. If this doesn't work, and it is only a slim chance, try to rebuild the gallery with a new installation as described. -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
but I have to recreate it in the database or in the ftp? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
my latest version v.0.6 skips the loading of any template info, so should connect to your gallery. I just deleted an album directory on my test gallery and the script fixed it no problem. -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
wow, thank you so much, you're too kind, really!!! now I have this situation: http://i34.tinypic.com/2vlqwip.png I think it's better from before, but before I have to solve the problems in the Error part...could you help me?? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Sorry, that's the same database error as before. -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
the oldest backup that I have is from 3rd August, but I don't think it can change so much, because all this story start on 21th June >.< there's no way to solve the errors? |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I think you should restore the most recent backup. -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
no, it doesn't work from 23th June (just today I have time think about it), even if we and our host have restored the database... maybe the only thing to do is to get a new installation, if we can solve the Error (ERROR_STORAGE_FAILURE) |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
kiucci Wayne -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
nothing is changed with the 03August backup... |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
run the upgrader specifically step 2 system checks -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
I made the upgrade and nothing is changed again... I have 2 warning in step 2: 1. for the output_buffering enable in php.ini |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
Do you have access to server error logs? -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
I only just looked closely at the error screenshot you posted and can see that the bit where your gallery is crashing is actually not related to the missing folder and has to do with user records. In simple speak, somebody has been playing around in your database and it is now messed up ... the deleted folder is just a distraction. This is why the script works on suprsidr's test gallery but not on yours. In order of importance, your issues are: You need to fix Item 1 before going to Item 2. Item 2 is easy to fix ... the script does this. -- |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
I can see just the most recent error logs and about the gallery there is only this typw of error: [Mon Aug 09 16:44:02 2010] [error] [client 207.46.204.177] ModSecurity: Warning. Pattern match "msn(?:bot|ptc)" at REQUEST_HEADERS:User-Agent. [file "/etc/apache/modsecurity/modsecurity_crs_55_marketing.conf"] [line "17"] [id "910008"] [msg "MSN robot activity"] [severity "NOTICE"] [hostname "www.twilightersitalia.com"] |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
@Dayo, so you're thinking user 5(Guest) or 6(Admin) has been deleted? But if there are not too many items in your gallery, re-install may be less trouble. -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
not too many? XD just 24560 photos ç_ç you think I can insert the record?? |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
actually now that you tell me about the users, I don't have a user table in database O.o there is just g2_pendinguser... I don't know it is normal... |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
You can try: DROP TABLE IF EXISTS `g2_User`; CREATE TABLE IF NOT EXISTS `g2_User` ( `g_id` int(11) NOT NULL, `g_userName` varchar(32) NOT NULL, `g_fullName` varchar(128) default NULL, `g_hashedPassword` varchar(128) default NULL, `g_email` varchar(255) default NULL, `g_language` varchar(128) default NULL, `g_locked` int(1) default '0', PRIMARY KEY (`g_id`), UNIQUE KEY `g_userName` (`g_userName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `g2_User` (`g_id`, `g_userName`, `g_fullName`, `g_hashedPassword`, `g_email`, `g_language`, `g_locked`) VALUES (5, 'guest', 'Guest', 'U7T4b19b16ff9d1f6e1e22b686394e8d4c42', NULL, NULL, 0), (6, 'Admin', 'Gallery Administrator', 'A3gs01c022fdf6d2e82d99866eea3ce1064d', 'youremail@youremail.com', NULL, 0); Adjust the email address in the above insert. Then you'll have to use the password recovery if we get your gallery backup. -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
@kiucci g2_AccessMap g2_AccessSubscriberMap g2_AlbumItem g2_AnimationItem g2_CacheMap g2_ChildEntity g2_DataItem g2_Derivative g2_DerivativeImage g2_DerivativePrefsMap g2_DescendentCountsMap g2_Entity g2_EventLogMap g2_ExifPropertiesMap g2_ExternalIdMap g2_FactoryMap g2_FailedLoginsMap g2_FileSystemEntity g2_Group g2_ImageBlockCacheMap g2_ImageBlockDisabledMap g2_Item g2_ItemAttributesMap g2_Lock g2_MaintenanceMap g2_MimeTypeMap g2_MovieItem g2_PermissionSetMap g2_PhotoItem g2_PluginMap g2_PluginPackageMap g2_PluginParameterMap g2_RecoverPasswordMap g2_Schema g2_SequenceEventLog g2_SequenceId g2_SequenceLock g2_SessionMap g2_ThumbnailImage g2_TkOperatnMap g2_TkOperatnMimeTypeMap g2_TkOperatnParameterMap g2_TkPropertyMap g2_TkPropertyMimeTypeMap g2_UnknownItem g2_User g2_UserGroupMap I don't have a g2_pendinguser but there is a g2_user. I think g2_pendinguser applies if you allow user registrations which I don't. One thing to do immediately is to change your ftp password, stop using ftp and use sftp instead if possible and make sure you don't have spyware on your machine especially if you are on Windows. @suprsidr -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
suprsidr wrote:
You can try:DROP TABLE IF EXISTS `g2_User`; CREATE TABLE IF NOT EXISTS `g2_User` ( `g_id` int(11) NOT NULL, `g_userName` varchar(32) NOT NULL, `g_fullName` varchar(128) default NULL, `g_hashedPassword` varchar(128) default NULL, `g_email` varchar(255) default NULL, `g_language` varchar(128) default NULL, `g_locked` int(1) default '0', PRIMARY KEY (`g_id`), UNIQUE KEY `g_userName` (`g_userName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; If he does this, he will lose all his user records |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
my tables end at g2_SequenceEventLog -.-' so HERE is the real problem >.< ye, we have user registration and I'am the only admin of the staff who use Macintosh, the others have Windows. I changed the ftp password yesterday for the malware attack of the past days how can I use sftp?? I use Filezilla to work on files... and now??!! |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
You need to find a backup of your db from working g2 installation on your site and load the missing tables. If not available, You can try running suprsidr's sql and then adding blank versions of the others. Most likely, you will need to reinstall. Filezilla has sftp (secure ftp). Your host may not permit you access this way though ... you need to ask. BTW. If you or your staff have spyware that is broadcasting your ftp password to some hacker in Siberia, they already have your new one already. Change it again today and tomorrow and the day after .... until each machine has been throughly scanned. After that, change it every week or at least frequently. Your guys probably log in at home sometimes and God only knows what they have on their home computers. -- |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
I can continue to feed you tables and inserts, but looks like you'll have to re-install your toolkits. -s |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
ok I found a working backup and restored it, and now the gallery and your script work (I just want to say that Aruba said he had restored the same backup that I restored today -.- ), but only for the admin; for the users it shows "Closed for working"... I run the script for the album where was the folder that we have deleted, but nothing changed... |
|
kiucci
Joined: 2010-08-07
Posts: 20 |
![]() |
it works!!! *_____* wooooow, thank you so much!!!! I really don't know how to thank you, both ^^ |
|