matomo-org / matomo-org/docker
Error: Matomo is already installed. Original error was "Mysqli prepare error: Table 'matomo.matomo_option' doesn't exist".
- Dominant language
- Shell
- Stars
- 1k
- Forks
- 384
- PR merge metrics
- No merged PRs in 30d
Description
Hello, i had an issue where i wanted to update portainer so i downloaded the backup first but it not seem to have successfully downloaded and i only noticed that after the update, all containers were still running but i couldn't manage the stacks within the new portainer installation due to the error "this stack was created outside of portainer, control over it is limited"
Now i copy the env info etc shown in the running containers and make a new compose file out of it to add in an new stack.
Now i tried to do this process with matomo, which then after visiting the site caused following issue:

There are no erros shown in matomo or database logs, i guess i somehow need to set it so it uses the matomo files from the existing installation and not try to start a new installation process; i don't know how to do so tho.
Note: the go back to matomo just refresh the homepage on which the error happens, statuscode in netrequests is 400
Here the docker-compose.yml file:
```yml
version: '3.0'
services:
matomo:
image: matomo:latest
command: apache2-foreground
entrypoint: /entrypoint.sh
environment:
- APACHE_CONFDIR=/etc/apache2
- APACHE_ENVVARS=/etc/apache2/envvars
- GPG_KEYS=528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544 F1F692238FBC1666E5A5CCD4199F9DFEF6FFBAFD
- MATOMO_DATABASE_ADAPTER=MYSQLI
- MATOMO_DATABASE_CHARSET=utf8mb4
- MATOMO_DATABASE_CONNECT_TIMEOUT=60
- MATOMO_DATABASE_DBNAME=matomo
- MATOMO_DATABASE_ENABLE_SSL=0
- MATOMO_DATABASE_HOST=db
- MATOMO_DATABASE_PASSWORD=REDACTED
- MATOMO_DATABASE_PORT=3306
- MATOMO_DATABASE_TABLES_PREFIX=matomo_
- MATOMO_DATABASE_USERNAME=InfinityMonster
volumes:
# - ./config:/var/www/html/config:z
# - ./logs:/var/www/html/logs:z
- data:/var/www/html:z
restart: always
networks:
webproxy:
ipv4_address: 172.26.0.10
db:
image: jc21/mariadb-aria:latest
command: null
entrypoint: /scripts/run.sh
environment:
- MYSQL_DATABASE=matomo
- MYSQL_PASSWORD=REDACTED
- MYSQL_ROOT_PASSWORD=REDACTED
- MYSQL_USER=InfinityMonster
volumes:
- db:/var/lib/mysql:Z
networks:
webproxy:
ipv4_address: 172.26.0.202
networks:
webproxy:
external: true
volumes:
db:
data:
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the docker-compose.yml shown in the issue and compare the existing Matomo and MariaDB volume mounts, database name, table prefix, and credentials. Inspect whether the original database and application data are present and consistently mounted; done means the existing installation loads without the missing matomo_option table error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, mariadb
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100