Error (ERROR_MISSING_OBJECT, ERROR_PERMISSION_DENIED)

GerardNijboer
GerardNijboer's picture

Joined: 2006-10-04
Posts: 5
Posted: Mon, 2009-11-16 00:51

Hi,

I have a massive problem.
When trying to move from Windows to Linux machine, i accidentally deleted the mysql table g2_accessmap.
Now, at the current Windows version, I can't access all Items anymore.
This is what it returns when accessing it through the itemid:
Security Violation

The action you attempted is not permitted.

Back to the Gallery
Error Detail -
Error (ERROR_MISSING_OBJECT, ERROR_PERMISSION_DENIED)
etc.....
System Information
Gallery version 2.2.4
PHP version 5.2.5 apache2handler
Webserver Apache/2.2.8 (Win32) PHP/5.2.5
Database mysqli 5.0.51a-community-nt
Toolkits Thumbnail, Gd
Operating system Windows NT NOS01 5.2 build 3790
Browser Mozilla/5.0 (Windows; U; Windows NT 6.0; nl; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)

I managed to rebuild the table with some old data, but now i can only browse through the site structure through debug tree.
when i want to access, i get that error.
Is there a way to rebuild those access rights?
We are talking about a fish-database with thousands of records, so no option to rebuild.

Thanks in advance!
Gerard

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-11-17 20:22

So you don't have a working DB at all? Without a good DB, Gallery can't function properly.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
GerardNijboer
GerardNijboer's picture

Joined: 2006-10-04
Posts: 5
Posted: Tue, 2009-11-17 20:35

yeah it's working, but it now seems i can access all albums because the table g2_accessmap does not match g2_accesssubscribermap

i get a list of all missing id's by running this query:
SELECT t1.g_accessListId AS myid FROM `g2_accesssubscribermap` AS t1 LEFT JOIN `g2_accessmap` AS t2 ON t1.g_accessListId=t2.g_accessListId AND t2.g_accessListId=NULL GROUP BY t1.`g_accessListId` LIMIT 0,100;

Now i try to fix the problem by running this php code:

Quote:
$ab_Mysql['Link'] = mysql_connect($ab_Mysql['Host'], $ab_Mysql['User'], $ab_Mysql['Pass']) or die(mysql_error());
mysql_select_db($ab_Mysql['Base']) or die(mysql_error());

$ab_Fixer['Result'] = mysql_query("SELECT t1.g_accessListId AS myid FROM `g2_accesssubscribermap` AS t1 LEFT JOIN `g2_accessmap` AS t2 ON t1.g_accessListId=t2.g_accessListId AND t2.g_accessListId=NULL GROUP BY t1.`g_accessListId` LIMIT 0,100;") or die(mysql_error());

while ($ab_Fixer['Row'] = mysql_fetch_array($ab_Fixer['Result']))
{
echo $ab_Fixer['Row']['myid']."<br />";
$thisid = $ab_Fixer['Row']['myid'];
$ab_Fixing['Result'] = mysql_query("INSERT INTO g2_accessmap (g_accessListId, g_userOrGroupId, g_permission) VALUES (".$thisid.", 3, 2147483647);") or die(mysql_error());
$ab_Fixing['Result'] = mysql_query("INSERT INTO g2_accessmap (g_accessListId, g_userOrGroupId, g_permission) VALUES (".$thisid.", 4, 647431);") or die(mysql_error());
$ab_Fixing['Result'] = mysql_query("INSERT INTO g2_accessmap (g_accessListId, g_userOrGroupId, g_permission) VALUES (".$thisid.", 6, 2147483647);") or die(mysql_error());
}

I get this output:
19
Duplicate entry '19-3' for key 1

Any ideas?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-11-17 20:54

None, I have no clue how to fix a broken DB. You've already dug into the DB more than I have.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
GerardNijboer
GerardNijboer's picture

Joined: 2006-10-04
Posts: 5
Posted: Tue, 2009-11-17 21:13

Fixed it! Next step: Try to make a succesful move from windows to ubuntu server.
Anyone got something like the same problem?

, free support.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-11-17 21:24

FAQ: How can I move my gallery installation from one server to another?

Make sure you follow step 6. Pay very close attention to step 6. :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live hereFAQ: How can I move my gallery installation from one server to another?