wallabag / wallabag/docker

Trouble when using an external pgsql database

Open
#190 12 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
769
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

This afternoon I tried using the wallabag docker with an external db (instead of using a local containerized db). My use case is : i rent a professional grade postgresql into a cloud provider and i would use it instead of a local db (mainly for scalability and resilience issues).

I noticed that is an old questions, i read the issue #9 but i can't figure out how make it works.

My db postgresql version 11.
My docker compose looks like this :
```
version: '2'
services:
wallabag:
image: wallabag/wallabag
environment:
- POSTGRES_PASSWORD=
- POSTGRES_USER=
- SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
- SYMFONY__ENV__DATABASE_HOST=
- SYMFONY__ENV__DATABASE_PORT=
- SYMFONY__ENV__DATABASE_NAME=wallabag
- SYMFONY__ENV__DATABASE_USER=
- SYMFONY__ENV__DATABASE_PASSWORD=
- SYMFONY__ENV__DATABASE_CHARSET=utf8
- SYMFONY__ENV__MAILER_HOST=127.0.0.1
- SYMFONY__ENV__MAILER_USER=~
- SYMFONY__ENV__MAILER_PASSWORD=~
- SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
- SYMFONY__ENV__DOMAIN_NAME=
ports:
- "127.0.0.1:1001:80"
```

When i make a docker-compose up, i got this :
```
~/wallabag-docker$ sudo docker-compose up
Starting wallabagdocker_wallabag_1
Attaching to wallabagdocker_wallabag_1
wallabag_1 | Starting provisioner...
wallabag_1 | [WARNING]: Found both group and host with same name: localhost
wallabag_1 | Provisioner finished.
```

If i go to the wallabag url, i got these errors message :

```
wallabag_1 | 2020/04/13 18:54:53 [error] 254#254: *1 FastCGI sent in stderr: "PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665" while reading response header from upstream, client: 172.18.0.1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wallabag.xn--delano-uva.fr"
wallabag_1 | 172.18.0.1 - - [13/Apr/2020:18:54:53 +0000] "GET / HTTP/1.1" 302 215 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0"
wallabag_1 | 2020/04/13 18:54:54 [error] 254#254: *1 FastCGI sent in stderr: "PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2636PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2665PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "wallabag_craue_config_setting" does not exist
wallabag_1 | LINE 1: ...on_1, t0.name AS name_2, t0.value AS value_3 FROM wallabag_c...
wallabag_1 | ^ in /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105
wallabag_1 | Stack trace:
wallabag_1 | #0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL)
wallabag_1 | #1 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(847): Doctrine\DBAL\Driver\PDOStatement->execute()
wallabag_1 | #2 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(712): Doctrine\DBAL\Connection->executeQuery('SELECT t0.secti...', Array, Array)
wallabag_1 | #3 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(196): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(Array, NULL, NULL, Array, NULL, 1, NULL)
wallabag_1 | #4 /var/w" while reading response header from upstream, client: 172.18.0.1, server: _, request: "GET /login HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: ""
wallabag_1 | 172.18.0.1 - - [13/Apr/2020:18:54:54 +0000] "GET /login HTTP/1.1" 500 31 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0"
wallabag_1 | 172.18.0.1 - - [13/Apr/2020:18:54:54 +0000] "GET /favicon.ico HTTP/1.1" 200 34494 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0"
```

The first problem "Did you mean to use "continue 2"?" looks like the same as #185

```
The error line 3 : "Undefined table: 7 ERROR: relation "wallabag_craue_config_setting" does not exist" is a correct error message because my db is really empty :
psql (10.12 (Ubuntu 10.12-0ubuntu0.18.04.1), server 11.6 (Debian 11.6-1.pgdg90+1))
WARNING: psql major version 10, server major version 11.
Some psql features might not work.
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

wallabag=> \dt
Did not find any relations.
```

So, my questions are :
Does anyone have the same trouble as me ?
Did exist a workaround to simply add an external database to the wallabag container ?
How can I force the ansible task to create the default relations ?

Thanks in advance for helping me,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.