Moodle

Upgrade fails from 1.8dev to 1.9dev due to group table upgrading issue.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.9
  • Component/s: Groups
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When I upgrade 1.8 dev (around 2007/01/22) to 1.9 dev, upgrading fails.
The cause seems to be in group/db/upgrade.php.

The problems are:

  • When I need to delete group table for upgrading, I cannot continue to upgrade after the message shows up like bellow:
    'Upgrading process is already running in this session.' (I forget correct sentence though).
  • The record of group module in 'mdl_log_display' table is not correctly installed.
    (Error message indicates that the record already exists).
  • When group table is empty, it is treated as an errors even though just the table is empty.

I attached my patch fixing this problem even though I am not sure if my fix is correct or not.

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

This is OK to ignore and continue ... only people who were using 1.8 dev see this.

I agree it looks scary, though, like everything failed.

Nick, can you see if this patch helps (while not breaking things for normal upgraders)?

Show
Martin Dougiamas added a comment - This is OK to ignore and continue ... only people who were using 1.8 dev see this. I agree it looks scary, though, like everything failed. Nick, can you see if this patch helps (while not breaking things for normal upgraders)?
Hide
Nick Freear added a comment -

(Adding link.)

Show
Nick Freear added a comment - (Adding link.)
Hide
Nick Freear added a comment -

hi motoyuki. thanks for the patch.
I've committed the parts that relate to problems 2 and 3 above to HEAD and 1.8 branch - not controversial and possibly needed for 1.8 release.

I'm still looking at the first problem - I don't see the error message upgrading 1.8 Dev to 1.8 Beta UNTIL I add $_SESSION['upgraderunnig'] = 0, which is weird! I'm about to try the 1.8 Dev to 1.9 Dev upgrade, and will let you know when it makes sense.

Nick

Show
Nick Freear added a comment - hi motoyuki. thanks for the patch. I've committed the parts that relate to problems 2 and 3 above to HEAD and 1.8 branch - not controversial and possibly needed for 1.8 release. I'm still looking at the first problem - I don't see the error message upgrading 1.8 Dev to 1.8 Beta UNTIL I add $_SESSION['upgraderunnig'] = 0, which is weird! I'm about to try the 1.8 Dev to 1.9 Dev upgrade, and will let you know when it makes sense. Nick
Hide
Motoyuki OHMORI added a comment -

Hi Nick,

Thank you for your caring this issue.

Yes, it is weird.

As far as I remeber, the version of group table is 2007012200 when I faced the first problem.

Here is my thought after having a look at the code:

Upgrading codes of oher modules call 'print_continue('index.php')' in lib/weblib.php so that user can go to next upgrade step. Then, print_continue() calls 'upgrade_log_finish()' in lib/adminlib.php that clear $_SESSION['upgraderunning'].

Unfortunately, 'xmldb_group_upgrade()' in group/db/upgrade.php cannot call print_continue().
Therefore, $_SESSION['upgraderunning'] would never be cleared.
That is why error message is generated by admin/index.php.

Now, I think that I should have made the patch that did as what print_continue() did.

Anyway, I will try to re-produce the bug again when I have time and I would say sorry if my thought misses the point.

Regards,
Motoyuki OHMORI

Show
Motoyuki OHMORI added a comment - Hi Nick, Thank you for your caring this issue. Yes, it is weird. As far as I remeber, the version of group table is 2007012200 when I faced the first problem. Here is my thought after having a look at the code: Upgrading codes of oher modules call 'print_continue('index.php')' in lib/weblib.php so that user can go to next upgrade step. Then, print_continue() calls 'upgrade_log_finish()' in lib/adminlib.php that clear $_SESSION['upgraderunning']. Unfortunately, 'xmldb_group_upgrade()' in group/db/upgrade.php cannot call print_continue(). Therefore, $_SESSION['upgraderunning'] would never be cleared. That is why error message is generated by admin/index.php. Now, I think that I should have made the patch that did as what print_continue() did. Anyway, I will try to re-produce the bug again when I have time and I would say sorry if my thought misses the point. Regards, Motoyuki OHMORI
Hide
Petr Škoda (skodak) added a comment -

hi, this should be fixed in latest 1.9dev though there might be problems when upgrading from early 1.8dev..

thanks for the report

Show
Petr Škoda (skodak) added a comment - hi, this should be fixed in latest 1.9dev though there might be problems when upgrading from early 1.8dev.. thanks for the report

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: