Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with postgresql 11 #168

Closed
ptman opened this issue Oct 21, 2019 · 14 comments
Closed

Issue with postgresql 11 #168

ptman opened this issue Oct 21, 2019 · 14 comments

Comments

@ptman
Copy link

ptman commented Oct 21, 2019

[error] 156#156: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: wallabag_craue_config_setting in /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77

The table does exist, I've checked with psql. And it was created by console doctrine:migrations:migrate

This seems related to #78

Does pg11 compat need fixes? What about pg12, which was just released?

@j0k3r
Copy link
Member

j0k3r commented Oct 21, 2019

I assume you are trying using wallabag 2.3.8?

@ptman
Copy link
Author

ptman commented Oct 21, 2019

I'm lazy, so I just used wallabag/wallabag:latest. Which does seem to be 2.3.8.

@ptman
Copy link
Author

ptman commented Oct 29, 2019

@j0k3r so did you have any insight regarding pg11/12?

@m0nhawk
Copy link

m0nhawk commented Jul 2, 2020

It doesn't seem to support Postgres 11/12 yet?

@ptman
Copy link
Author

ptman commented Jul 4, 2020

@m0nhawk indeed

@j0k3r
Copy link
Member

j0k3r commented Jul 6, 2020

I've checked the 2.3.8 and it works perfectly with PG 12.3.

So I'm wondering:

  • how did you setup your docker?
  • how did you setup your wallabag?
  • how did you initialize PG?
  • how did you get that error?

@NX211
Copy link

NX211 commented Jul 19, 2020

I'm running:

Wallabag 2.3.8
Postgres 11.8
Docker: 19.03.8

I deploy my Wallabag Docker container with Ansible. So this is what my main Ansible playbook task for Wallabag looks like.

`- name: Create Wallabag Image volume
docker_volume:
name: wallabag_images
state: present
tags: wallabag

  • import_tasks: roles/postgres/tasks/database_manager.yml
    vars:
    database_name: "{{wallabag_database}}"
    database_user: "{{wallabag_database_user}}"
    database_password: "{{wallabag_database_password}}"
    tags: wallabag

  • name: Create Wallabag Docker Container
    docker_container:
    name: wallabag
    image: "wallabag/wallabag:{{wallabag_version}}"
    pull: yes
    restart_policy: unless-stopped
    networks:
    - name: proxy
    networks_cli_compatible: yes
    state: started
    env:
    POSTGRES_USER: "{{postgres_root_user}}"
    POSTGRES_PASSWORD: "{{postgres_root_password}}"
    SYMFONY__ENV__DATABASE_DRIVER_CLASS: "{{wallabag_database_class}}"
    POSTGRES_DB: "{{wallabag_database}}"
    SYMFONY__ENV__DATABASE_DRIVER: "pdo_pgsql"
    SYMFONY__ENV__DATABASE_HOST: "database"
    SYMFONY__ENV__DATABASE_PORT: "5432"
    SYMFONY__ENV__DATABASE_NAME: "{{wallabag_database}}"
    SYMFONY__ENV__DATABASE_USER: "{{wallabag_database_user}}"
    SYMFONY__ENV__DATABASE_PASSWORD: "{{wallabag_database_password}}"
    SYMFONY__ENV__MAILER_HOST: "{{email_host}}"
    SYMFONY__ENV__MAILER_USER: "{{email_user}}"
    SYMFONY__ENV__FOSUSER_REGISTRATION: "false"
    SYMFONY__ENV__MAILER_PASSWORD: "{{email_password}}"
    SYMFONY__ENV__FROM_EMAIL: "{{email_user}}"
    SYMFONY__ENV__DOMAIN_NAME: "https://wallabag.{{project_tld}}"
    SYMFONY__ENV__REDIS_SCHEME: "tcp"
    SYMFONY__ENV__REDIS_HOST: "{{redis_host}}"
    SYMFONY__ENV__REDIS_PORT: "{{redis_port}}"
    volumes:
    - wallabag_images:/var/www/wallabag/web/assets/images
    labels:
    traefik.http.routers.wallabag.entrypoints: "websecure"
    traefik.http.routers.wallabag.tls: "true"
    traefik.http.routers.wallabag.rule: "Host(wallabag.{{project_tld}})"
    traefik.http.routers.wallabag.middlewares: "default-headers@file"
    traefik.http.routers.wallabag.service: "wallabag"
    traefik.http.services.wallabag.loadbalancer.server.port: "80"
    traefik.enable: "true"
    tags: wallabag`

I only deployed the image as is with Docker. I did not Init the database. My understanding was that if I had properly set up a postgres superuser as well as the wallabag database user the container would init itself. However this is the output of the Docker logs for Wallabag.

Starting provisioner... [WARNING]: Found both group and host with same name: localhost Provisioner finished. 2020/07/19 03:35:57 [error] 286#286: *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 LINE 1: ...on_1, t0.name AS name_2, t0.value AS value_3 FROM wallabag_c... ^ in /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105 Stack trace: #0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(105): PDOStatement->execute(NULL) #1 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(847): Doctrine\DBAL\Driver\PDOStatement->execute() #2 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(712): Doctrine\DBAL\Connection->executeQuery('SELECT t0.secti...', Array, Array) #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) #4 /var/w" while reading response header from upstream, client: 172.0.0.6, server: _, request: "GET /login HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wallabag.domain.com"

@NX211
Copy link

NX211 commented Jul 19, 2020

Just kidding. I took the time to init the wallabag database.

docker exec wallabag /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction

anyway, that command did the trick and produced no errors. As far as I can tell everything is good to go on Postgres 11.

Love the project by the way.

@j0k3r
Copy link
Member

j0k3r commented Jul 19, 2020

Oh boy don't tell me everyone here didn't ran the wallabag:install command after setting up their images?

@NX211
Copy link

NX211 commented Jul 19, 2020

@j0k3r Yep, seems like that's about the size of it. It had been so long since I installed everything that I had forgotten the correct steps.

@baschi29
Copy link

baschi29 commented Jul 19, 2020

Oh boy don't tell me everyone here didn't ran the wallabag:install command after setting up their images?

The documentation is a little lacking in that regard I think. Also from looking at the amount of issues where one just needed to run the command..
Myself included lol

@ptman
Copy link
Author

ptman commented Jul 29, 2020

OK, I just made a bad assumption based on the error message and another issue with matching error message.

Really it seems my case is more likely #190

I got it working, but need to run the handler from entrypoint.yml manually after each start as creating a postgres db fails https://github.com/wallabag/docker/blob/master/root/etc/ansible/entrypoint.yml#L114

@ptman ptman closed this as completed Jul 29, 2020
@proletarius101
Copy link

Just kidding. I took the time to init the wallabag database.

docker exec wallabag /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction

anyway, that command did the trick and produced no errors. As far as I can tell everything is good to go on Postgres 11.

Love the project by the way.

I suppose the initialization stuff should and could be handled by built-in script automatically? That's what most containers do - use it out-of-the-box.

@GlassedSilver
Copy link

Just kidding. I took the time to init the wallabag database.
docker exec wallabag /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction
anyway, that command did the trick and produced no errors. As far as I can tell everything is good to go on Postgres 11.
Love the project by the way.

I suppose the initialization stuff should and could be handled by built-in script automatically? That's what most containers do - use it out-of-the-box.

Apparently this project will die on this hill of making deployments as cumbersome as possible by ignoring these very basic approaches used by.... well I have to say every single docker I have come across so far.

BTW: still haven't gotten my instance to turn on a second time after the initial execution lol
I swear to God, if it wasn't for a lack of sensible options that would let me import my wallabag contents I already have (how... if it doesn't start up a second time? :D) I'd be long gone... But when you have thousands of entries this is a bit of a problem you are forced to figure out. I don't even wanna know how many wallabag-related tabs I have open right now to not risk closing and not finding again that one tab that had some command I might need.

And don't get me started on the docs.... a million places to check out and very weird sectioning.

Should I ever figure this set up out with Postgres I'll make a doc about it and PR it, but since it won't be merged anyhow since I won't be able to suppress my passive aggressiveness maybe I shouldn't even bother.

So many hours wasted already...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants