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

Error on visiting localhost:8080:

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

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 1 2020, 2:13 PM
This comment was removed by Gabrielchl.
Vidhi-Mody updated the task description. (Show Details)Apr 1 2020, 2:19 PM
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!

Vidhi-Mody updated the task description. (Show Details)Apr 1 2020, 2:31 PM

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

Aklapper updated the task description. (Show Details)Apr 1 2020, 2:35 PM
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.
Gaura87 added a subscriber: Gaura87.Apr 1 2020, 2:49 PM

@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

MSantos added a subscriber: MSantos.Apr 1 2020, 2:53 PM
This comment was removed by MSantos.
kostajh added a subscriber: kostajh.Apr 1 2020, 3:33 PM

@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

Soham added a subscriber: Soham.EditedApr 1 2020, 4:56 PM

@Vidhi-Mody try running the command without using sudo

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

Soham added a comment.Apr 1 2020, 7:48 PM

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

Soham closed this task as Resolved.Apr 1 2020, 7:49 PM