upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by trudy k -
Number of replies: 11

i have a problem with upgrading my (test ) site. I am stuck somewere at the end of the process (i think) at:

 The error i receive is:

workshopform_accumulative

Copying assessment forms elements

Copying assessment form grades

Error writing to database

More information about this error

Debug info: Column 'assessmentid' cannot be null
INSERT INTO mdl_workshop_grades (assessmentid,strategy,dimensionid,grade,peercomment,peercommentformat) VALUES(?,?,?,?,?,?)
[array (
0 => NULL,
1 => 'accumulative',
2 => '224',
3 => 2,
4 => 'ja',
5 => '1',
)]

Stack trace:

  • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 816 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 858 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 82 of /mod/workshop/form/accumulative/db/upgradelib.php: call to mysqli_native_moodle_database->insert_record()
  • line 47 of /mod/workshop/form/accumulative/db/install.php: call to workshopform_accumulative_upgrade_legacy()
  • line 305 of /lib/upgradelib.php: call to xmldb_workshopform_accumulative_install_recovery()
  • line 1352 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 302 of /admin/index.php: call to upgrade_noncore()


I solved several problems during this upgrade (eg problems with database - Illegal mix of collations utf8_unicode_ci, and utf8_general_ci)

but now i am stuck.

Any idee?

thanks

 

 

Average of ratings: Useful (1)
In reply to trudy k

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Hi Trudy,

I am the one who wrote the part of the code that makes you worry. Apparently, your database contains some invalid data that are not supposed to be there. In details, there are some orphaned grade records in your 1.9 workshop table that are not linked with any assessment.

You can fix it by direct access to your database only. You should fix your database before you start the upgrade to 2.0. Of course, I assume it is still your test site and you have full backup of your production environment. Firstly, lauch your favourite MySQL client and run

mysql> SELECT * FROM mdl_workshop_grades WHERE assessmentid IS NULL;

That will probably give you some results - those orphaned grades without the assessment. You can delete them with

mysql> DELETE FROM mdl_workshop_grades WHERE assessmentid IS NULL;

That should not influence your workshops as the orphaned grades are not owned by any user.

In reply to David Mudrák

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by trudy k -

thank you for your answer.

result of first query returns empty. sorry.

I checked the mdl_workshop_grades table and see  some negative weights (-1) can this be the problem????

and yes this is test site and I have full backup of my production environment with over 500 courses. I am testing the upgrade because i like to use the new 2.0 wen it is stable and like to set a timepath ie for internal communication in my schools.

so I like to solve this issue if possible.

In reply to trudy k

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by trudy k -

started all over again with backups and upgrading, now version 1.910 to daily 2.0 built.

Again the upgrade stoped at the same error at workshopform_accumalative table.

after removing te workshop module from the mod/ directory the installation completed succesfull. But this is not a option. Workshop module is fairly heavy used by our teachers.

anything to do with the negative grades in the table???

 

In reply to trudy k

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Trudy, maybe you found a bug in workshop upgrade code then. It is great you have 1.9 workshops to test the upgrade on - I did not have a chance to test it massively with production data yet. Do you think you could send me the SQL dump of your 1.9 database so I could try to debug it on my computer? I promise I will not provide the data to any other 3rd person/party and will keep them private.

Regarding the negative weights - it should not cause the problem (but who knows). Anyway note that negative weights are not supported any more in Workshop 2.0 and your teachers should be informed about that (actually Workshop has changed much in 2.0 and may even produce slightly different grades in the new version due to number of bugs fixed).

I am going to move this thread into the Workshop module forum.
In reply to David Mudrák

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by trudy k -

hoi david

it can be a bug, happy to help testing. my database is more than 2 gb

how do i sent you?

my email is t.koedooder@amarantis.nl

 

In reply to trudy k

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Hi Trudy,

my suspicion was correct though the SQL above to test was not. I have analysed your database and there are inconsistencies between workshop_grades and workshop_assessments tables. One of your assessment record was somehow removed but the linked grades remained and that threw the upgrade record. To find those orphaned grades record you can use

SELECT g.id, g.assessmentid
FROM mdl_workshop_grades g
LEFT JOIN mdl_workshop_assessments a ON g.assessmentid = a.id
WHERE a.id IS NULL;

and it will give you eight grade records that refer to a non-existing assessment.

I am going to patch the upgrade code in workshop so that it handles this case as well. So either you can remove those grades manually or wait for tomorrow's Moodle 2.0 build to test again with.

By the way, I have spotted yet another upgrade problem in MNet thanks to your dump - thank you for it!

Average of ratings: Useful (2)
In reply to David Mudrák

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by trudy k -
thank you! glad my DB was usefull. I will try the upgrade again, i hope next week, with the new moodle 2.0 build.
In reply to David Mudrák

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by Fr de Thysebaert -

Hi I found this post about migration from 1.9+ to 2.0+  version and error in mod_workshop with stop fails statement

Can you help me with my own error during migration process. Thanks

error is :

mod_workshop
Renaming old workshop module tables
Preparing new workshop module tables
Copying workshop core data
Copying submissions

Can not find data record in database.

More information about this error
Debug info: SELECT cm.*, m.name, md.name AS modname
FROM {course_modules} cm
JOIN {modules} md ON md.id = cm.module
JOIN {workshop} m ON m.id = cm.instance

WHERE m.id = :instance AND md.name = :modulename

[array (
'instance' => '19',
'modulename' => 'workshop',
)]
Stack trace:

* line 1259 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1407 of /lib/datalib.php: call to moodle_database->get_record_sql()
* line 253 of /mod/workshop/db/upgradelib.php: call to get_coursemodule_from_instance()
* line 124 of /mod/workshop/db/upgrade.php: call to workshop_upgrade_submissions()
* line 490 of /lib/upgradelib.php: call to xmldb_workshop_upgrade()
* line 265 of /lib/upgradelib.php: call to upgrade_plugins_modules()
* line 1352 of /lib/upgradelib.php: call to upgrade_plugins()
* line 290 of /admin/index.php: call to upgrade_noncore()

In reply to Fr de Thysebaert

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Hi,

firstly make sure that you really need old workshops migrated to the 2.0 server. Many sites did not have any real workshops and then it is better to uninstall the workshop module from your 1.9 server before you start the upgrade.

Anyway, the thrown problem indicates problems in your database integrity. Particularly, there are some workshop module instances without the corresponding course_module record. This might happen as a result of some problems with restoring a course in the past, for example.

To make sure that is your case please run the following query at your 1.9 database (before the upgrade attempt) and let me know the result:

    SELECT w.id,w.name,w.course
      FROM mdl_workshop w
 LEFT JOIN mdl_course_modules cm
           ON cm.module=(SELECT id FROM mdl_modules WHERE name='workshop') AND cm.instance=w.id
     WHERE cm.id IS NULL;
In reply to David Mudrák

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by Fr de Thysebaert -

Hi

thanks again to your reponse

sql query return no record

phpmyadmin (french) MySQL n'a retourné aucun enregistrement. ( Traitement en 0.0016 sec. )

 

In reply to Fr de Thysebaert

Re: upgrade 1.99 to 2.0 RC1 (Build: 20101030) stops/fails at workshopform_accumalative

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hmm... Can you send me the dump of your 1.9 database so I can analyse more? If so, please send it to david@moodle.com. I promise I will not abuse personal data in any way and will not provide the dump to any 3rd person, of course.

d.