Page MenuHomePhabricator

Setting up MediaWiki-Docker on Debian 10 (buster) failed
Closed, ResolvedPublic

Description

I tried to install MediaWiki-Docker on Debian 10 (buster), but failed.

  • VM with Debian 10 (buster), with a basic install, running on my machine at home
sudo apt install docker-composer
sudo adduser liw docker
sudo reboot

log in again

git clone --depth=1 https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki
cd mediawiki
  • create .env by copy-pasting from DEVELOPERS.md and adding the two extra lines
MW_DOCKER_PORT=8080
MW_SCRIPT_PATH=/
MW_SERVER=http://localhost:8080
MEDIAWIKI_USER=Admin
MEDIAWIKI_PASSWORD=dockerpass
XDEBUG_CONFIG=''
MW_DOCKER_UID=1000
MW_DOCKER_GID=1000
  • create docker-compose-override.yml by copy-pasting from DEVELOPERS.md
  • tried to docker-compose up:
liw@playground:~/mediawiki$ docker-compose up -d
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
liw@playground:~/mediawiki$
  • changed version in docker-compose.yml to 3.3
  • docker-compose up -d again, failed due to downloading problem
  • docker-compose up -d again, finished without errors
  • docker-compose exec mediawiki composer update
  • docker-compose exec mediawiki /bin/bash /docker/install.sh
  • got message that wiki is ready on localhost:8080
liw@playground:~/mediawiki$ curl http://localhost:8080
<!DOCTYPE html>
<html><head><title>MediaWiki</title><style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style></head><body><h1>Sorry! This site is experiencing technical difficulties.</h1><p>Try waiting a few minutes and reloading.</p><p><small>(<span dir="ltr">Cannot access the database: Unknown error (localhost)</span>)</small></p><p>Backtrace:</p><pre>#0 /var/www/html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(934): Wikimedia\Rdbms\LoadBalancer-&gt;reportConnectionError()
#1 /var/www/html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(901): Wikimedia\Rdbms\LoadBalancer-&gt;getServerConnection(0, 'my_wiki', 0)
#2 /var/www/html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1046): Wikimedia\Rdbms\LoadBalancer-&gt;getConnection(-1, Array, 'my_wiki', 0)
#3 /var/www/html/includes/GlobalFunctions.php(2464): Wikimedia\Rdbms\LoadBalancer-&gt;getMaintenanceConnectionRef(-1, 'api', 'my_wiki')
#4 /var/www/html/includes/cache/MessageCache.php(485): wfGetDB(-1, 'api')
#5 /var/www/html/includes/cache/MessageCache.php(440): MessageCache-&gt;loadFromDB('en', NULL)
#6 /var/www/html/includes/cache/MessageCache.php(363): MessageCache-&gt;loadFromDBWithLock('en', Array, NULL)
#7 /var/www/html/includes/cache/MessageCache.php(1083): MessageCache-&gt;load('en')
#8 /var/www/html/includes/cache/MessageCache.php(1010): MessageCache-&gt;getMsgFromNamespace('Mainpage', 'en')
#9 /var/www/html/includes/cache/MessageCache.php(980): MessageCache-&gt;getMessageForLang(Object(LanguageEn), 'mainpage', true, Array)
#10 /var/www/html/includes/cache/MessageCache.php(922): MessageCache-&gt;getMessageFromFallbackChain(Object(LanguageEn), 'mainpage', true)
#11 /var/www/html/includes/language/Message.php(1305): MessageCache-&gt;get('mainpage', true, Object(LanguageEn))
#12 /var/www/html/includes/language/Message.php(860): Message-&gt;fetchMessage()
#13 /var/www/html/includes/language/Message.php(952): Message-&gt;toString('text')
#14 /var/www/html/includes/Title.php(664): Message-&gt;text()
#15 /var/www/html/includes/MediaWiki.php(122): Title::newMainPage()
#16 /var/www/html/includes/MediaWiki.php(142): MediaWiki-&gt;parseTitle()
#17 /var/www/html/includes/MediaWiki.php(889): MediaWiki-&gt;getTitle()
#18 /var/www/html/includes/MediaWiki.php(535): MediaWiki-&gt;main()
#19 /var/www/html/index.php(47): MediaWiki-&gt;run()
#20 {main}</pre></body></html>liw@playground:~/mediawiki$ 
liw@playground:~/mediawiki$ ls -l cache
total 8
drwxr-xr-x 4 root root 4096 May 12 20:24 composer
drwx------ 3 root root 4096 May 12 20:27 sqlite
liw@playground:~/mediawiki$

I note that I was using docker and docker-compose as packaged by Debian and they might be versions that are too old. I so, please tell me.

liw@playground:~/mediawiki$ dpkg -l 'docker*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version                   Architecture Description
+++-=================-=========================-============-====================================
un  docker            <none>                    <none>       (no description available)
ii  docker-compose    1.21.0-3                  all          Punctual, lightweight development en
un  docker-containerd <none>                    <none>       (no description available)
un  docker-doc        <none>                    <none>       (no description available)
un  docker-runc       <none>                    <none>       (no description available)
ii  docker.io         18.09.1+dfsg1-7.1+deb10u1 amd64        Linux container runtime
liw@playground:~/mediawiki$

Event Timeline

brennen subscribed.

You'll probably want to install docker-compose using the instructions here: https://docs.docker.com/compose/install/

Looks like that page has changed a bit since we linked it from DEVELOPERS.md, where we also imply that installing from your package manager might work.

See also: T246021

I interpret that as "too old". Thanks! If DEVELOPERS.md is changed to say that packaged versions don't work, then that's OK and you can close this task.

liw@playground:~/mediawiki$ ls -l cache
total 8
drwxr-xr-x 4 root root 4096 May 12 20:24 composer
drwx------ 3 root root 4096 May 12 20:27 sqlite

This (root ownership) should not have happened, given the notes in the task description.

As an aside, I wonder if we should add something to the entrypoint.sh script -- detect if the current user is root, and if so exit with an error. As it is, running as root sort of works but frequently ends up with stuff being semi-broken (e.g. unable to read the SQLite db or read/write to the cache directory).

brennen triaged this task as Medium priority.May 13 2020, 4:56 PM
brennen added a project: User-brennen.
brennen moved this task from Backlog to Doing on the User-brennen board.