Forum OpenACS Q&A: can't access admin pages, but I am site-wide admin

Yesterday, I was having trouble with PostgreSQL (see old msg). My solution was to dump the database, drop the database, and then import it back.

After I did that, I upgraded to AOLserver 3.3ad13 (BTW: it has a bug in nsmain.c with regard to nsd's -s <server> option).

Now, after everything is back up, I can log in, but even though I am the site-wide admin, I cannot access any /admin/ pages -- the message says: "You are not an administrator."

This happens regardless of the browser, so I don't think it's a cookie issue.

Also, I did not dump and drop the database on both of my OpenACS severs, but I cannot access /admin/ on either -- again, I am site- wide admin on both. One site runs OpenACS 3.2.3, and the other site runs 3.2.5.

What could have caused this? And, what's the best method for fixing it?

Thanks.

One other thing: the "Site-Wide Administration" link is included in my workspace (/pvt/home.tcl).
I haven't seen anything like this before, but it should be somewhat easy to narrow down (famous last words, eh?). In OpenACS 3.2.5, you want to take a look at /tcl/ad-admin.tcl. The routines to look at are all at the top of the file.

There's ad_administrator_p, and there's the filter, ad_restrict_to_administrator. For some reason, you're pissing that filter off.

Perhaps the easiest thing to do is to instrument the ad_administrator_p to log the user_id it's called with.

I would explore the query:

select ad_group_member_p($user_id, system_administrator_group_id())
What is system_administrator_group_id() returning? What does ad_group_member_p($user_id, system_administrator_group_id()) return?
For starters...

psql terminal results for BOTH servers...

james=# select ad_group_member_p(3,system_administrator_group_id());
 ad_group_member_p 
-------------------
 f
(1 row)

james=# select ad_group_member_p(1,system_administrator_group_id());
 ad_group_member_p 
-------------------
 f
(1 row)

buxs=# select ad_group_member_p(1,system_administrator_group_id());
 ad_group_member_p 
-------------------
 f
(1 row)

buxs=# select ad_group_member_p(3,system_administrator_group_id());
 ad_group_member_p 
-------------------
 f
(1 row)
Well that's good news.  I would have hated it if those selects returned a 't'.  So ignore james for now, and let's just go for the bux.  Assume that if you can fix that one, you can heal yourself later.

What is system_administrator_group_id() returning?  Why did you use the user_ids of 1 and 3?

What does "select * from user_group_map where user_id in (1,3);" return?

> What is system_administrator_group_id() returning?
buxs=# select system_administrator_group_id() from dual;
 system_administrator_group_id 
-------------------------------
                              
(1 row)
> Why did you use the user_ids of 1 and 3?
user_id 1: system account
user_id 2: anonymous
user_id 3: first real user added (me -- also an administrator)
> What does "select * from user_group_map where user_id in (1,3);" return?
buxs=# select * from user_group_map where user_id in (1,3);
 group_id | user_id |     role      |   registration_date    | mapping_user | mapping_ip_address 
----------+---------+---------------+------------------------+--------------+--------------------
        1 |       1 | administrator | 2001-08-28 22:30:39-05 |            1 | 0.0.0.0
        1 |       3 | administrator | 2001-08-28 23:23:08-05 |            1 | 129.62.16.17
<snip other group ids>
It looks as though you have a problem in system_administrator_group_id().  Looking at its definition within www/doc/sql/user-groups.sql, I wonder what does "select * from administration_info" return?  (All of this appears to tell you what's broken, but not why or how it broke of course.)
I dropped the db (again), restored it, and it looks like everything is working (I hope).

The only thing I had done on both dbases last night was export them and run vacuum analyze -- until now, I had only restored one dbase so that couldn't have caused both to become corrupt. I had suspected that vacuum analyze caused my PostgreSQL problem too (old posting).

Has anyone else experienced stuff like this before? What was your solution?

Or, does anyone have another theory -- besides vacuum analyze corrupting the dbase?

I am still experiencing one problem...

Sometimes stuff on a Web page that should have resulted from a dbase query is either not there or shows a "server error" (this happens on both OpenACS servers).

If I hit reload in the browser, then it correct itself. It appears that this happens after I kill and restart AOLserver.

Upgrading from PG 2.0 driver to 2.1 does not fix the problem.