Multisite gallery. The administration session has expired on one, but not on other gallery

constm

Joined: 2009-10-25
Posts: 19
Posted: Sun, 2009-10-25 07:26


Gallery version (not just "2"): 2.3
PHP version (e.g. 5.1.6): 4.4.9
PHPInfo Link (see FAQ): http://konstantinmartynov.com/gallery/phpinfo.php
Webserver (e.g. Apache 1.3.33): Apache
Database (e.g. MySql 5.0.32): MySql
Activated toolkits (e.g. NetPbm, GD):
Operating system (e.g. Linux): Linux?
Browser (e.g. Firefox 2.0): Any

I have multiple galleries running on the same code. I upgraded all of them from 2.2.6 to 2.3. I believe (as it was long time ago), on one of gallery I installed Google maps and/or piclense (coolpic) plugins. Sometime after I realized I can't login to Site admin interface. Getting: "The administration session has expired, please re-authenticate to access the administration area." message. I have debug output handy and I can post it somewhere. I also did search forums, but there are no definitive answer to this problem.

Any help appreciated,
Konstantin.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2009-10-25 08:35

Debug output can be zipped and attached to this thread.

But run through these FAQ:
FAQ: I can't login anymore, what can I do now?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Mon, 2009-10-26 01:45

Archive.zip is posted.
First file main.php.html is what I'm getting when click on Site admin link. Second file Gallery User Administration.html is after "artificial" refresh. Seems to me with debug mode enabled this function works in two steps.

PS FAQ did not help.

Konstantin.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-10-26 03:45

I don't see anything there, I can only think to make sure that the user that PHP runs as for that site has access to /tmp and that /tmp isn't full (though if it was and that's where other sites write their sessions to they'd be having issues too.

Maybe try a different path for session.save_path
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Tue, 2009-10-27 03:42

Where do I change session.save_path? Also, where /tmp is usually located? I can't find it.

Thanks.

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Wed, 2009-10-28 01:18

OK. So, what are my options here? Is there a way to remove modules one by one and see which one is causing problem? I saw missing .htaccess files when doing sytsem check, but I found them in source and cop to proper folders. So no more complains in that department.

If I have DB back up and reinstall Gallery 2.2.6 or 2.3 into new code directory and then restore from back up, will it render my new install useless again?

Thanks,
Konstantin.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 02:39

You can try disabling modules this way:
FAQ: How can I deactivate a module when I am unable to login?

If you PM me login details I'll try seeing if I can get more info too.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 04:27

Hmmm, frustrating.

This probably won't fix it, but try going to gallery/lib/support and clearing all the cache.

I'm not seeing any errors popping up at all.

Try specifying a different directory than /tmp for session.save_path. That way you can look in there and delete all sessions of needed.

You could also try emptying out your SessionMap table in your database. I don't know how to do that, sorry:
http://gallery.menalto.com/node/70181

You could try reinstalling, but I don't have high hopes of that fixing the problem. And going back to an older version won't be possible unless you restore an older g2data and database.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Wed, 2009-10-28 05:15

Thanks again.

Clearing cache was done few times already on different stages of troubleshooting.

I'll try to figure out what went wrong on DB level.

And if that does not help - reinstall and reimport, oh well... fun times! I guess it's fair pice to pay for privilege to have your own gallery and not to use picassa, flickr or .mac

K

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 13:10

I don't think that's a fair price :)

If you haven't started with a reinstall already, I've asked another support person to see if they have any other ideas.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Thu, 2009-10-29 18:48

No, I have not. Too busy with pre Halloween stuff. I left my main sick galley in debug mode. Please let me know what another person thinks.

I just thought that I'll need to redo all 3 galleries that share the same code in case of reinstall. That sucks.

Thanks,
Konstantin.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2009-10-31 21:07

The only thing I can think of is truncating the sessions table.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Sat, 2009-10-31 21:18

I certainly can do it. Is it safe do delete all records from Sessions table? What will I loose?

thanks,
K

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-11-01 04:38

When dealing with the DB manually create a backup.
Try the truncate and it might fix your issue. If you have issues restore your backup.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Mon, 2009-11-02 04:05

Deleted all records in g2_SessionMap table. Still can't login to Admin interface. Any other ideas what to try?

Thanks,
Konstantin.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2009-11-02 04:27

PM me the admin login info.
FTP access might be useful as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2009-11-02 14:22

Got your PM.
I am able to login with the info provided.
I was able to add an album and add items and the new item does show in the imageblock, but the album is empty.
I will ask another dev to investigate as well.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Mon, 2009-11-02 18:48

Thanks, Dave.

Were you able to login to Site Admin interface? I.e. after loggin in as admin, click on "Site Admin" link in upper right corner? This is where I'm getting "The administration session has expired, please re-authenticate to access the administration area." message.

Thanks,
Konstantin.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-11-03 04:44

Did this ever work?
I have not done many multisites but I don't think you can nest the codebase for the multisite in a multisite, you might but I have never tried.

I am also a bit confused as to the URLs versus the FTP locations. the URL provided does not have a direcotry yet the FTP access does.
Install gallery where your codebase is and see if it work there.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-11-03 05:00

Your codebase site /km/gallery_code/ is using the same DB as the /km/gallery site.

Did you start with a site using the codebase?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-11-03 18:47

Dave asked me to look at this too.

I'm not that familiar with multisite installs either, but it appears your config.php for your main code base is an older version. Doesn't look like there are major discrepancies but it is older.

Did you follow these instructions?
http://codex.gallery2.org/Gallery2:Multisite#How_to_Upgrade_a_Multisite

I do find it odd that your other multi site installs are working fine and this one is not. But the others have their own database and login info, where the problem one is using the same DB as the main code base.....
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Tue, 2009-11-03 22:41
floridave wrote:
Did this ever work?

Yes, it did. I was able to install new plugins and do other things under Site Admin.

floridave wrote:
I am also a bit confused as to the URLs versus the FTP locations. the URL provided does not have a direcotry yet the FTP access does.
Install gallery where your codebase is and see if it work there.

I can provide the structure of my multisite folders if needed. I believe any new gallery install will work. Either multistie or singlesite.

floridave wrote:
Your codebase site /km/gallery_code/ is using the same DB as the /km/gallery site.
Did you start with a site using the codebase?

I believe these two are the same. One is codebase used by multiple sites, another is single instance.

Konstantin.

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Tue, 2009-11-03 22:49
nivekiam wrote:
Dave asked me to look at this too.

I'm not that familiar with multisite installs either, but it appears your config.php for your main code base is an older version. Doesn't look like there are major discrepancies but it is older.

Did you follow these instructions?
http://codex.gallery2.org/Gallery2:Multisite#How_to_Upgrade_a_Multisite

I do find it odd that your other multi site installs are working fine and this one is not. But the others have their own database and login info, where the problem one is using the same DB as the main code base.....

Thanks,

I think I used "Multisite" instructions. I had different domains using separate code for each gallery installation, and then realized i can have them combined for easier management, especially, they all are hosted on the same ISP. Did combined them all on one miltisite gallery and it worked on pre 2.3 version. Then upgraded and installed 1 or 2 new plugins. Sometime after that I realized I can't login to Site Admin anymore. So, it does not look like bad singlesite to multisite migration, IMHO.

At his point I'm ready to look at other more time consuming options. May be decouple galleries? If you need login info to other members of multisite installation, please let me know.

Thanks for your help.
Konstantin.

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Tue, 2009-11-03 23:03

Update.

Just logged in to me 2 other galleries and under Site Admin went to Plugins. Both gave lovely:

Error 500 - Internal server error
An internal server error has occured!
Please try again later.

Under Maintenance I got this on both:

Error (ERROR_BAD_PATH) : Invalid path: modules/integrity/classes/IntegrityCheckTask.class

* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (gallerycoreapi::error)
* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 201 (galleryfactoryhelper_simple::newinstance)
* in modules/core/classes/GalleryCoreApi.class at line 175 (galleryfactoryhelper_simple::newinstancebyid)
* in modules/core/classes/helpers/MaintenanceHelper_simple.class at line 46 (gallerycoreapi::newfactoryinstancebyid)
* in modules/core/AdminMaintenance.inc at line 176 (maintenancehelper_simple::fetchtasks)
* in modules/core/SiteAdmin.inc at line 209 (adminmaintenanceview::loadtemplate)
* in modules/core/classes/GalleryView.class at line 293 (siteadminview::loadtemplate)
* in main.php at line 465 (siteadminview::doloadtemplate)
* in main.php at line 104
* in main.php at line 88
* in main.php at line 3

System Information
Gallery version 2.3
PHP version 4.4.9 cgi
Webserver Apache
Database mysqlt 4.0.27-max-log
Toolkits Thumbnail, SquareThumb, NetPBM, Gd
Operating system Linux infong 2.4 #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4

Is it symptom of something unfixable?

Thanks.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-11-03 23:19

I think part of your problem is your main code base and your problem site is using the same tables in the same database.

For this bad path problem make sure that the integrity module is in your main code base's modules/ directory.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Wed, 2009-11-04 01:42

OK. I fixed the bad path problem. You were right - integrity module was not in the modules folder! Works now. Main gallery is still sick, however. How do I make main code base and problem site to use different tables in DB? I was under impression that "main code base" is not using any tables in DB, only "working" galleries are.

K

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2009-11-05 00:25

I'm going to have to setup a multisite install to see what it takes.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-11-05 10:50
Quote:
How do I make main code base and problem site to use different tables in DB? I was under impression that "main code base" is not using any tables in DB, only "working" galleries are.

If I understand the multisite architecture correctly, the settings for any "main.php" - including which database and table-prefix it uses are in the adjacent config.php file.

If you want to use the main codebase to run a gallery installation (you don't have to) then the database settings for that are in the config.php file in the main codebase directory. The database settings for the multi-site (secondary installations) are in the config.php files adjacent to their own respective main.php files.

I think.

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Thu, 2009-11-05 16:50
alecmyers wrote:
Quote:
How do I make main code base and problem site to use different tables in DB? I was under impression that "main code base" is not using any tables in DB, only "working" galleries are.

If I understand the multisite architecture correctly, the settings for any "main.php" - including which database and table-prefix it uses are in the adjacent config.php file.

If you want to use the main codebase to run a gallery installation (you don't have to) then the database settings for that are in the config.php file in the main codebase directory. The database settings for the multi-site (secondary installations) are in the config.php files adjacent to their own respective main.php files.

I think.

If I try to access my /gallery_code/ directory from the web it gets redirected to /gallery/. I want to make it work as it was designed, and see if it solves my original problem. So, codebase is supposed to take care of all multisite instances, but not dedicated to any particular. And all single "small" /gallery/ folders are taking care of only its own galleries. Correct? If so, how do I proceed with this change, if it's needed?

Thanks,
Konstantin.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-11-05 17:20
Quote:
If I try to access my /gallery_code/ directory from the web it gets redirected to /gallery/

In general: things that cause Gallery or Apache to change the url:

- the baseUri parameter in the config.php file (at the end) - obviously you can have a different setting for every install, but if for some reason one is pointing to the url for another of your installs this will cause a lot of confusion! It's perfectly acceptable to leave the setting blank, and I think that's actually recommended for *all* installs, and personally I would recommend that.

- alias entries in your .htacess or apache setup

- a preexisting url-rewrite section in your .htaccess

Not sure if there are any others.

The mechanism by which the baseUri setting works is very straightforward, but can lead to subtle results. It's used every time Gallery needs to create a new url - which can be for links within a page, that you click on - and also for automatic redirects (that are effectively invisible to your browser - you just see the new page and url appear.)

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Fri, 2009-11-06 08:06

OK, I reinstalled codebase of 2.3 and recreated multisite instance for one gallery that was working using the same DB and gallery data folder. Now I can't login to Admin interface of this gallery at all. And because it had (still has) password protection on it, I can't view it. There are some plugins missing, but I don't think they are related. I don't see any errors in debug on Admin login attempt.

Very close to either "reinstall from scratch" or "look for alternatives"... :-((

K

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-11-06 09:44

I've come late to this party, so I'm not really clear what the issue that you're trying to solve is - is it just that you can't log in to one gallery? What happens if you try the password recovery procedure? or the emergency login procedure with the password from the relevant config.php? Could I ask you to restate the problem again? I know there's been a lot of discussion about multisite architecture, but multisite installs come up with the same problems as single-site installs, and it's possible we're overcomplicating things?

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Fri, 2009-11-06 15:17

Alecmyers,

Here is the "history of the patient".

I had multiple single site installations hosted on the same ISP, under the same account. They all were pre 2.3 versions. Then, at some point I decided to migrate them all into multisite gallery install. Followed instruction and successfully completed the process. All 3 worked ok. Then started put more modules in them and after a while realized I can't login to "Site Admin" on one of my gallery (Session Expired message). Could login to other, however. Posted help request here and with a great help of Dave and nivekiam discovered couple other things. Like the fact that my codebase config file is pointing to the same DB, that "problematic" gallery. Also, "good" galleries are giving me Internal Server Error 500 if I click "Plugins" link in Site Admin Section. In attempt to "divorce" codebase and "bad" gallery I performed fresh 2.3 install choosing Multisite option and pointing to DB and Data folder of one of my "good" galleries. All went smooth, but then I realized I can't login as Admin to it. Digging around showed that some of modules are missing, but I don't see them being responsible for authentication.

So, this is where I stand now: one and a half semifunctional galleries. :-(

As always, any help is appreciated.
Konstantin.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-11-06 15:35

OK - and where do you want to get to? Three multi-site installations? Or three standalone installations?

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Fri, 2009-11-06 15:38

Ideally, three _working_ multi-site installation. If not possible, three standalone.

K

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2009-11-06 15:48

Well, if you want to pm me some login details (can you run a shell on the host?) and urls I will have a look... no promises though.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2009-11-07 03:35

After a bit of investigation, I have an idea as to why you can't get to the Admin pages on your first site. Do you have phpMySQL available so I can look at the db contents?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2009-11-07 11:56

Well it's now nearly fixed.

Firstly you had an important (nay, critical) entry missing from a core DB table, which I put back in. That means you can get the admin functions going again as it doesn't throw you around telling your Admin session has expired continually. I am curious, but not prepared to speculate on why that entry was missing, how long it's been missing, and what else might be missing too (and still undetected as missing).

Secondly the 500 Errors are (it seems) a 1and1-ism of highest order: I fixed them on your main site with the information in this thread/post:
http://gallery.menalto.com/node/75506#comment-270361

I suggest you add those lines to the .htaccess of the other two sites (I've only worked on the /km/ one) and see if that fixes things there.

There is one curiosity that still concerns me: I've turned debugging to false in the config.php but the main gallery album is still showing a logged debug dump at the bottom of the page. There's no debugging info showing anywhere else that I can see and I don't know why it should still be happening on this page! I've cleared your template cache (that never helps, why does one bother?) - perhaps you could confirm that it is or isn't showing up for you?

Finally, *don't* have two copies of the codebase hanging around with similar names (g2_code, gallery_code) - it will confuse you as much as it confuses me, in a few months. Get rid of the one you're not using.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2009-11-07 15:54

Thanks Alec! You got to the root of that a lot faster than I ever could have.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Sat, 2009-11-07 22:12
alecmyers wrote:
Well it's now nearly fixed.

Wow! Thank you, Alec!

alecmyers wrote:
Firstly you had an important (nay, critical) entry missing from a core DB table, which I put back in. That means you can get the admin functions going again as it doesn't throw you around telling your Admin session has expired continually. I am curious, but not prepared to speculate on why that entry was missing, how long it's been missing, and what else might be missing too (and still undetected as missing).

What that entry is? And if something else is missing, is it worth completely redo the gallery without restoring DB from backup before the consequences of missing piece shows up its ugly head? The only thing in my galleries I'm regretting to loose is captions. I guess there is no way to restore captions only? The structure can be easily recreated b/c data folder replicates it.

alecmyers wrote:
Secondly the 500 Errors are (it seems) a 1and1-ism of highest order: I fixed them on your main site with the information in this thread/post:
http://gallery.menalto.com/node/75506#comment-270361

I suggest you add those lines to the .htaccess of the other two sites (I've only worked on the /km/ one) and see if that fixes things there.

Done it on /am/ and it works beautifully! Thanks again.

alecmyers wrote:
There is one curiosity that still concerns me: I've turned debugging to false in the config.php but the main gallery album is still showing a logged debug dump at the bottom of the page. There's no debugging info showing anywhere else that I can see and I don't know why it should still be happening on this page! I've cleared your template cache (that never helps, why does one bother?) - perhaps you could confirm that it is or isn't showing up for you?

It still an issue for me (but I think it worked ok on first view/login) and this is another reason why I'm willing to redo all 3 galleries. Also, third experimental gallery /kim/ is still unable to let me in as Admin at all. I guess this one will e first one to receive "refresh". Or should I wait till v3 is out of beta? ;-)

alecmyers wrote:
Finally, *don't* have two copies of the codebase hanging around with similar names (g2_code, gallery_code) - it will confuse you as much as it confuses me, in a few months. Get rid of the one you're not using.

Deleted.

Thanks, Alec, again! Pls check your PM.

Konstantin.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2009-11-08 02:08
Quote:
And if something else is missing, is it worth completely redo the gallery without restoring DB from backup before the consequences of missing piece shows up its ugly head?

Don't know if anything else is missing.

Quote:
The only thing in my galleries I'm regretting to loose is captions. I guess there is no way to restore captions only? The structure can be easily recreated b/c data folder replicates it.

Unfortunately the captions are tied to the the imageId, which are likely to be different if you start from scratch and reinstall.

Quote:
Or should I wait till v3 is out of beta? ;-)

Could be a long wait.

I'd love to know about the debug on the first page, why that's happening. Maybe Nivekiam or Floridave have a suggestion on that one?

 
constm

Joined: 2009-10-25
Posts: 19
Posted: Tue, 2009-11-10 02:20
alecmyers wrote:
Unfortunately the captions are tied to the the imageId, which are likely to be different if you start from scratch and reinstall.

I'll probably reinstall it and enter captions for all 31 (!) images manually. Found the mapping between g_id and file name in FileSystemEntity and g_ig <-> Title in g_Item table.

alecmyers wrote:
I'd love to know about the debug on the first page, why that's happening. Maybe Nivekiam or Floridave have a suggestion on that one?

I notice that 2 files were modified in code module. Replaced them with original ones and the debug problem gone... Go figure...

Thanks, guys, for your help.

Konstantin.

 
Liquid_Squelch

Joined: 2006-09-10
Posts: 15
Posted: Sat, 2010-03-13 04:53
alecmyers wrote:
Well it's now nearly fixed.

Firstly you had an important (nay, critical) entry missing from a core DB table, which I put back in. That means you can get the admin functions going again as it doesn't throw you around telling your Admin session has expired continually. I am curious, but not prepared to speculate on why that entry was missing, how long it's been missing, and what else might be missing too (and still undetected as missing).

I am suffering from the same problem at the moment.
What was the "Critical" missing entry?

I had a single install. To save space, I decided to create a multi-install out of it. My "main" gallery site is stuck in the admin loop. My "addon" gallery is working fine.

Thanks for the help