Page MenuHomePhabricator

update.php seems a bit confused by Chameleon skin/Bootstrap install
Closed, ResolvedPublic

Description

While upgrading a MW 1.26 install to 1.30, and using Composer to pull in the Chameleon skin (as per its instructions at https://github.com/cmln/chameleon/blob/master/docs/installation-linux.md), update.php hit me back with the following, implying that it or wherever it gets its paths from expects that Bootstrap should have landed in the extensions folder, when it actually landed at /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/resources/bootstrap.

I should probably also mention that Chameleon landed in /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/chameleon-skin, rather than the skins directory.

# php update.php
[8dbae65340df5073d75eac98] [no req]   RuntimeException from line 162 of /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/src/Hooks/SetupAfterCache.php: Expected an accessible /var/www/vhosts/wiki.linguisticteam.org/public/extensions/Bootstrap/resources/bootstrap path
Backtrace:
#0 /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/src/Hooks/SetupAfterCache.php(68): Bootstrap\Hooks\SetupAfterCache->isReadablePath(string)
#1 /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/Bootstrap.php(88): Bootstrap\Hooks\SetupAfterCache->process()
#2 [internal function]: {closure}()
#3 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Hooks.php(177): call_user_func_array(Closure, array)
#4 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Hooks.php(205): Hooks::callHook(string, Closure, array, NULL)
#5 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Setup.php(710): Hooks::run(string)
#6 /var/www/vhosts/wiki.linguisticteam.org/public/maintenance/doMaintenance.php(79): require_once(string)
#7 /var/www/vhosts/wiki.linguisticteam.org/public/maintenance/update.php(249): require_once(string)
#8 {main}

I'm new to Composer, and at a loss for what to do to finish my upgrade attempt here.

Event Timeline

Could you try also adding

		"composer/installers": "^1.0.12",

to your composer.local.json, then running composer update "composer/installers" and finally composer update "mediawiki/chameleon-skin" again?

Unfortunately, no joy yet

# php update.php
[41dd3ef160fa4c44abd139fa] [no req]   RuntimeException from line 162 of /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/src/Hooks/SetupAfterCache.php: Expected an accessible /var/www/vhosts/wiki.linguisticteam.org/public/extensions/Bootstrap/resources/bootstrap path
Backtrace:
#0 /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/src/Hooks/SetupAfterCache.php(68): Bootstrap\Hooks\SetupAfterCache->isReadablePath(string)
#1 /var/www/vhosts/wiki.linguisticteam.org/public/vendor/mediawiki/bootstrap/Bootstrap.php(88): Bootstrap\Hooks\SetupAfterCache->process()
#2 [internal function]: {closure}()
#3 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Hooks.php(177): call_user_func_array(Closure, array)
#4 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Hooks.php(205): Hooks::callHook(string, Closure, array, NULL)
#5 /var/www/vhosts/wiki.linguisticteam.org/public/includes/Setup.php(710): Hooks::run(string)
#6 /var/www/vhosts/wiki.linguisticteam.org/public/maintenance/doMaintenance.php(79): require_once(string)
#7 /var/www/vhosts/wiki.linguisticteam.org/public/maintenance/update.php(249): require_once(string)
#8 {main}

It's odd. Normally the composer package type should tell composer to put the skin into the skins directory and the extension into extensions.
It looks like for some reason composer is ignoring the type. The only other idea I have for the moment would be to delete the /vendor/mediawiki folder with all its contents and then try running composer update again.

Ok, then related to that thought, each time I have run composer, I also got the following warning:

Package mediawiki/at-ease is abandoned, you should avoid using it. Use wikimedia/at-ease instead.

"at-ease" is the only subdir of the vendor/mediawiki directory, but it doesn't exist under vendor/wikimedia.

And since I'm mentioning warnings here, I also get these two (which seem ignored, which is why I didn't bother mentioning them sooner):

Cannot create cache directory /usr/share/httpd/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /usr/share/httpd/.composer/cache/files/, or directory is not writable. Proceeding without cache

I'll try your suggestion now and we'll see what happens.

Just some add'l info:
https://www.mediawiki.org/wiki/Skin:Chameleon/Installation
The above instructions are unhelpful for use with a RHEL/Centos 7 server:

https://github.com/cmln/chameleon/blob/master/docs/installation-linux.md
Those are significantly better, but still leave something to be desired, as they imply that a composer.local.json file "should" already exist for mediawiki, but if not, use the (already loaded) composer.json file instead. There does happen to be a composer.local.json-sample file, but it's entire contents are:

{
        "extra": {
                "merge-plugin": {
                        "include": [
                                "extensions/example/composer.json"
                        ]
                }
        }
}

Since it said to add the chameleon info to the require section, and that file doesn't have such a section, I assumed that I had to add it to the big composer.json file.

Then, heeding numerous warnings about running composer as root or sudo root, I opted to run it as follows:

sudo -u apache /usr/bin/php70 /usr/bin/composer update "mediawiki/chameleon-skin"

Does any of this provide you with additional clarity on why/how it could have become confused about the locations it chose or expected?

Ok, after removing the vendor/mediawiki directory and rerunning composer update, it seems that command recreated the mediawiki directory, re-added at-ease, and also dropped bootstrap, chameleon-skin, and mediawiki-codesniffer into that same recreated 'vendor/mediawiki' directory.

Note that composer is still using the original composer.json file that came with mediawiki from https://www.mediawiki.org/wiki/Download.

Sorry to keep adding to this, but looking a bit closer at the chameleon-skin dev's instructions (https://github.com/cmln/chameleon/blob/master/docs/installation-linux.md), it appears to be telling composer to add the skin to vendors/mediawiki, i.e.

"require": {
    "mediawiki/chameleon-skin": "~1.0"
}

If that's incorrect and the cause of the problem I'm experiencing, let me know and I'll take this issue to the Chameleon github.

I just tried it here and it works without problems. Here is a transcript: https://pastebin.com/w6256fgH
(The file structure is a bit different on Ubuntu than on RHEL and the www user is www-data instead of apache, but that should not make a difference.)

Using composer.json should be fine, although composer.local.json is preferrable (i.e. rename composer.local.json-sample to composer.local.json and add the require section). The difference between the two is that composer.json will be overwritten when MW is updated, while composer.local.json won't.

The warnings about missing cache files and outdated dependencies are no problem.

The "mediawiki/chameleon-skin" is correct. It is the name of the package and usually indeed leads to installation in vendor/mediawiki. However, for the Chameleon skin and the Bootstrap extension the package types are mediawiki-skin and mediawiki-extension respectively, which should lead to them installed not in the vendor dir, but in skins and extensions.

One thing I noticed is that the install instructions ask to use /usr/local/bin/composer, while above you used /usr/bin/composer. Could it be that you use a very old version of composer that was already pre-installed on your server?

Hmm, I just set up another attempt (new unpacking of the MW_1.30 tarball) and it worked this time. https://pastebin.com/z432ThAb

The only change I made was to drop the require info into composer.local.json. Related to that, the instructions over at Chameleon-skin's github are missing the comma after the closing }, i.e.

"require": {
    "mediawiki/chameleon-skin": "~1.0"
},

Composer is freshly installed via yum from the EPEL (Extra Packages for Enterprise Linux) repository, so it was (somewhat) thoroughly tested to play well with Centos 7. /urs/bin is where it installs itself on RHEL/Centos systems (and possibly Fedora, as well).

Thank you very much for sticking with me through this. I can't begin to express how much I appreciate the work you and the others do to make these resources (MW, Chameleon, other extensions and skins, etc.) available to the rest of us!

Foxtrott claimed this task.

Good to hear. And thanks! :-)

I had a look at your site. If you want you could put

mainpage

as content into the page MediaWiki:Skin-chameleon-navmenu-flatten which should result in the link to the Main Page being directly available on the navbar instead of in a dropdown menu.
It's not a terribly well documented feature, but have a look at the description of the flatten attribute here: https://github.com/cmln/chameleon/blob/master/docs/components.md#attributes-13

Well I'll be damned! (something my father used to say a lot - still not
sure what it means, though.)

When I was working up that menu system years ago, I exhausted myself trying
to figure out how to do exactly that.
Thanks a ton for sharing that with me, and for developing it in the first
place. I did read the description at the link you sent, but I'll need to
go over that a few times before it'll make enough sense to me to maybe use
it elsewhere in the wiki.

Hugs,
Ray

Earth for sale: Slightly used: Inquire within

Vvjjkkii renamed this task from update.php seems a bit confused by Chameleon skin/Bootstrap install to 7sbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Foxtrott as the assignee of this task.
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.

???
Looks like a "bot gone wild" was let loose in here.

JJMC89 renamed this task from 7sbaaaaaaa to update.php seems a bit confused by Chameleon skin/Bootstrap install.Jul 1 2018, 9:01 PM
JJMC89 closed this task as Resolved.
JJMC89 assigned this task to Foxtrott.
JJMC89 raised the priority of this task from High to Needs Triage.
JJMC89 updated the task description. (Show Details)
JJMC89 added a subscriber: Aklapper.