docker icon indicating copy to clipboard operation
docker copied to clipboard

Wallabag problems trying to get it work with traefik?

Open thepenguinthatwants opened this issue 6 years ago • 7 comments

Hi!

I am trying to get this work on my localhost first and test it out before putting it to my server. For now facing some problems with getting it up by docker and using traefik.

version: '3'
services:

  wallabag:
    image: wallabag/wallabag
    env_file: wallabag.env
    networks:
      - internal
    volumes:
      - /var/data/wallabag/images:/var/www/wallabag/web/assets/images


  db:
    image: postgres
    env_file: pq.env
    # dns_search:
      # - wallabag.localhost
    volumes:
      - /var/data/runtime/wallabag/data:/var/lib/postgresql/data
    networks:
      - internal


  redis:
    image: redis:alpine
    networks:
      - internal


networks:
  srv:
    external: true
  internal:

wallabag.env consists


SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
SYMFONY__ENV__DATABASE_HOST=db
SYMFONY__ENV__DATABASE_PORT=5432
SYMFONY__ENV__DATABASE_NAME=wallabag
SYMFONY__ENV__DATABASE_USER=wallabag
SYMFONY__ENV__DATABASE_PASSWORD=wallabag
SYMFONY__ENV__DOMAIN_NAME=wallabag.localhost
SYMFONY__ENV__DATABASE_DRIVER_CLASS=Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
SYMFONY__ENV__MAILER_HOST=127.0.0.1
SYMFONY__ENV__MAILER_USER=test
SYMFONY__ENV__MAILER_PASSWORD=test
SYMFONY__ENV__FOSUSER_REGISTRATION=false

pq.env consists

POSTGRES_PASSWORD=wallabag
POSTGRES_USER=wallabag

When I browse http://wallabag.localhost/ I only get

404 page not found

Logs consist


db_1        | 2019-07-06 09:38:10.622 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1        | 2019-07-06 09:38:10.636 UTC [24] LOG:  database system was shut down at 2019-07-06 09:35:02 UTC
db_1        | 2019-07-06 09:38:10.640 UTC [1] LOG:  database system is ready to accept connections
wallabag_1  |  [WARNING]: Found both group and host with same name: localhost
db_1        | 2019-07-06 09:38:15.317 UTC [31] LOG:  incomplete startup packet
db_1        | 2019-07-06 09:38:15.699 UTC [32] FATAL:  password authentication failed for user "root"
db_1        | 2019-07-06 09:38:15.699 UTC [32] DETAIL:  Role "root" does not exist.
db_1        |   Connection matched pg_hba.conf line 95: "host all all all md5"
wallabag_1  | PLAY [localhost] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var TASK [Gathering Facts] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [needed dirs] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] => (item=/var/www/wallabag/app) ok: [localhost] => (item=/var/www/wallabag/app/config) ok: [localhost] => (item=/var/www/wallabag/data) ok: [localhost] => (item=/var/www/wallabag/data/assets) ok: [localhost] => (item=/var/www/wallabag/data/db) TASK [write parameters.yml] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [stat] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [notify install for sqlite] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [wait for db container] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [add mariadb db] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [add mariadb user] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var skipping: [localhost] TASK [postgresql db] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: fe_sendauth: no password supplied fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database: fe_sendauth: no password supplied\n"} to retry, use: --limit @/etc/ansible/entrypoint.retry PLAY RECAP bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var localhost : ok=4 changed=0 unreachable=0 failed=1

thepenguinthatwants avatar Jul 06 '19 09:07 thepenguinthatwants

I'm sorry I never used traefik with wallabag, I can't help you. Maybe you can get some insight from that other issue: https://github.com/wallabag/docker/issues/77

j0k3r avatar Jul 06 '19 18:07 j0k3r

I don't think this has to do with traefik. From your logs it seems that it cannot initially connect to the db to create the tables. Check your postgres config file for your superuser

mogsub avatar Jul 23 '19 11:07 mogsub

Might be happening because db and wallabag starts too quickly.. and the db is still processing ... not sure how to slow down wallabag tho.

thepenguinthatwants avatar Jul 24 '19 19:07 thepenguinthatwants

Had a similar issue running wallabag on traefik. Try adding the depends_on section to your config. This will wait until the db and redis container are running.

services:
  wallabag:
    #(...)
    depends_on:
      - db
      - redis

christophengelmayer avatar Aug 27 '19 19:08 christophengelmayer

Had a similar issue running wallabag on traefik. Try adding the depends_on section to your config. This will wait until the db and redis container are running.

services:
  wallabag:
    #(...)
    depends_on:
      - db
      - redis

Thanks going to try this when I get back to home. Thought about using wait-for-it script earlier.

thepenguinthatwants avatar Sep 01 '19 16:09 thepenguinthatwants

http://wallabag.localhost/login It actually now forwarded me to the login, which is white screen.

my docker-compose.yml is now like this.

version: '3'
services:

  wallabag:
    image: wallabag/wallabag
    env_file: wallabag.env
    networks:
      - srv
    volumes:
      - /var/data/wallabag/images:/var/www/wallabag/web/assets/images
    depends_on:
      - db
      - redis
    labels:
      - traefik.enable=true
      - traefik.frontend.rule=Host:wallabag.localhost
      - traefik.port=80
      - traefik.docker.network=srv
 
  db:
    image: postgres
    env_file: pq.env
    volumes:
      - /var/data/runtime/wallabag/data:/var/lib/postgresql/data
    networks:
      - srv

  redis:
    image: redis:alpine
    networks:
      - srv

networks:
  srv:
    external: true

thepenguinthatwants avatar Sep 02 '19 16:09 thepenguinthatwants

I can confirm that you can use wallabag with traefik. I am using it for a while now. See https://framagit.org/oxyta.net/docker-atelier/tree/master/bag to see how it can be done. Go up one level to see the treafik config used in ../proxy/prod-le

doc75 avatar Sep 10 '19 19:09 doc75

can confirm the very confusing behavior with accessing https://my-walla.bag (404) & https://my-walla.bag/login (works fine) when using traefik. It seems like the missing / is causing this behavior (wallabag seems to not reply to https://my-walla.bag but does reply with the / in the end)

chris-aeviator avatar May 07 '23 08:05 chris-aeviator