benhutchins / docker-mediawiki

Docker container for MediaWiki
https://hub.docker.com/r/benhutchins/mediawiki/
Other
29 stars 153 forks source link

Fatal error: Call to a member function setLBInfo() on null in /var/www/html/includes/db/LoadBalancer.php on line 770 #11

Closed chris13524 closed 7 years ago

chris13524 commented 7 years ago

I'm using Docker Compose to deploy MediaWiki in my stack. My setup used to work, but a few months ago, I started getting this error: Fatal error: Call to a member function setLBInfo() on null in /var/www/html/includes/db/LoadBalancer.php on line 770

I took a look at the source code around that line and it appears to be something with the database being null. I've checked my login details, changed the password to make sure, but I'm still getting this error. If it makes a difference, I'm using MariaDB (however, this worked previously while using MariaDB). I have several other services connected to the same database server, they each have their own database.

Any ideas how to fix this? Thanks!

version: '2'
services:
  database:
    restart: unless-stopped
    image: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=<password, irrelevant>
    volumes:
      - /data/database:/var/lib/mysql/:rw
  wiki:
    restart: unless-stopped
    image: benhutchins/mediawiki:latest
    environment:
      - MEDIAWIKI_SITE_SERVER=https://wiki.neonorb.com:80
      - MEDIAWIKI_DB_TYPE=mysql
      - MEDIAWIKI_DB_HOST=database
      - MEDIAWIKI_DB_NAME=neonorb_wiki
      - MEDIAWIKI_DB_USER=neonorb_wiki
      - MEDIAWIKI_DB_PASSWORD=<password>
    volumes:
      - ./wiki/LocalSettings.php:/data/LocalSettings.php:ro
      - /data/wiki/images/:/data/images/:rw
      - /data/wiki/extensions/:/data/extensions/:rw
    depends_on:
      - database
      - httpd # proxys to MediaWiki, not included in this issue. This handles SSL rather than by this image
    links:
      - database:database # don't think this is required, but it doesn't work either way
chris13524 commented 7 years ago

facepalms

Guess I was looking in the wrong location...this is intended behavior. If a custom LocalSettings.php is provided, the startup script will not configure the file. Would be nice if it would configure it though...