Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

by Billy Zwiener -
Number of replies: 4

I recently moved my Moodle 2.9 installs over to a new dedicated server from a VPS. Everything functions fine BUT when trying to access the "site admin" tab it logs me out (or any admin account gets logged out attempting to access that resource) and gives the error:


Error

Course or activity not accessible.


Debug info: You are not logged in Error code: requireloginerror


* line 2558 of /lib/moodlelib.php: require_login_exception thrown

* line 32 of /lib/ajax/getsiteadminbranch.php: call to require_login()



Where might I start to correct this? Thanks for any ideas.



Average of ratings: -
In reply to Billy Zwiener

Re: Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

by Ken Task -
Picture of Particularly helpful Moodlers

With moodle, there's caching .... *everywhere* ... so do these and see if it doesn't straighten out.   Do them in order shown and if 1 does work by iteself then repeat the process adding the next # before trying again with browser. (yeah, I know, pain in arse, but ....)

1. clear cookies and caches in your browser.

2. purge caches on server ... either via Admin Menu (but if you can't get there via menus then go directly: http://site/admin/purgecaches.php ... if that doesn't work, then one can also run:

php purge_caches.php  via command line in moodlecode/admin/cli/

3. manually remove any contents in moodledata/sessions and manually remove the contents of moodledata/cache/ (both of those should be safe to do because they are rebuilt as users login/click around ,etc..

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

by Billy Zwiener -

Thank you, Ken!

I got through #2 and whats weird is it WILL work and allow me to access admin after I purge the caches but only once... meaning, once I navigate there and go elsewhere and then try and return it throws an error that reads as follows. Also noteworthy is I can return to purge the caches manually using http://site/admin/purgecaches.php and it will fix this (but again only for one use)

Error

Course or activity not accessible.
URL:null
Debug info:null
Stack trace:
null
In reply to Billy Zwiener

Re: Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

by Ken Task -
Picture of Particularly helpful Moodlers

In another posting you asked about setting up a proxy while the site was being migrated to new home.   Did, by chance, you leave that proxy on and configured?  

In a proxy setup there is a forward ... server accessed rec. a url and the proxy piece in between sorta re-points to the real service (URL) etc.   There is also a reverse proxy configured so that the client that requested can rec. the page content requested via the URL client sent.

This last error screen sort indicates the proxy ain't working - errors can't be returned to client ... which would be a good protection thang running a proxy.

Is there a need for proxy still?   Remove proxy settings that might be config.php file of Moodle.   Removing those proxy lines in config.php doesn't require restart of services IF the proxy config of the apache server/service is OFF.

If you re-call ... you granted me access to your server some time ago to check things out ... I can login.  I can click on admin menus and navigate around without issue of being logged off.   My browser doesn't have any proxy settings in it and I don't get any errors like you are seeing.

Comment: ... been there done this ... my own worst enemy.   By that I mean, doing things that aren't familiar or within current experience upon someone's (new provider) recommendation and it's not really needed.  Then couldn't re-call how to un-do what I did! :\

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle 2.9 after migration to new server I get an error when trying to access Site Admin resources

by Billy Zwiener -

Thanks again, Ken. Yes, I just got done communicating with the host and they say it appears to be fine and that it's the proxy that's messed up. So that said, I think I was frustrated and wasting time just because of something else not working properly... Which the host admits is the proxy they told me to use smile ha... Thanks for your time, Ken! You're awesome!