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

Installation failling with postgresql driver #78

Closed
husimo opened this issue Aug 3, 2017 · 21 comments
Closed

Installation failling with postgresql driver #78

husimo opened this issue Aug 3, 2017 · 21 comments

Comments

@husimo
Copy link

husimo commented Aug 3, 2017

Hello,
I created a wallabag container associated to a postgresql container and it's not working.
I have that output in my logs :

2017/08/03 17:04:18 [error] 407#407: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught PDOException: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "wallabag_craue_config_setting" does not exist
LINE 1: ...t0.value AS value_2, t0.section AS section_3 FROM wallabag_c...
                                                             ^ in /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
Stack trace:
#0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): 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.name ...', 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)

Don't know if it's really related to postgresql or not, so I will try with mariadb driver and keep you informed.

My docker-compose.yml :

version: '3'
services:
  wallabag:
    container_name: wallabag
    image: wallabag/wallabag:latest
    restart: always
    volumes:
      - wallabag-images:/var/www/wallabag/web/assets/images
    networks:
      - nginx-proxy
      - postgres
    environment:
      # L'utilisateur postgres super-utilisateur
      - POSTGRES_USER=postgres
      # Le mot de passe de l'utilisateur postgres super-utilisateur
      - POSTGRES_PASSWORD=<MDP_PGSQL_POSTGRES>
      # Le pilote utilisé par symfony
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
      # L'hôte du conteneur postgresql
      - SYMFONY__ENV__DATABASE_HOST=postgres
      # Le port
      - SYMFONY__ENV__DATABASE_PORT=5432
      # Le nom de la base qui sera créée
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      # L'utilisateur de la base qui sera créé
      - SYMFONY__ENV__DATABASE_USER=wallabag" 
      # Le mot de passe de l'utilisateur qui sera créé
      - SYMFONY__ENV__DATABASE_PASSWORD=<MDP_BASE_PGSQL>
      - VIRTUAL_HOST=<SOUS-DOMAINE>.<DOMAINE>.<EXT>
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=<SOUS-DOMAINE>.<DOMAINE>.<EXT>
      - LETSENCRYPT_EMAIL=<EMAIL>
      # Autoriser l'enregistrement des utilisateurs
      - SYMFONY__ENV__FOSUSER_REGISTRATION=false
volumes:
    wallabag-images:
      external: true
networks:
    nginx-proxy:
      external: true
    postgres:
      external: true
@husimo
Copy link
Author

husimo commented Aug 3, 2017

It's working with mariadb so it seems that's a postgresql related issue.

@j0k3r
Copy link
Member

j0k3r commented Aug 3, 2017

Could you please tell us:

  • what version fo wallabag?
  • what version of postgres?
  • How did you install wallabag?
  • all the command you run to install it?
  • what are you doing to get that error?

Please we need more detail.

@xsteadfastx
Copy link
Contributor

can you try it with a own "fresh" postgres container?

@husimo
Copy link
Author

husimo commented Aug 4, 2017

@j0k3r Sorry I thought all needed informations were in my docker-compose.yml file.

I use the latest wallabag's version provided by the wallabag/wallabag:latest image.

The only command I used is docker-compose up -d. After that I waited several minutes and then connected to my domain name : wallabag.xxx.com. The error output is from docker-compose logs, nginx logs I presume.

My postgres's docker-compose.yml file :

version: '3'
services:
  postgres:
    container_name: postgres
    image: postgres:9.6-alpine
    restart: always
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - postgres
    environment:
    # Mot de passe du compte superutilisateur postgresql
      - POSTGRES_PASSWORD=XXX
volumes:
    postgres-data:
        external: true
networks:
  postgres:
    external: true

I use postgres-9.6 as provided by postgres image.

@xsteadfastx I will try that, nonetheless the only thing there is on my postgres container is a nextcloud database with a nextcloud user.

Thank you for your answers :-)

@husimo
Copy link
Author

husimo commented Aug 4, 2017

Ok so I tried with a fresh postgres container. My complete docker-compose.yml with postgres and wallabag :

version: '3'
services:
  postgres-dev:
    container_name: postgres-dev
    image: postgres:9.6-alpine
    restart: always
# Décommenter uniquement si vous avez besoin d'accéder à postgresql en dehors du réseau postgres (depuis une autre machine).
#    ports:
#      - "5432:5432"
    volumes:
      - postgres-dev-data:/var/lib/postgresql/data
    networks:
      - postgres-dev
    environment:
    # Mot de passe du compte superutilisateur postgresql
      - POSTGRES_PASSWORD=test
  wallabag-dev:
    container_name: wallabag-dev
    image: wallabag/wallabag:latest
    restart: always
    volumes:
      - wallabag-dev-images:/var/www/wallabag/web/assets/images
    networks:
      - nginx-proxy
      - postgres-dev
    depends_on:
      - postgres-dev
    environment:
      # L'utilisateur postgres super-utilisateur
      - POSTGRES_USER=postgres
      # Le mot de passe de l'utilisateur postgres super-utilisateur
      - POSTGRES_PASSWORD=test
      # Le pilote utilisé par symfony
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
      # L'hôte du conteneur postgresql
      - SYMFONY__ENV__DATABASE_HOST=postgres
      # Le port
      - SYMFONY__ENV__DATABASE_PORT=5432
      # Le nom de la base qui sera créée
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      # L'utilisateur de la base qui sera créé
      - SYMFONY__ENV__DATABASE_USER=wallabag" 
      # Le mot de passe de l'utilisateur qui sera créé
      - SYMFONY__ENV__DATABASE_PASSWORD=test
      - VIRTUAL_HOST=wallabag.dev.xxx.fr
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      # Autoriser l'enregistrement des utilisateurs
      - SYMFONY__ENV__FOSUSER_REGISTRATION=false
volumes:
    wallabag-dev-images:
      external: true
    postgres-dev-data:
        external: true
networks:
    nginx-proxy:
      external: true
    postgres-dev:
      external: true

Same result, just used the command docker-compose up -d.
My postgres log :

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
performing post-bootstrap initialization ... No usable system locales were found.
Use the option "--debug" to see details.
ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....LOG:  could not bind IPv6 socket: Address not available
HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG:  database system was shut down at 2017-08-04 11:20:27 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
 done
server started
ALTER ROLE


/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

LOG:  received fast shutdown request
LOG:  aborting any active transactions
waiting for server to shut down....LOG:  autovacuum launcher shutting down
LOG:  shutting down
LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

LOG:  database system was shut down at 2017-08-04 11:20:29 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

My wallabag-dev log after accessing to wallabag.dev.xxx.fr :

Starting provisioner...
 [WARNING]: Found both group and host with same name: localhost
PLAY [localhost] bin dev entrypoint.sh etc home lib media mnt proc root run sbin srv sys tmp usr var TASK [Gathering Facts] bin dev entrypoint.sh etc home lib media mnt proc root run sbin srv sys tmp usr var ok: [localhost] TASK [needed dirs] bin dev entrypoint.sh etc home lib media mnt 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) changed: [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 proc root run sbin srv sys tmp usr var changed: [localhost] TASK [stat] bin dev entrypoint.sh etc home lib media mnt 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 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 proc root run sbin srv sys tmp usr var fatal: [localhost]: FAILED! => {"changed": false, "elapsed": 300, "failed": true, "msg": "Timeout when waiting for postgres:5432"} RUNNING HANDLER [chown dir] bin dev entrypoint.sh etc home lib media mnt proc root run sbin srv sys tmp usr var to retry, use: --limit @/etc/ansible/entrypoint.retry PLAY RECAP bin dev entrypoint.sh etc home lib media mnt proc root run sbin srv sys tmp usr var localhost : ok=3 changed=2 unreachable=0 failed=1
Provisioner finished.
172.18.0.10 - - [04/Aug/2017:11:26:11 +0000] "GET / HTTP/1.1" 302 212 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
2017/08/04 11:26:13 [error] 216#216: *3 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
Stack trace:
#0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(77): PDO->prepare('SELECT t0.name ...', Array)
#1 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(844): Doctrine\DBAL\Driver\PDOConnection->prepare('SELECT t0.name ...')
#2 /var/www/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(712): Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', 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/www/wallabag/vendor/craue/config-bundle/Util/Config.php(38): Doctrine\ORM\EntityRepository->findOneBy(Array)
#5 /var/www/wallabag/ven" while reading response header from upstream, client: 172.18.0.10, server: _, request: "GET /login HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wallabag.dev.xxx.fr"
172.18.0.10 - - [04/Aug/2017:11:26:13 +0000] "GET /login HTTP/1.1" 500 31 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"

Thank you

@xsteadfastx
Copy link
Contributor

i dont know if this is a docker related error. i have no insight in the database stuff. we test every update with a fresh image and container of all databases without any problems.

@nsteinmetz
Copy link
Contributor

I use Postgres without any issue for a long time now. If it may help:

version: '2'
services:
  wallabag:
    image: wallabag/wallabag
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=XXXXX
      - POPULATE_DATABASE=False 
      - 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=XXXXX
    depends_on:
      - db
      - redis
    restart: always 
  db:
    image: postgres:9.6-alpine
    environment:
      - POSTGRES_PASSWORD=XXXXX
    volumes:
      - /srv/www/steinmetz.fr/w/db:/var/lib/postgresql/data
    restart: always 
  redis:
    image: redis:alpine
    restart: always 

@coniesco
Copy link

@nsteinmetz I copy and pasted your docker-compose file, got it up with docker-compose up and it's not installing or creating the database and tables. I had a similar problem when I tried to use wallabag with a mysql container.

@nsteinmetz
Copy link
Contributor

nsteinmetz commented Aug 14, 2017

To create user & database and tables, you can use the /docker-entrypoint-initdb.d/init-user-db.sh extension point for the postgres image - see How to extend this image paragraph. I use this extension point on another project to create user, databases and tables for my other projects.

I don't remember how I created the wallabag database as it was a long time ago.

@xsteadfastx
Copy link
Contributor

xsteadfastx commented Aug 25, 2017

@cescobarf this is so strange cause we test db creation on travis and it works for all db alternatives. uses it a fresh postgres container without anything?

@nicosomb
Copy link
Member

@cescobarf Hello. Could you try the last release of our image?
I installed wallabag with it yesterday and with a PG database and it worked fine.

@coniesco
Copy link

@nicosomb Hi, I tried to install the new version from scratch with an empty database, and running docker-compose up still does nothing. I got into the container and run bin/console wallabag:install -e prod and I got this output:

Wallabag installer
==================

Step 1 of 4: Checking system requirements.
------------------------------------------

 ------------------------ -------- ---------------- 
  Checked                  Status   Recommendation  
 ------------------------ -------- ---------------- 
  PDO Driver (pdo_pgsql)   OK!                      
  Database connection      OK!                      
  Database version         OK!                      
  curl_exec                OK!                      
  curl_multi_init          OK!                      
 ------------------------ -------- ---------------- 

 [OK] Success! Your system can run wallabag properly.                                                                   

Step 2 of 4: Setting up database.
---------------------------------

 It appears that your database already exists. Would you like to reset it? (yes/no) [no]:
 > no

 Creating schema...

                                                                                                                                                                        
  [RuntimeException]                                                                                                                                                    
  The command "doctrine:migrations:migrate" generates some errors:                                                                                                      
                                                                                                                                                                        
                                                                                                                                                                        
                      Application Migrations                                                                                                                            
                                                                                                                                                                        
                                                                                                                                                                        
  Migrating up to 20171125164500 from 0                                                                                                                                 
                                                                                                                                                                        
    ++ migrating 20160401000000                                                                                                                                         
                                                                                                                                                                        
       -> CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name  
  ));                                                                                                                                                                   
       -> CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name);                                                                            
       -> CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_s  
  tarred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype  
   TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN D  
  EFAULT 'false', PRIMARY KEY(id));                                                                                                                                     
       -> CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);                                                                                              
       -> CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id));                                                  
       -> CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);                                                                                           
       -> CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);                                                                                             
       -> CREATE TABLE "wallabag_config" (id INT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) N  
  OT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id));                              
       -> CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);                                                                                     
       -> CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id));          
       -> CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);                                                                                     
       -> COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)';                                                                                   
       -> CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));                                              
       -> CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);                                                                                           
       -> CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_g  
  rant_types TEXT NOT NULL, PRIMARY KEY(id));                                                                                                                           
       -> COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)';                                                                                 
       -> COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)';                                                                           
       -> CREATE TABLE wallabag_oauth2_access_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT D  
  EFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));                                                                                                       
       -> CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);                                                                           
       -> CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);                                                                               
       -> CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);                                                                                 
       -> CREATE TABLE wallabag_oauth2_refresh_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT   
  DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));                                                                                                      
       -> CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);                                                                          
       -> CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);                                                                              
       -> CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);                                                                                
       -> CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT N  
  OT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));                                                                              
       -> CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);                                                                              
       -> CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);                                                                                  
       -> CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);                                                                                    
       -> CREATE TABLE "wallabag_user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_  
  canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEF  
  AULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL,   
  password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WIT  
  HOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCod  
  e INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id));                                                            
       -> CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);                                                                            
       -> CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);                                                                               
       -> CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);                                                                            
       -> COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)';                                                                                                 
       -> COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)';                                                                                          
       -> CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT   
  TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id));                          
       -> CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);                                                                                           
       -> CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);                                                                                          
       -> COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)';                                                                                            
       -> CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;                                                                                             
       -> CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;                                                                                            
       -> CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;                                                                                      
       -> CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;                                                                                               
       -> CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1;                                                                                      
       -> CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;                                                                                
       -> CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;                                                                               
       -> CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1;                                                                                   
       -> CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;                                                                                              
       -> CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;                                                                                          
       -> ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;     
       -> ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE  
  ;                                                                                                                                                                     
       -> ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;     
       -> ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;    
       -> ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IM  
  MEDIATE;                                                                                                                                                              
       -> ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE   
  INITIALLY IMMEDIATE;                                                                                                                                                  
       -> ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY   
  IMMEDIATE;                                                                                                                                                            
       -> ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE  
   INITIALLY IMMEDIATE;                                                                                                                                                 
       -> ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY  
   IMMEDIATE;                                                                                                                                                           
       -> ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INI  
  TIALLY IMMEDIATE;                                                                                                                                                     
       -> ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMM  
  EDIATE;                                                                                                                                                               
       -> ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;  
       -> ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIAT  
  E;                                                                                                                                                                    
                                                                                                                                                                        
    ++ migrated (2.27s)                                                                                                                                                 
                                                                                                                                                                        
    ++ migrating 20160410190541                                                                                                                                         
                                                                                                                                                                        
  Migration 20160410190541 failed during Execution. Error An exception occurred while executing 'SELECT min_value, increment_by FROM "entry_id_seq"':                   
                                                                                                                                                                        
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                        
  LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"                                                                                                            
                 ^                                                                                                                                                      
  01:46:51 ERROR     [console] Error thrown while running command "doctrine:migrations:migrate --no-interaction=1 --no-debug=1 --env=prod". Message: "An exception occ  
  urred while executing 'SELECT min_value, increment_by FROM "entry_id_seq"':                                                                                           
                                                                                                                                                                        
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                        
  LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"                                                                                                            
                 ^" ["error" => Doctrine\DBAL\Exception\InvalidFieldNameException { …},"command" => "doctrine:migrations:migrate --no-interaction=1 --no-debug=1 --env  
  =prod","message" => """  An exception occurred while executing 'SELECT min_value, increment_by FROM "entry_id_seq"':\n  \n  SQLSTATE[42703]: Undefined column: 7 ERR  
  OR:  column "min_value" does not exist\n  LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"\n                 ^  """] []                                     
                                                                                                                                                                        
                                                                                                                                                                        
    [Doctrine\DBAL\Exception\InvalidFieldNameException]                                                                                                                 
    An exception occurred while executing 'SELECT min_value, increment_by FROM "entry_id_seq"':                                                                         
                                                                                                                                                                        
    SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                      
    LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"                                                                                                          
                   ^                                                                                                                                                    
                                                                                                                                                                        
                                                                                                                                                                        
                                                                                                                                                                        
    [Doctrine\DBAL\Driver\PDOException]                                                                                                                                 
    SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                      
    LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"                                                                                                          
                   ^                                                                                                                                                    
                                                                                                                                                                        
                                                                                                                                                                        
                                                                                                                                                                        
    [PDOException]                                                                                                                                                      
    SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                      
    LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"                                                                                                          
                   ^                                                                                                                                                    
                                                                                                                                                                        
                                                                                                                                                                        
  doctrine:migrations:migrate [--write-sql] [--dry-run] [--query-time] [--allow-no-migration] [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]  
  ] [--db DB] [--em EM] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-  
  debug] [--] <command> [<version>]                                                                                                                                     
                                                                                                                                                                        

doctrine:migrations:migrate [--write-sql] [--dry-run] [--query-time] [--allow-no-migration] [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--db DB] [--em EM] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<version>]

@insertjokehere
Copy link

I'm seeing the same error. I'm deploying into a docker swarm, the compose file I use is below. It worked fine with the 2.2.3 image, but is broken with the 2.3.0

version: '3.1'
services:
  wallabag:
    image: wallabag/wallabag:latest
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_USER=postgres
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
      - SYMFONY__ENV__DATABASE_HOST=db
      - SYMFONY__ENV__DATABASE_PORT=5432
      - SYMFONY__ENV__DATABASE_NAME=*REMOVED*
      - SYMFONY__ENV__DATABASE_USER=*REMOVED*
      - SYMFONY__ENV__DATABASE_PASSWORD=*REMOVED*
    volumes:
      - ${ROOT}/${STACK}/images:/var/www/wallabag/web/assets/images
    deploy:
      replicas: 1
      labels:
        - "traefik.port=80"
        - "traefik.frontend.rule=Host:wallabag.${DOMAIN}"
        - "traefik.docker.network=infra_felb"
    networks:
      - felb
      - default
  db:
    image: postgres:9.6
    environment:
      - POSTGRES_PASSWORD=*REMOVED*
      - POSTGRES_USER=*REMOVED*
    volumes:
      - ${ROOT}/${STACK}/data:/var/lib/postgresql/data

networks:
  felb:
    external:
      name: infra_felb

@nicosomb
Copy link
Member

OK. @cescobarf @insertjokehere could you please try this query wallabag/wallabag#3480 (comment) before?

@yverry
Copy link

yverry commented Jan 5, 2018

Hi nico,

Same problem here.
Migration want SELECT min_value, increment_by FROM "entry_id_seq" but entry_id_seq (src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php:26 ?) schema is:

=> \d+ entry_id_seq;
                       Sequence "wallabag.entry_id_seq"
  Type  | Start | Minimum |       Maximum       | Increment | Cycles? | Cache
--------+-------+---------+---------------------+-----------+---------+-------
 bigint |     1 |       1 | 9223372036854775807 |         1 | no      |     1

Install fail with a fresh setup

@ovv
Copy link

ovv commented Jan 20, 2018

I confirm this with wallabag 2.3.1 and postgres 10.1.

During database creation I get:

Migration 20160410190541 failed during Execution. Error An exception occurred while executing 'SELECT min_value, increment_by FROM "entry_id_seq"':                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                              
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "min_value" does not exist                                                                                                                                                                                                                                              
  LINE 1: SELECT min_value, increment_by FROM "entry_id_seq"
wallabag=# \d+ entry_id_seq;
                        Sequence "public.entry_id_seq"
  Type  | Start | Minimum |       Maximum       | Increment | Cycles? | Cache 
--------+-------+---------+---------------------+-----------+---------+-------
 bigint |     1 |       1 | 9223372036854775807 |         1 | no      |     1

wallabag=# SELECT * FROM entry_id_seq;
 last_value | log_cnt | is_called 
------------+---------+-----------
          1 |       0 | f
(1 row)

@tcitworld
Copy link
Member

tcitworld commented Jan 20, 2018

@yverry @ovv Related to wallabag/wallabag#3488

I don't know this docker image much, would do it ?

-e SYMFONY__ENV__DATABASE_DRIVER_CLASS="Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver"

@ma1uta
Copy link

ma1uta commented Feb 17, 2018

There is a bug doctrine/dbal#2868 with sequences in the PostgreSQL 10.
And there is a fix for the doctrine from the nextcloud: nextcloud/server#5930 (comment)

@greenrd
Copy link
Contributor

greenrd commented Mar 17, 2018

Fix here: #107

@ptman
Copy link

ptman commented Oct 21, 2019

I'm having a similar issue, using postgres 11. Do pg11 & pg12 need more fixes?

@j0k3r
Copy link
Member

j0k3r commented Oct 21, 2019

Please create a different issue with log etc. instead.

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