Page MenuHomePhabricator

"Cannot access the database" error on http://localhost:8080 after Docker setup on Ubuntu
Closed, ResolvedPublic

Description

The set up worked fine when I was using MacOS. Recently I shifted to Ubuntu and I keep getting this error even though I have followed all steps of DEVELOPERS.md

These are the steps I followed:

  1. Create a docker-compose.override.yml containing the following:
version: '3.7'
services:
  mediawiki:
    # On Linux, these lines ensure file ownership is set to your host user/group
    user: "${MW_DOCKER_UID}:${MW_DOCKER_GID}"
  1. Set $MW_DOCKER_UID and $MW_DOCKER_GID in the environment:
export MW_DOCKER_UID=$(id -u)
export MW_DOCKER_GID=$(id -g)
  1. Start the environment:

docker-compose up -d

  1. Install Composer dependencies:

docker-compose exec mediawiki composer update

  1. Install MediaWiki in the environment:
docker-compose exec mediawiki \
bash -c 'php maintenance/install.php \
--server $MW_SERVER \
--scriptpath=$MW_SCRIPTPATH \
--dbtype $MW_DBTYPE \
--dbpath $MW_DBPATH \
--lang $MW_LANG \
--pass $MW_PASS \
$MW_SITENAME $MW_USER'

The following is the output I got after running the last command

Screenshot from 2020-04-01 19-58-23.png (598×1 px, 93 KB)

Error on visiting localhost:8080:

Screenshot from 2020-04-01 19-28-05.png (1×1 px, 89 KB)

Browser: Google Chrome
OS: Linux (Ubuntu)
Version: Ubuntu 18.04.4 LTS
Docker version: 19.03.8

Event Timeline

Aklapper changed the task status from Open to Stalled.Apr 1 2020, 2:21 PM

Hi @Vidhi-Mody, thanks for taking the time to report this! Unfortunately this Wikimedia Phabricator task lacks some information.
If you have time and can still reproduce the situation: Please add a more complete description to this task. That should be

  • a clear list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step, including a link to the steps that you are following
  • what happens after performing these steps to reproduce,
  • what you expected to happen instead.

You can edit the task description by clicking Edit Task. Ideally, a good description should allow any other person to follow these steps (without having to interpret steps) and see the same results. Problems that others can reproduce can get fixed faster. Thanks!

I have edited the task description and added the steps I followed

Aklapper renamed this task from Sorry! This site is experiencing technical difficulties. to "Cannot access the database" on localhost:8080 after Docker setup on Ubuntu.Apr 1 2020, 2:40 PM
Aklapper renamed this task from "Cannot access the database" on localhost:8080 after Docker setup on Ubuntu to "Cannot access the database" error on http://localhost:8080 after Docker setup on Ubuntu.Apr 1 2020, 2:44 PM
Aklapper changed the task status from Stalled to Open.

@Vidhi-Mody This is due to ,permission problem of your database folder. In your mediawiki folder open cache folder there you see a sqlite folder change those permision to read and write for your username and group.
Make sure you are not uding sudo for runnig docker-compose commands

This comment was removed by MSantos.

@Vidhi-Mody it looks like you did everything right except for running docker-compose with sudo, see the second item under "Linux users" here https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/DEVELOPERS.md#requirements

@Vidhi-Mody try running the command without using sudo

@Gaura87 @kostajh @AlQaholic007 thanks for the help!
It's working now

Turns out she did not have her user added to docker group. Adding that resolved the issue. This task can be closed as resolved now