mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #48703
[Bug 1773864] A change has been merged
Reviewed: https://reviews.mahara.org/8934
Committed: https://git.mahara.org/mahara/mahara/commit/afb543fa78208f2dbf6ddd2e0cba8c632c733c16
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch: 18.04_STABLE
commit afb543fa78208f2dbf6ddd2e0cba8c632c733c16
Author: Ghada El-Zoghbi <ghada@xxxxxxxxxxxxxxx>
Date: Tue May 29 13:50:13 2018 +1000
Bug 1773864: Throw MaharaException with valid error number
Pass error number and message correctly to the
MaharaException call when coming back from the
externalfeed curl call.
Sponsored by Central Queensland University
behatnotneeded
Change-Id: I03a2b666bde3905d2466ffbe35f1b35ca8a088bf
(cherry picked from commit 23287554e3c3d5398c118583e60de1cab8fabc36)
--
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/1773864
Title:
ExternalFeed block cron task fails when SSL cert is not valid for a
feed
Status in Mahara:
Fix Committed
Status in Mahara 17.04 series:
Fix Committed
Status in Mahara 17.10 series:
Fix Committed
Status in Mahara 18.04 series:
Fix Committed
Status in Mahara 18.10 series:
Fix Committed
Bug description:
Mahara: 18.04
OS: Linux
DB: Postgres
Browser: n/a
Cron fails (and is therefore locked) when one of the rss feeds has an invalid ssl certificate.
The cron job calls lib/web.php::mahara_http_request() from
blocktype/externalfeed/lib.php::parse_feed()
The following error results:
[WAR] 63 (lib/web.php:4425) Curl error: 60: SSL certificate problem: unable to get local issuer certificate
Call stack (most recent first):
* log_message("Curl error: 60: SSL certificate problem: unable to...", 8, true, true) at /var/www/mahara/htdocs/lib/errors.php:95
* log_warn("Curl error: 60: SSL certificate problem: unable to...") at /var/www/mahara/htdocs/lib/web.php:4425
* mahara_http_request(array(size 3), false) at /var/www/mahara/htdocs/blocktype/externalfeed/lib.php:421
* PluginBlocktypeExternalfeed::parse_feed("http://www.safeworkaustralia.gov.au/sites/SWA/medi...", "0", "", "********") at /var/www/mahara/htdocs/blocktype/externalfeed/lib.php:336
* PluginBlocktypeExternalfeed::refresh_feeds() at /var/www/mahara/htdocs/lib/mahara.php:1809
* call_static_method("PluginBlocktypeExternalfeed", "refresh_feeds") at /var/www/mahara/htdocs/lib/cron.php:115
[WAR] 63 (blocktype/externalfeed/lib.php:336) error in /blocktype/externalfeed/lib.php line 428. error:SSL certificate problem: unable to get local issuer certificate
[WAR] 63 (lib/errors.php:536) [Error]: Wrong parameters for MaharaException([string $message [, long $code [, Throwable $previous = NULL]]])
Call stack (most recent first):
* exception(object(Error)) at Unknown:0
I had added extra debugging statements to see the error:
[WAR] 63 (blocktype/externalfeed/lib.php:336) error in
/blocktype/externalfeed/lib.php line 428. error:SSL certificate
problem: unable to get local issuer certificate
Mahara then raises a MaharaException with the error (SSL certificate problem: unable to get local issuer certificate) as the code. But, it's not an integer so it fails with:
[WAR] 63 (lib/errors.php:536) [Error]: Wrong parameters for
MaharaException([string $message [, long $code [, Throwable $previous
= NULL]]])
We need to check if the error coming back is a number or string. If number, pass it as the code in the MaharaException. Otherwise, append it to the text of the error message so the data is not lost.
We found this when upgrading from 17.04 to 18.04. This issue is present in 17.04 as well.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1773864/+subscriptions
References