Cannot Access Site Admin

Cannot Access Site Admin

door Prineshan Amichand -
Aantal antwoorden: 10

Good Day , i get the below error when trying to access the site admin panel .

Need urgent help as out site is down now.

SyntaxError: Unexpected end of JSON input    at JSON.parse (<anonymous>)    at Object.Y.namespace.parse (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:12819:18)    at BRANCH.ajaxProcessResponse (http://theleadershipcentre.net/moodle/theme/yui_combo.php?m/1475244990/block_navigation/navigation/navigation-debug.js:36:289)    at Y.Subscriber._notify (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:2010:35)    at Y.Subscriber.notify (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:2039:24)    at Y.CustomEvent._notify (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:1702:17)    at Y.CustomEvent._procSubs (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:1828:36)    at Y.CustomEvent.fireSimple (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:1795:18)    at Y.CustomEvent._fire (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:1777:29)    at IO.fire (http://theleadershipcentre.net/moodle/theme/yui_combo.php?rollup/3.15.0_1/yui-moodlesimple.js&rollup/1475244990/mcore-debug.js:2930:22)


Gemiddelde van de beoordelingen:  -
Als antwoord op Prineshan Amichand

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

Your site is behind/using CloudFlare (CF).   CF works as a content delivery system (speeds up access) but it can also function as an un-intended 'firewall' preventing things your Moodle needs to acquire.

Suggest checking into the setup of your CF and especially any CF settings related to js (javascript) files.

Best of luck!

'spirit of sharing', Ken


Gemiddelde van de beoordelingen:  -
Als antwoord op Ken Task

Re: Cannot Access Site Admin

door Prineshan Amichand -

Hi Ken , thanks for your feedback. We have deactivated cloudflare and still get the same thing. I tried to uninstall a plugin and the site crashed coming up with the same error. Do you have any other suggestions.

Regards


Prineshan

Gemiddelde van de beoordelingen:  -
Als antwoord op Prineshan Amichand

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

How did you 'deactive' Cloudflare?   Site DNS check still shows a CF IP address.   Now if you meant disable inside your controls of CF, then is there also a 'clear cache' there?

The fact that you attempted to remove a plugin means you could get to an 'admin' link, so that's confusing.

What plugin did you attempt to remove?

Dunno what 'crashed' looks like ... but can see a login screen now for the site.

So ... look at config-dist.php Section 7 for debug lines.   Add the debug lines from config-dist.php to your active config.php file.   No need to restart anything, just hit the site with a browser and attempt to access anything in Site Admin menu.

Let's see what Moodle might be able to tell us that's additional.

Also ... you've something in front of Moodle on that server.   It's https ... but moodle, according to what links you shared earlier, is using http://   Cert for server should apply to all subdirectories.   So what's in the config.php file for the site?   http:// or https://

Might also share info about your setup ... platform, Moodle version, etc.

'spirit of sharing', Ken

Gemiddelde van de beoordelingen:  -
Als antwoord op Ken Task

Re: Cannot Access Site Admin

door Prineshan Amichand -

Hi Ken , thank you for your feedback . I was able to restore the moodledata folder and that brings my site with the admin feature back up . As soon as i try to install or uninstall a plugin i get the error as per the previous screenshot.

The front end of the wordpress site uses https but moodle uses http. I have contacted Aosis to assist me and await their feedback . They think it might be a bad plugin previously installed causing the site to into and endless loop when we try to install or uninstall anything.

I will let you know on our progress.


Once again thank you for your support.


Gemiddelde van de beoordelingen:  -
Als antwoord op Prineshan Amichand

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

Uhhhh ... how *old* was the backup of the moodledata folder you've restored?   Was the restore the entire moodleata?

More often than not, since Moodle also caches (just like CloudFlare) if there is an issue with caching, one simply manually removes the contents of moodledata/cache/ and /moodledata/localcache/  .... not the entire moodledata directory which contains a 'filedir' directory which needs to match the meta data in the database or site gets 'orphaned files' ... one way or another ... pointer in DB but file doesn't exist in filedir or file exist in filedir and there is no reference to it in mdl_files table.

See if you can navigate directly to the plugins area:

http://yoursite/moodle/admin/plugins.php?updatesonly=0&contribonly=1

which should show additional plugins only and also which ones might need updating.

All plugins

http://yoursite/moodle/admin/plugins.php?updatesonly=0&contribonly=0

'spirit of sharing', Ken



Gemiddelde van de beoordelingen:  -
Als antwoord op Ken Task

Re: Cannot Access Site Admin

door Prineshan Amichand -

The restore was the entire moodledata folder. Backup date was 02/02/2018. Cannot navigate directly to the plugin area. It redirects me to a moodle login page . When i try to login with admin credentials i get the attached error.

yet if i login with the url : theleadershipcentre.net/moodle/my it takes me in but still cannot access the site admin. If i do a restore of the moodledata folder , i will have access to the site admin but cannot install ,update or install plugins. 


Thanks 

Prineshan



Bijlage Capture.JPG
Gemiddelde van de beoordelingen:  -
Als antwoord op Prineshan Amichand

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

At document root of your server you have a WordPress with woo_commerce.   That could have/involve an .htaccess file (the 'dot' in front of that file hides it from normal viewing and access by browser) that's controlling access to every folder (including the moodle folder) and possibly creating your issue.   That in addition to CloudFlare which is still active.

WordPress itself has plugins that help protect and with a woo-commerce plugin, I would imagine you do have security type plugins installed in the WordPress.

So a couple of things ... ask the technical people administering the server if they upgraded anything in WordPress recently.

Ask your technical people to check out what's in .htaccess and any security plugin of the WordPress.

This might help:

https://woocommerce.com/2015/09/ecommerce-redirect-guide/

woo_commerce info: https://edwiser.org/

At this point, I'd say it's not strictly a Moodle specific issue - but a combo ... CloudFlare, woo_commerce/WP + Moodle caching but Moodle is on the tail end of the other two.

I would, however put back the moodledata directory you restored (if you can do that) or risk self-made issues that you might not discover for some time and that might not be reversible.

'spirit of sharing', Ken


Gemiddelde van de beoordelingen:  -
Als antwoord op Prineshan Amichand

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

Found a reference in forums reporting the same issue:

https://moodle.org/mod/forum/discuss.php?d=325660

Check server logs for: Fatal error: Allowed memory ....

If that is present in error log, increase the value of amount of memory a PHP script can consume.   That error shows how much more the script tried to allocate and couldn't so increase the value by enough to cover what Moodle is seeking.

'spirit of sharing', Ken

Gemiddelde van de beoordelingen:  -
Als antwoord op Ken Task

Re: Cannot Access Site Admin

door Ken Task -
Foto van Particularly helpful Moodlers

In digging some more ...

Your Moodle version is 2.7.x
Future versions of Moodle I've read won't be using YUI (Yahoo libraries) in the future.

I happened to have access to a 2.7.highest and it's not having the issues you've described.
Maybe because of those two related settings:

AJAX and Javascript

Use online YUI libraries useexternalyui
Default: No

Instead of using local files, use online files available on Yahoo‘s servers. WARNING: This requires an internet connection, or no AJAX will work on your site. This setting is not compatible with sites using https.

YUI combo loading yuicomboloading
Default: Yes

This options enables combined file loading optimisation for YUI libraries. This setting should be enabled on production sites for performance reasons.


Since you cannot access the admin menus to check/set, two possible options:
option 1 (since you do have access to files might be quickest fix). add lines to config.php
$CFG->useexternalyui="1";;
$CFG->yuicomboloading="1";

The site am viewing for settings is https and has no issues - so that appears to be a semi-conflict of tip and how it really functions.   And the site is the highest 2.7.x there is in that series.

2. edit the mdl_config table (you might let technical folks handle this one)

select * from `mdl_config` where `name` like "%yui%"

To see how those values are set in DB and set them in the DB.

Now I am out of 'educated guesses'!

'spirit of sharing', Ken


Gemiddelde van de beoordelingen:  -
Als antwoord op Ken Task

Re: Cannot Access Site Admin

door Prineshan Amichand -

Hi Ken, just wanted to let you know that our moodle site is back up. According to the team from Aosis it was a corrupt plugin that caused the issue.

Thank you very much for your support .


Regards

Prineshan

Gemiddelde van de beoordelingen:  -