TransforMap / mediawiki-docker

Docker container for MediaWiki
https://hub.docker.com/r/wikimedia/mediawiki/
Other
0 stars 0 forks source link

entrypoint does not successfully restart the service #1

Open almereyda opened 8 years ago

almereyda commented 8 years ago

An error occurs when an existing container is started again. The initial setup procedure doesn't seem to be skipped properly.

From docker-compose logs mediawiki:

mediawiki_1 | PHP Notice:  Undefined index: MEDIAWIKI_DB_TYPE in - on line 4
mediawiki_1 | ln: failed to create symbolic link './COPYING': File exists
mediawiki_1 | ln: failed to create symbolic link './CREDITS': File exists
mediawiki_1 | ln: failed to create symbolic link './FAQ': File exists
mediawiki_1 | ln: failed to create symbolic link './Gemfile': File exists
mediawiki_1 | ln: failed to create symbolic link './Gemfile.lock': File exists
mediawiki_1 | ln: failed to create symbolic link './Gruntfile.js': File exists
mediawiki_1 | ln: failed to create symbolic link './HISTORY': File exists
mediawiki_1 | ln: failed to create symbolic link './INSTALL': File exists
mediawiki_1 | ln: failed to create symbolic link './README': File exists
mediawiki_1 | ln: failed to create symbolic link './README.mediawiki': File exists
mediawiki_1 | ln: failed to create symbolic link './RELEASE-NOTES-1.27': File exists
mediawiki_1 | ln: failed to create symbolic link './Rakefile': File exists
mediawiki_1 | ln: failed to create symbolic link './StartProfiler.sample': File exists
mediawiki_1 | ln: failed to create symbolic link './UPGRADE': File exists
mediawiki_1 | ln: failed to create symbolic link './api.php': File exists
mediawiki_1 | ln: failed to create symbolic link './autoload.php': File exists
mediawiki_1 | ln: failed to create symbolic link './cache': File exists
mediawiki_1 | ln: failed to create symbolic link './composer.json': File exists
mediawiki_1 | ln: failed to create symbolic link './docs': File exists
mediawiki_1 | ln: failed to create symbolic link './extensions': File exists
mediawiki_1 | ln: failed to create symbolic link './images': File exists
mediawiki_1 | ln: failed to create symbolic link './img_auth.php': File exists
mediawiki_1 | ln: failed to create symbolic link './includes': File exists
mediawiki_1 | ln: failed to create symbolic link './index.php': File exists
mediawiki_1 | ln: failed to create symbolic link './jsduck.json': File exists
mediawiki_1 | ln: failed to create symbolic link './languages': File exists
mediawiki_1 | ln: failed to create symbolic link './load.php': File exists
mediawiki_1 | ln: failed to create symbolic link './maintenance': File exists
mediawiki_1 | ln: failed to create symbolic link './mw-config': File exists
mediawiki_1 | ln: failed to create symbolic link './opensearch_desc.php': File exists
mediawiki_1 | ln: failed to create symbolic link './package.json': File exists
mediawiki_1 | ln: failed to create symbolic link './phpcs.xml': File exists
mediawiki_1 | ln: failed to create symbolic link './profileinfo.php': File exists
mediawiki_1 | ln: failed to create symbolic link './resources': File exists
mediawiki_1 | ln: failed to create symbolic link './serialized': File exists
mediawiki_1 | ln: failed to create symbolic link './skins': File exists
mediawiki_1 | ln: failed to create symbolic link './tests': File exists
mediawiki_1 | ln: failed to create symbolic link './thumb.php': File exists
mediawiki_1 | ln: failed to create symbolic link './thumb_handler.php': File exists
mediawiki_1 | ln: failed to create symbolic link './vendor': File exists
mediawiki_1 | ln: failed to create symbolic link './wiki.phtml': File exists
wikibase_mediawiki_1 exited with code 1

@species Any ideas?

The regular image > container maintenance worked well today with https://lab.allmende.io/transformap/docker-compose-wikibase

docker-compose stop mediawiki
docker-compose rm mediawiki
vim mediawiki-docker/Dockerfile
vim mediawiki-docker/entrypoint.sh
docker-compose build mediawiki
docker-compose up mediawiki

Make sure to change something in the Dockerfile so the Docker build cache is invalidated and refreshed.

tayloj commented 7 years ago

The docker-entrypoint.sh script that gets copied to the image unconditionally tries to create symlinks of everything in /usr/src/mediawiki into /var/www/html. That really should only happen the first time that the server is set up. So, I don't think this is a real fix for the issue, but a workaround is the following change that forces the symlinks.

diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 37e7d33..40c14b9 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -115,7 +115,7 @@ EOPHP

 cd /var/www/html
 # FIXME: Keep php files out of the doc root.
-ln -s /usr/src/mediawiki/* .
+ln -sf /usr/src/mediawiki/* .

 : ${MEDIAWIKI_SHARED:=/data}
 if [ -d "$MEDIAWIKI_SHARED" ]; then