How do I unset maintenance mode if there's a JASON error on the frontend.

How do I unset maintenance mode if there's a JASON error on the frontend.

by Tanya Lasuk -
Number of replies: 8

I have been trying for a week to update moodle from 2.85+ to 3.4.  I find little in the documentation that deals with the problems I've been having - now I finally updated to 3.0. I followed the advice and put the site into maintenance mode. So I did the update (the database is already in mariaDB and php is already 7.0) and when I clicked on the Site Administration menu item. I got a JASON error message and the dropdown didn't function. So I logged out and of course now all I get is the maintenance html page with no login. 

I could disable the maintenance mode from the back end if I knew how. But don't even know what to put in the search for the documentation or the forum. 

Can anyone give me some help on this?

OR is anyone available who has in depth moodle knowledge that would be available to be a paid consultant to fix this mess? 

Average of ratings: -
In reply to Tanya Lasuk

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Ken Task -
Picture of Particularly helpful Moodlers

Let's try to address the maintenance mode first ...

With a browser go directly to:

https://yoursite/login/

where [yoursite] above is the URL to your site.

Login as admin level user/admin account.

You should be thrown into your Dashboard page.   Look right ... 'In mainentance mode' link on the right/top.
Clicking that should take to the form for disabling.

There still might be issues with the site.

To attempt to see what might be wrong, shouild be able to do the same thing as above for getting out of maintenace mode but turning on 'debugging'.   Note, once on, errors wiil display ... you are only turning it on to get error screen shots or text clips of the errors into a text document that you could use then to come back to this thread and share what they shown.

To get to Debug:

https://yoursite/admin/settings.php?section=debugging

Set it to 'Developer' then Save Changes.

Navigate back to front page and try stuff.

copy errors to text file.

To get out of debugging ...

same url as above and then set it back to "none"

While you are at it, let's see if you can view the phpinfo page in Moodle:

https://yoursite/admin/phpinfo.php

Looking for a json section there ... that's to check if json is loaded in PHP.


'spirit of sharing', Ken


In reply to Ken Task

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Tanya Lasuk -

Thanks Ken for the quick response - 


there are two directories under the top url www.safe-sravastiabbey.org 

moodle where the 3.0 installed itself and moodle2 where 2.85+ was installed. 

the moodle2 was where the maintenance mode was on. 

I was guessing with the new install and the .htaccess and config.php pointing to moodle, I wasn’t noticing that I was still in moodle2. 

With redirection to  www.safe-sravastiabbey.org/moodle (where the update to 3.0 was put) I’m getting this error below. Clicking on the more information I get more comments about there being a coding error but not what it could be. 


Sravasti Abbey Friends Education

Coding error detected, it must be fixed by a programmer: The data source class does not exist.

More information about this error



 

BTW, when I activated the SSL on safe-sravastiabbey.org all the styling disappears on this website so I’m using www,safe-sravastiabbey.org to avoid that issue for now. 

I’m hoping it has to do with not being in the most recent version of moodle 

charmingly, the ~admin/settings.php?section=debugging worked.


has this error set over and over 



String does not exist. Please check your string definition for numyear/moodle
  • line 9706 of /lib/moodlelib.php: call to debugging()
  • line 79 of /admin/settings/appearance.php: call to lang_string->__construct()
  • line 6931 of /lib/adminlib.php: call to require()
  • line 7035 of /lib/adminlib.php: call to admin_get_root()
  • line 42 of /admin/settings.php: call to admin_write_settings()

going back to the home page 
Debug info: 
Error code: codingerror
Stack trace:
  • line 498 of /cache/classes/definition.php: coding_exception thrown
  • line 515 of /cache/classes/helper.php: call to cache_definition::load()
  • line 480 of /cache/classes/helper.php: call to cache_helper::purge_store()
  • line 323 of /admin/index.php: call to cache_helper::purge_all()

and when i looked at the ~admin/phpinfo.php


I get this error

String does not exist. Please check your string definition for linkcoursesections/admin
  • line 9706 of /lib/moodlelib.php: call to debugging()
  • line 162 of /admin/settings/appearance.php: call to lang_string->__construct()
  • line 6931 of /lib/adminlib.php: call to require()
  • line 6818 of /lib/adminlib.php: call to admin_get_root()
  • line 7 of /admin/phpinfo.php: call to admin_externalpage_setup()
Unfortunately, when I went back to undo the debug, there was a black box over the top part of the page - I think it's part of the styling gone haywire  - covering the part where I would turn the debugging off. 

Would be nice to be able to do these setting in the backend. 

In reply to Tanya Lasuk

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Ken Task -
Picture of Particularly helpful Moodlers

/moodle/ 3.0
/moodle2/ 2.85+

The site at moodle2 may no longer function under php 7.0.28
Unless you can change the version of PHP on your server per directory.

Server: Apache
X-Powered-By: PHP/7.0.28

Settings in backend ... to do that, one would need ssh into server.
Assuming it is Linux (curl test), but what flavor ... Ubuntu/CentOS/Other ... makes a diff on the 'backend' ... a little ...you've not shared that info yet,

One would need to, at the very least, edit the config.php file.
Moodle files are not for non-programmers.

Your site at http://safe-sravastiabbey.org/moodle
(note no www.) is the 3.0.

Backend ... ssh into server.  Change to the location of the 'moodle' directory,
that's the 3.0.
Edit the config.php file ... carefuily.

Find the line for the url to your site.
Change the line to: http://www.safe-sravastiabbey.org/moodle/

https:// on your site is broken.
COMODO RSA Domain Validation Secure Server CA
is not installed correctly.

Check web server logs for hints/clues
Check Comodo page for how to install the cert properly
https://ssl.comodo.com/support/ssl-certificate-installation-in-apache.php

You must get your site to ressond to https:// on port 443 properly
before switching your moodle to https:// - no broken lock.

That requires two steps ...
edit the config file again ... chaning http to https
and running the search and replace via the web.

For some technical issues, you might need to refer to the docs/faqs/forums where host;

https://www.namecheap.com/hosting/

'spirit of sharing', Ken


In reply to Ken Task

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Tanya Lasuk -

Thank you Ken, for your quick & thorough responses. It's really kind of you to take so much time offering help to complete strangers like me. 

I am now certain that my only route is to delete all this previous moodle mess and  start with a fresh install.  

Most of your remarks confirm that I have done things properly except the base I'm working with is hopelessly corrupt in a way the would take hours and hours to uncover by someone with expertise in moodle.  

There is only issue that will be affected going forward.  This the SSL. Namecheap has verified that the SSL is installed properly. I discovered the styling problem by changing the config.php file so yup got that. What I don't understand is this:

and running the search and replace via the web.

Please explain what you mean. Are you suggesting I use cpanel to search for "http:// "in the files or is this something done from the front end or something else?




In reply to Tanya Lasuk

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Ken Task -
Picture of Particularly helpful Moodlers

First, S&R is a tool that can wreck your site if you don't enter parmeters correctly ... sooo ...

do this first *** make a backup of your DB *** an sql dump ... which has to be done from your tools in the cPanel of your hosting *if* you do NOT have ssh access to your server.   Might also make note you need to research how to restore that .sql  file IF something goes wrong.

The 'search and replace' is a hidden admin tool in moodle that one calls up via direct URL:

http://yoursite/admin/tool/replace/

You will be presented with a form and 2 input boxes ...

The 3.0 you installed with http://domain/moodle/   and it should have been installed with http://www.domain/moodle/

Top box search for http://domain/moodle/

Replace box replace with http://www.domain/moodle/

Use the protocol in front (http://) and in this case *do* end both search and replace with the trailing 'slash'.

If you are sure the cert is installed correctly, then one could search for:

http://domain/moodle/

replace with

https://www.domain/moodle/

You are then chaning the protocol from http to https protocol and, at the same time, adding the 'host' as it is in config.php file of your code.

Just checked your sites/pages.

Looks like all of the above is now negated as certs now work (they did not before ... I don't care what they told you!)

https://safe-sravastiabbey.org/ shows a Moodle 3.4.

So does /moodle2/

Well, at least you got a quickie on search and replace - which I should have pointed you to:

https://docs.moodle.org/33/en/Search_and_replace_tool

What happened to old site(s)?

'spirit of sharing', Ken



In reply to Ken Task

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Tanya Lasuk -

Thanks Ken for checking up on me. 

No sweat - we backed up everything in the old sites and my cohort has a local test site where she  created and tested the 3.4.2 install. 

We 86'd the old site on the host server and did a new install.  We are delighted to see everything working including the SSL.

We decided creating a new database and reload our materials (all 12 courses) would be more fun than spending any more time with what we were dealing with. 


In reply to Tanya Lasuk

Re: How do I unset maintenance mode if there's a JASON error on the frontend.

by Ken Task -
Picture of Particularly helpful Moodlers

Good that you have someone local to you helping - trying to get techncial support via EMail is the pits! :\

Also wise to take the path chosen ... fresh install/restore backups ... as that is, considering versions and detination desired, perhaps the path of least resistance at this point.    But even in failure one might have learned something one didn't know before so there is gain. ;)

However, having said that, let me encourage you not to wait sooooooo loooooong next time to upgrade ... 2.8.x to 3.4.highest is quite a jump.

'spirit of sharing', Ken