Forums | Mahara Community

Support /
Upgrade db


Ben Yardy's profile picture
Posts: 12

04 April 2018, 0:15

Hi guys I had a failed upgrade in feb 2017.

I never had time to try and fix.

I have just ran the latest upgrade but am getting ......

[DBG] bb (admin/upgrade.php:91) Not upgrading; unfinished upgrade from 2017/02/25 02:00 still in progress

then

An upgrade began at 2017/02/25 02:00 and did not complete. Run this upgrade anyway.

When I try and do the run this upgrade anyway it directs me to 

/admin/upgrade.php?rerun=1

but hen I get 

You do not have access to this functionality. Please provide the value for "urlsecret" from your config.php file as part of the URL.

How can I append the secret to the rerun url?

Thanks

Ben

Cecilia Vela's profile picture
Posts: 110

04 April 2018, 10:41

Hi Ben,

to append the urlsecret you just have to add it as a parameter in the url /admin/upgrade.php?rerun=1

for example, if in your config.php file you have

$cfg->urlsecret = 'mysecret'

then the url to rerun would be

/admin/upgrade.php?rerun=1&urlsecret=mysecret

Cheers,

Cecilia

Ben Yardy's profile picture
Posts: 12

04 April 2018, 10:49

Thank you that worked but then failed to upgrade.

COMPONENT OR PLUGIN FROM VERSION TO VERSION INFORMATION
core 16.10.2 17.10.3 Failed to upgrade.

 

Any ideas?

Thanks

Ben

Cecilia Vela's profile picture
Posts: 110

04 April 2018, 14:01

Hi Ben,

It is really hard to know from that message only. Do you have the error logs enabled? They will show more information about the issue with the upgrade.

If you don't have them enable already, try adding the following line to the config.php file:

$cfg->productionmode = false;

and try to do the upgrade again. You should see more information about the problem.

Cheers,

Cecilia

Ben Yardy's profile picture
Posts: 12

04 April 2018, 14:10

I added the line and turned on PHP-FPM site now gives me this

 

[DBG] d4 (lib/db/upgrade.php:4702) Add iframe url in iframe_source table for glogster educational new url pattern
[DBG] d4 (lib/db/upgrade.php:4716) Fix broken user data for existing users created via webservices
[DBG] d4 (lib/db/upgrade.php:4756) Consolidate dataroot file quarantine area
[DBG] d4 (lib/db/upgrade.php:4767) Make sure all places the default admin email is recorded as the same address
[DBG] d4 (lib/db/upgrade.php:4789) Removing any watchlist items for root user as they are not needed
[DBG] d4 (lib/db/upgrade.php:4795) Make sure all existing groups have a unique shortname.
[DBG] d4 (lib/db/upgrade.php:4810) Changing group uniqueness constraint from (institution,shortname) to just (shortname)
[DBG] d4 (lib/mahara.php:2153) Index shortnameuk does not exist. Delete skipped
[DBG] d4 (lib/mahara.php:2153) Index shortnameuk exists. Create skipped
[DBG] d4 (lib/db/upgrade.php:4822) Realease all collections that are still submitted but to a deleted group
[DBG] d4 (lib/db/upgrade.php:4840) Assign a unique shortname for each existing group that doesn't have one.
[DBG] d4 (lib/db/upgrade.php:4854) Assign an istitution for each existing group that doesn't have one.
[DBG] d4 (lib/db/upgrade.php:4860) Bump cache version to fetch new favicon
[DBG] d4 (lib/db/upgrade.php:4865) Add "active" column to "auth_instance" table
[DBG] d4 (lib/mahara.php:2153) Field active exists. Create skipped
[DBG] d4 (lib/db/upgrade.php:4873) Update view positions in collections
[DBG] d4 (lib/db/upgrade.php:4920) Bump cache version to fetch new favicon
[DBG] d4 (lib/db/upgrade.php:4925) Fixing spelling mistake in SmartEvidence status for PTC matrix
[DBG] d4 (lib/db/upgrade.php:4932) Put group categories in alphabetical order
[DBG] d4 (lib/db/upgrade.php:4949) Clean institution theme in view table
[DBG] d4 (lib/db/upgrade.php:4960) Clear menu cache for new menu items
[WAR] d4 (lib/errors.php:859) Failed to get a recordset: mysqli error: [1054: Unknown column 'time' in 'field list'] in EXECUTE("SELECT event, data, time
                                          FROM "peo_event_log"
                                          WHERE event = 'createuser'
                                          AND POSITION(',"password":"",' IN data) = 0
                                        ")Command was: SELECT event, data, time
                                          FROM "peo_event_log"
                                          WHERE event = ?
                                          AND POSITION(',"password":"",' IN data) = 0
                                          and values was (0:createuser)
Call stack (most recent first):
  • log_message("Failed to get a recordset: mysqli error: [1054: Un...", 8, true, true) at /home/myschool/public_html/lib/errors.php:95
  • log_warn("Failed to get a recordset: mysqli error: [1054: Un...") at /home/myschool/public_html/lib/errors.php:859
  • SQLException->__construct("Failed to get a recordset: mysqli error: [1054: Un...") at /home/myschool/public_html/lib/dml.php:517
  • get_recordset_sql("SELECT event, data, time ...", array(size 1), "", "") at /home/myschool/public_html/lib/dml.php:714
  • get_records_sql_array("SELECT event, data, time ...", array(size 1)) at /home/myschool/public_html/lib/db/upgrade.php:4986
  • xmldb_core_upgrade("2016090213") at /home/myschool/public_html/lib/upgrade.php:347
  • upgrade_core(object(stdClass)) at /home/myschool/public_html/admin/upgrade.json.php:87

Is that helpful?

Thanks again..

Ben

Robert Lyon's profile picture
Posts: 773

17 April 2018, 9:48

Hi Ben,

Because your upgrade failed part way some things that the upgrade expects have now changed. It is expecting the 'time' column in 'event_log' table to exist. But it has changed to 'ctime' (I suspect).

To avoid this issue you can make a change in the htdocs/lib/db/upgrade.php file on line 4982 from

SELECT event, data, time

to

SELECT event, data, ctime

to get past that point

Cheers

Robert

6 results