Last modified: 2014-11-20 23:58:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74777, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72777 - [Regression] MediaWiki should detect absent or outdated vendor
[Regression] MediaWiki should detect absent or outdated vendor
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.25-git
All All
: Normal major (vote)
: 1.25.0 release
Assigned To: Bryan Davis
: code-update-regression
: 72932 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-30 19:45 UTC by Krinkle
Modified: 2014-11-20 23:58 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2014-10-30 19:45:23 UTC
Right now doing git-pull gives me an blank HTTP 500 response with no information at all.

This is useless and unacceptable. Before the upcoming release, there must be a detection of sorts. Similar to what we do when PHP version isn't supported or when there are no skins installed, etc.

Going into the Apache error log gives me:

PHP Fatal error:  Class 'Psr\\Log\\AbstractLogger' not found in mediawiki/core/includes/debug/logger/legacy/Logger.php on line 40
PHP Stack trace:
PHP   1. {main}() mediawiki/core/index.php:0

Which isn't useful either.
Comment 1 Sam Reed (reedy) 2014-10-30 19:46:42 UTC
(In reply to Krinkle from comment #0)
> Right now doing git-pull gives me an blank HTTP 500 response with no
> information at all.

git pull where of what repo?
Comment 2 Bryan Davis 2014-10-30 21:44:04 UTC
The place where we do the php version check is before the autoloader, so that won't work to fix the problem. Maybe we can put a check in the includes/debug/logger/legacy/Logger.php file itself that is outside of the class. That way when our autoloader first requires the file we could check to see if the PSR-3 classes are loaded/loadable or not. I'm not exactly sure how to trigger a better global warning however. I think about the best we could do is make an error_log() call that gives a more explanatory message.
Comment 3 Gerrit Notification Bot 2014-10-31 00:57:04 UTC
Change 170274 had a related patch set uploaded by BryanDavis:
Throw exception when \Psr\Log\LoggerInterface is unavailable

https://gerrit.wikimedia.org/r/170274
Comment 4 Sam Reed (reedy) 2014-11-04 01:28:52 UTC
*** Bug 72932 has been marked as a duplicate of this bug. ***
Comment 5 Ryan Kaldari 2014-11-04 01:48:53 UTC
I ran into the same problem. This should definitely generate some kind of meaningful error message. Also someone should update the documentation on mediawiki.org to explain that Composer is now required:
https://www.mediawiki.org/wiki/Download_from_Git#Prerequisites
I'll take a shot at it myself, but I can't guarantee it will be accurate.
Comment 6 Kunal Mehta (Legoktm) 2014-11-04 01:52:45 UTC
(In reply to Ryan Kaldari from comment #5)
> I ran into the same problem. This should definitely generate some kind of
> meaningful error message. Also someone should update the documentation on
> mediawiki.org to explain that Composer is now required:
> https://www.mediawiki.org/wiki/Download_from_Git#Prerequisites
> I'll take a shot at it myself, but I can't guarantee it will be accurate.

It was documented at https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries, but I've stated in the Prerequisites that composer is recommended, but not required.
Comment 7 Ryan Kaldari 2014-11-04 01:55:26 UTC
Legoktm: It seems to be required to me. If I don't install it, I just get a 500 server error (as Krinkle did).
Comment 8 Sam Reed (reedy) 2014-11-04 01:56:32 UTC
You can just clone https://github.com/wikimedia/mediawiki-vendor instead. you don't have to use composer
Comment 9 Ryan Kaldari 2014-11-04 01:57:01 UTC
Ah, nevermind, I see now. You can install the vendor components manually if you want to. That should be better explained in the prerequisites section.
Comment 10 Ryan Kaldari 2014-11-04 01:58:27 UTC
Guess I should read the entire instructions and not just the first part :)
Comment 11 Ryan Kaldari 2014-11-04 02:11:15 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/170274/
Comment 12 Gerrit Notification Bot 2014-11-04 02:14:15 UTC
Change 170274 merged by jenkins-bot:
die() with explanation when \Psr\Log\LoggerInterface is missing

https://gerrit.wikimedia.org/r/170274
Comment 13 Bryan Davis 2014-11-20 23:35:00 UTC
We need a more general solution for this problem than the one off fix for PSR-3 that was applied.

I'm thinking that we could install an autolaoder via spl_autoload_register() *after* all other autoloaders to give a nice warning when a class has not been found yet.
Comment 14 Bryan Davis 2014-11-20 23:58:20 UTC
I think we could also create a git hook that would compare composer.json and composer.lock when composer.json is seen to be updated by a pull and give the user a warning and instructions on how to proceed. The git install instructions could include details on how to install this hook and MediaWiki-Vagrant could do it automatically.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links