Attempting update to 2.3.1 hangs on 'mod_quiz'

Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -
Number of replies: 13

Hi there,

Been trying to update from 2.02 to 2.3.1 and its not been smooth sailing.

It gave me a list of 280 plugins to check, of which two appeared to be unsupported (oublogs and something else), so I deleted them and tried to continue the process.

There were no other apparent hang ups - all plugins are marked as one of the following: "to be upgraded" "installed" or "to be installed". The first on the list is 'quiz' which is marked 'to be upgraded'.

However, when I press "upgrade Moodle database now" the next page is blank apart from 'mod_quiz', but it hangs. Nothing else happens.

Can someone help out with what is going on here? I can still access my pages but except for the quizzes, for which I get an error message.

I'm getting bad vibes that I might have lost all the quizzes that I painstakingly created.

Can someone help with what I can do to get this thing sorted out?

Thanks in advance.

 

 

 

 

Average of ratings: -
In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Sorry I can't help on the technical side but can you confirm you upgraded from 2.0 to 2.2 first before trying to go to 2.3? According to the upgrading documentation http://docs.moodle.org/23/en/Upgrading this is the path you should take.

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You may need to restore the backup that I hope you took.

As Mary says, upgrade to 2.2 first, BUT, before you do that switch on debugging in Site administration > Developer. This may give you more information if it all goes wrong.

If you are still stuck, we'll need to know more about your system - especially versions of PHP, MySQL etc.
In reply to Howard Miller

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

Thanks very much for your help.

Unfortunately my backup seems to be corrupted. I will have another try at this though, I may have done something wrong.

My host is 'siteground' and according to the php manager, I'm on php 5.3.10 (cgi-fcgi). I couldn't find the version of MySQL...

I did as you suggested and turned on 'debugging'. Now after the plugins page I get the following error message:

mod_quiz

Fatal error: Access level to qtype_regexp::questionid_column_name() must be public (as in class question_type) in /home/lifeofle/public_html/HUFS/question/type/regexp/questiontype.php on line 237

 

Hope this helps

Thanks again for helping

David

 

 

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ok... regexp, isn't a standard question type. Did you replace the old 1.9 code for that question with a new 2.x version? If you didn't is this because you wrote the new 2.x code over the top of your old 1.9 (a very bad thing)?

Anyway, if you have added custom code get rid of it. It might help. We can work on those bits later.

If you did write over the top then junk that code and replace it with a completely fresh 2.x (whichever version you are using). The only thing you need to do is to recreate config.php (by copying config-dist.php) with all the correct settings.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

Thanks for the quick reply Howard, I wrote the reply about the backup before I saw it.

You are several steps ahead of me here. I can assure you I've done no writing of code.

1. How do I get rid of the offending code? Presumably its in line 237 of a file and I should open this up and delete it?

2. "replace it with a completely fresh 2.x" - wouldn't this be done automatically by the update process to 2.3.1? Or should I find fresh code somewhere else.

Thanks again for your help, really appreciating it.

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Ok... I didn't suggest you did write code but somebody must have added the 'regexp' question type. It isn't there in a standard download of Moodle, so how did it get there? Given that it is there, is it the correct version? Which brings me to...

What is *your* understanding of 'update process'? Are you using one of these script things to update Moodle or did you download it yourself from moodle.org? If the former we are in trouble... I hate these things because we have absolutely no idea what they are doing (or doing wrong).

To delete the plugin, you need to delete the entire directory (question/type/regexp) and its contents. It's more important to understand why this code is there in the first place though as there may well be other problems.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

Hi Howard, thanks for the advice,

My understanding of the 'update process' comes from what usually happens when I upgrade a program. I realise now that this is not possible with moodle. I will take more care in the future.

I am doing this update as I have done so successfully in the past, through the siteground management software 'softaculous'. I guess this is a 'script thing' you referred to. Sorry.

I followed your suggestion of removing the 'regexp' folder, and the update process has made progress. I moved through several other screens, clicking 'continue' and 'next' appropriately, though the debug was still throwing up a lot of error code. 

Anyway I thought that I had miraculously come out the other side smelling of roses until I tried to log in. This is what I get:

XML Parsing Error: junk after document element
Location: http://www.Notmyrealaddress.com/online/
Line Number 1, Column 1870:<div class="notifytiny">Invalid get_string() identifier: 'healthcenter' or component 'moodle'.
Perhaps you are missing $string['healthcenter'] = ''; in lang/en/moodle.php?<ul style="text-align: left"><li>line 6592 of /lib/moodlelib.php:

call to debugging()</li><li>line 7216 of /lib/moodlelib.php:
call to core_string_manager->get_string()</li><li>line 8 of /admin/settings/unsupported.php:
call to get_string()</li><li>line 5919 of /lib/adminlib.php:
call to require()</li><li>line 3389 of /lib/navigationlib.php:
call to admin_get_root()</li><li>line 3294 of /lib/navigationlib.php:
call to settings_navigation->load_administration_settings()</li><li>line 713 of /lib/pagelib.php:
call to settings_navigation->initialise()</li><li>line 729 of /lib/pagelib.php:
call to moodle_page->magic_get_settingsnav()</li><li>line 133 of /blocks/settings/block_settings.php:
call to moodle_page->__get()</li><li>line 281 of /blocks/moodleblock.class.php:
call to block_settings->get_content()</li><li>line 232 of /blocks/moodleblock.class.php:
call to block_base->formatted_contents()</li><li>line 929 of /lib/blocklib.php:
call to block_base->get_content_for_output()</li><li>line 981 of /lib/blocklib.php:
call to block_manager->create_block_contents()</li><li>line 352 of /lib/blocklib.php:
call to block_manager->ensure_content_created()</li><li>line 6 of /theme/canvas/layout/frontpage.php:
call to block_manager->region_has_content()</li><li>line 765 of /lib/outputrenderers.php:
call to include()</li><li>line 712 of /lib/outputrenderers.php:
call to core_renderer->render_page_layout()</li><li>line ? of unknownfile:
call to core_renderer->header()</li><li>line 1445 of /lib/setuplib.php:
call to call_user_func_array()</li><li>line 98 of /index.php:
call to bootstrap_renderer->__call()</li><li>line 98 of /index.php:
call to bootstrap_renderer->header()</li></ul></div><?xml version="1.0" encoding="utf-8"?>

[It was in one lone string before, I hit 'return' before every 'call to'.]

Any suggestions for clearing this obstacle? Or is my site now truly dead?

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Have you got 'xmlstrictheaders' switch on in Debugging?

In your config.php file add the following line somewhere between the global $CFG and the require_once() at the end...
 
$CFG->xmlstrictheaders = 0;

and see what happens.

Yeh - Soft-a-thingy.... this is the problem, we don't know what it does/did which makes this very difficult.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

Thanks!

Well, not sure if I had switched the 'xmlstrictheaders' switch on or off and  there was no way of checking, but I edited the line you gave me into config.php, and thank you very much, I have my site back!

In front of every page though I still got a long list of errors, which I've swept under the carpet by switching Debugging back to 'normal'.

Is there any way of sorting those errors out? Is it usual to have so many? Should I be worried about them?

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes you should... Let's have them smile
In reply to Howard Miller

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

Hi Howard,

Sorry for slow reply, somehow missed this message! Wow, really appreciative of your continuing help.

Okay here are the error messages that appear when I click on 'home' or any of the courses:

Invalid get_string() identifier: 'healthcenter' or component 'moodle'. Perhaps you are missing $string['healthcenter'] = ''; in lang/en/moodle.php?

  • line 6592 of /lib/moodlelib.php: call to debugging()
  • line 7216 of /lib/moodlelib.php: call to core_string_manager->get_string()
  • line 8 of /admin/settings/unsupported.php: call to get_string()
  • line 5919 of /lib/adminlib.php: call to require()
  • line 3389 of /lib/navigationlib.php: call to admin_get_root()
  • line 3294 of /lib/navigationlib.php: call to settings_navigation->load_administration_settings()
  • line 713 of /lib/pagelib.php: call to settings_navigation->initialise()
  • line 729 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
  • line 133 of /blocks/settings/block_settings.php: call to moodle_page->__get()
  • line 281 of /blocks/moodleblock.class.php: call to block_settings->get_content()
  • line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 929 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 981 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 352 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 6 of /theme/canvas/layout/general.php: call to block_manager->region_has_content()
  • line 765 of /lib/outputrenderers.php: call to include()
  • line 712 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 225 of /course/view.php: call to core_renderer->header()

  If I click on Site administration - 'Debugging' I get a longer list,which I have copied into a txt file and attached.

 

 

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by David Leaper -

For back up, I've downloaded a zipped file that is 432megs and has a whole bund of folders (admin, auth, backup, blocks, blog are the first 5) but according to a note on the website this is only a partial back up (apparently they don't do full backups on sites that exceed 500MB).

Is there any way of checking what I've got?

I've also found a "MySQL Database Backup" and have downloaded a 'gz'  file from that that is only 13.41MB.

Sorry to be so clueless about all this!

In reply to David Leaper

Re: Attempting update to 2.3.1 hangs on 'mod_quiz'

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I know this isn't terribly helpful, but it's REALLY important to take good backups and check them...

You mostly need two things...

1. A backup of your moodle database. There's usually some mechanism to export the full database as a very long list of sql commands. The resulting file is just a text file (sometimes zipped) and won't be all that long.

2. The contents of your 'moodledata' directory where all your file uploads go. This is what $CFG->dataroot in your config.php file points at. This is a simple copy of all the files and directories in that tree. A simple recursive zip of the top directory is usually easiest. How big this is depends how much stuff you have uploaded and how many course backups you take etc.

The backup you have sounds like the actual moodle program files. While it's not unreasonable to take a copy (especially if you have made additions) this can always be downloaded again from moodle.org so it's not a disaster losing it. The other two probably will be.

Don't ever, ever attempt an upgrade unless you understand how to take backups and are sure you have done it properly.