← Back to team overview

mahara-contributors team mailing list archive

[Bug 1369370] A change has been merged

 

Reviewed:  https://reviews.mahara.org/4021
Committed: http://gitorious.org/mahara/mahara/commit/b8abf3358cc21f877f3037097978104a15d06fa2
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    1.9_STABLE

commit b8abf3358cc21f877f3037097978104a15d06fa2
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date:   Mon Nov 24 13:38:38 2014 +1300

Clean expired passwords causes error when upgrading (bug 1369370)

When upgrading, should only check if the cron job
'auth_clean_expired_password_requests' already exists
in the table - without all the other fields that need to be updated.
Otherwise, it will check on all the fields (i.e. minute, hour, etc).
If the admin updated them,
the check won't match and a duplicate error results.

Change-Id: I2d30ac97e9a82aaf0d538a834396fdc2d2757480
Signed-off-by: Ghada El-Zoghbi <ghada@xxxxxxxxxxxxxxx>
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1369370

Title:
  Clean expired passwords causes error when upgrading from 1.8

Status in Mahara ePortfolio:
  Fix Committed
Status in Mahara 1.10 series:
  Fix Committed
Status in Mahara 1.9 series:
  Fix Committed
Status in Mahara 15.04 series:
  Fix Committed

Bug description:
  Mahara: 1.10.0dev
  OS: Linux
  DB: Postgres
  Browser: any

  
  The change put in to fix the cleaning of expired passwords has introduced a bug that causes a duplicate error when trying to upgrade from 1.8 to 1.10.

  [WAR] b8 (lib/errors.php:739) Failed to get a recordset: postgres7 error: [-5: ERROR:  duplicate key value violates unique constraint "cron_cal_uk", referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138] [WAR] b8 (lib/errors.php:739) DETAIL:  Key (callfunction)=(auth_clean_expired_password_requests) already exists.] in adodb_throw(INSERT INTO "cron" ("callfunction", "minute", "hour", "day", "month", "dayofweek") VALUES (?, ?, ?, ?, ?, ?), Array), referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138] [WAR] b8 (lib/errors.php:739) Command was: INSERT INTO "cron" ("callfunction", "minute", "hour", "day", "month", "dayofweek") VALUES (?, ?, ?, ?, ?, ?) and values was (auth_clean_expired_password_requests,5,0,*,*,*), referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138] Call stack (most recent first):, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * log_message("Failed to get a recordset: postgres7 error: [-5: E...", 8, true, true) at /var/www/maharacode/mahara/htdocs/lib/errors.php:95, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * log_warn("Failed to get a recordset: postgres7 error: [-5: E...") at /var/www/maharacode/mahara/htdocs/lib/errors.php:739, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * SQLException->__construct("Failed to get a recordset: postgres7 error: [-5: E...") at /var/www/maharacode/mahara/htdocs/lib/dml.php:1046, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * insert_record("cron", object(stdClass), false, false) at /var/www/maharacode/mahara/htdocs/lib/dml.php:1133, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * ensure_record_exists("cron", object(stdClass), object(stdClass)) at /var/www/maharacode/mahara/htdocs/lib/db/upgrade.php:3418, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * xmldb_core_upgrade("2013101417") at /var/www/maharacode/mahara/htdocs/lib/upgrade.php:325, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138]   * upgrade_core(object(stdClass)) at /var/www/maharacode/mahara/htdocs/admin/upgrade.json.php:86, referer: http://d.mahara/admin/upgrade.php
  [Mon Sep 15 11:44:24 2014] [error] [client 192.168.124.138] , referer: http://d.mahara/admin/upgrade.php


  The reason is because the check if the record exists needs to pass a $where array that doesn't include the items to be updated.
  i.e. $where = array('callfunction' => 'auth_clean_expired_password_requests');

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1369370/+subscriptions


References