mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #59356
[Bug 1890258] Re: Missing files crashing 19.10.4 upgrade when updating skins
Thanks Cecilia. It unfortunately didn't fix the issue when a file is
missing from disk (or storage area).
The issue are missing files. They are referenced in the skin definition.
When the thumbnail is getting generated, it fails because it's not in
the file system.
We are also using the objectfs plugin with S3. I had to ensure the file
exists when making the thumbnail.
It finally succeeded.
I've attached the patch I implemented but I'm not sure you want it in
core Mahara.
** Attachment added: "Patch applied"
https://bugs.launchpad.net/mahara/+bug/1890258/+attachment/5399153/+files/commit1.txt
--
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/1890258
Title:
Missing files crashing 19.10.4 upgrade when updating skins
Status in Mahara:
New
Bug description:
Mahara: 19.10.4
OS: Linux 18.04
DB: Postgres
Browser: N/A (this is CLI)
This is a follow-on to Bug #1877001
When upgrading a Mahara (from 19.10.3 to 19.10.4), if artefact files
are missing for some reason, the upgrade crashes.
Also, there was a missing artefact in the DB which also crashed the
upgrade when calling:
$fileobj = artefact_instance_from_id($fileid);
In Dev and Staging, we work with the DB sometimes restored from Prod.
But, we don't always copy the site data as it can be quite large.
Mahara has generally gracefully handled missing files.
As for the missing artefact, I have not dug into why it is missing.
Unfortunately, this time, the upgrade seems to not handle missing
files for skins.
Here is a small subset of the errors that are thrown (there were
thousands and eventually ran out of memory).
[WAR] b4 (lib/skin.php:915) imagesx() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesx() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesx() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesx(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagesy() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesy() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesy() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesy(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagesx() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesx() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesx() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesx(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagesy() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesy() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesy() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesy(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagesx() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesx() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesx() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesx(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagesy() expects parameter 1 to be resource, boolean given
Call stack (most recent first):
• log_message("imagesy() expects parameter 1 to be resource, bool...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagesy() expects parameter 1 to be resource, bool...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagesy(false) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
[WAR] b4 (lib/skin.php:915) imagecopyresampled() expects parameter 2 to be resource, boolean given
Call stack (most recent first):
• log_message("imagecopyresampled() expects parameter 2 to be res...", 8, true, true, "/var/www/site/lib/skin.php", 915) at /var/www/site/lib/errors.php:521
• error(2, "imagecopyresampled() expects parameter 2 to be res...", "/var/www/site/lib/skin.php", 915, array(size 11)) at Unknown:0
• imagecopyresampled(resource(#3027), false, 120, 67.5, 0, 0, null, null, null, null) at /var/www/site/lib/skin.php:915
• Skin::imagebackgroundfill(resource(#3027), false, 0.125, 4, 5) at /var/www/site/lib/skin.php:975
• Skin::generate_thumbnail("1698") at /var/www/site/lib/skin.php:261
• Skin->commit() at /var/www/site/lib/db/upgrade.php:1579
• xmldb_core_upgrade("2019093015") at /var/www/site/lib/upgrade.php:376
• upgrade_core(object(stdClass)) at /var/www/site/lib/mahara.php:274
• upgrade_mahara(array(size 1)) at /var/www/site/admin/cli/upgrade.php:74
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1890258/+subscriptions
References