Unable to upgrade to Mahara 18.10.0 on windows

Bug #1799933 reported by james william
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
18.10
Fix Released
High
Unassigned
19.04
Fix Released
High
Unassigned

Bug Description

Hi,

I was trying to upgrade my existing 18.04.2 Mahara installation to latest 18.10.0 on my windows environment server. However I am getting "Mahara: Site unavailable
A nonrecoverable error occurred. This probably means you have encountered a bug in the system " error when I visit http://siteurl/admin/upgrade.php?rerun=1&urlsecret='mysecret'

To debug this further, I had uncommented $cfg->productionmode = false; in config.php to see the errors and I found that it was giving error on {Path to Mahara}/lib/dwoo/dwoo/Dwoo/Template/Str.php line 530 unable to chmod.....

I guess this is happening because of "if (strpos(PHP_OS, 'WIN') !== false && $baseDir !== null)" condition. Instead of this if I replace false with 0 i.e "if (strpos(PHP_OS, 'WIN') !== 0 && $baseDir !== null)" the upgrade works fine.

Can you please confirm is this the known issue ? Or am I missing on something ?

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi James

This does indeed sound like an error in the code.

I will make a patch to fix this

Cheers

Robert

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9272

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
importance: Undecided → High
milestone: none → 19.04.0
Revision history for this message
james william (william1212) wrote :

Hi Robert,

I tried with the patch you gave. However I am facing the same issue again.

Revision history for this message
james william (william1212) wrote :

Hi Robert,

I guess the condition should be "if (!preg_match('/WIN/', PHP_OS) && $baseDir !== null)" instead of "if (preg_match('/WIN/', PHP_OS) && $baseDir !== null)"

It is working on Windows if we code with !preg_match instead of preg_match

Revision history for this message
james william (william1212) wrote :

Hi Robert,

I am waiting for your confirmation.

Revision history for this message
james william (william1212) wrote :

Hi Robert,

There is something which needs to change in code. Because when I tried with the code you had provided that was giving error on upgrading on windows. And when I replace preg_match with !preg_match, it worked on windows and gives following error on non suphp server at line 529

[WAR] 5a (lib/dwoo/dwoo/Dwoo/Template/Str.php:529) chmod(): No such file or directory

Can you please let us know what is causing this ?

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi James,

I've updated the patch - seems like the code (which is from a third-party system) does not work as expected any more.

I have a feeling it was from a time where PHP on windows only understood \ as directory separator vs linux using /

But now windows uses and understands / just fine

I've commented out that piece of code - can you test the new patch https://reviews.mahara.org/#/c/9272/3 and see if it works as expected for you?

Cheers
Robert

Revision history for this message
james william (william1212) wrote :

Hi Robert,

Thank you for the new patch. It did worked on my all the servers.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9272
Committed: https://git.mahara.org/mahara/mahara/commit/a43ca5cb1b39ef35c01edb1073aa907de0a8a9de
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit a43ca5cb1b39ef35c01edb1073aa907de0a8a9de
Author: James William <unknown>
Date: Fri Oct 26 13:57:51 2018 +1300

Bug 1799933: Fixing dwoo template issue for windows

behatnotneeded

Change-Id: I69f4eaa13630cd127b173098132d7defdde53917
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "18.10_STABLE" branch: https://reviews.mahara.org/9323

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9323
Committed: https://git.mahara.org/mahara/mahara/commit/ff9256460ba42b8924b158479fecf0bba02c62ba
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 18.10_STABLE

commit ff9256460ba42b8924b158479fecf0bba02c62ba
Author: James William <unknown>
Date: Fri Oct 26 13:57:51 2018 +1300

Bug 1799933: Fixing dwoo template issue for windows

behatnotneeded

Change-Id: I69f4eaa13630cd127b173098132d7defdde53917
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit a43ca5cb1b39ef35c01edb1073aa907de0a8a9de)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.