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

Error on Fresh Docker-compose install #170

Open
aiveras opened this issue Nov 4, 2019 · 10 comments
Open

Error on Fresh Docker-compose install #170

aiveras opened this issue Nov 4, 2019 · 10 comments

Comments

@aiveras
Copy link

aiveras commented Nov 4, 2019

I just tried to deploy wallabag with docker-compose. Here is my docker-compose file:

version: '3'
services:
  wallabag:
    image: wallabag/wallabag
    environment:
      - MYSQL_ROOT_PASSWORD=wallaroot
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
      - SYMFONY__ENV__DATABASE_HOST=db
      - SYMFONY__ENV__DATABASE_PORT=3306
      - SYMFONY__ENV__DATABASE_NAME=wallabag
      - SYMFONY__ENV__DATABASE_USER=wallabag
      - SYMFONY__ENV__DATABASE_PASSWORD=wallapass
      - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
      - SYMFONY__ENV__MAILER_HOST=127.0.0.1
      - SYMFONY__ENV__MAILER_USER=~
      - SYMFONY__ENV__MAILER_PASSWORD=~
      - [email protected]
      - SYMFONY__ENV__DOMAIN_NAME=bookmarks.domain.tld
      - VIRTUAL_HOST=bookmarks.domain.tld
      - LETSENCRYPT_HOST=bookmarks.domain.tld
      - [email protected]
    volumes:
      - wallabag-images:/var/www/wallabag/web/assets/images
    networks:
      - default
      - proxy-tier
    ports:
      - "80"

  db:
    image: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=wallaroot
    volumes:
      - wallabag-data:/var/lib/mysql

  redis:
    image: redis:alpine

volumes:
  wallabag-images:
  wallabag-data:

networks:
  proxy-tier:
    external:
      name: nginx-proxy

This is the error:

db_1        | Version: '10.4.8-MariaDB-1:10.4.8+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
wallabag_1  | 2019/11/04 13:10:11 [error] 160#160: *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.2, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "bookmarks.domain.tld"
wallabag_1  | 172.18.0.2 - - [04/Nov/2019:13:10:11 +0000] "GET / HTTP/1.1" 302 214 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0"
wallabag_1  | 2019/11/04 13:10:11 [error] 160#160: *3 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[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
wallabag_1  | Stack trace:
wallabag_1  | #0 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(77): PDO->prepare('SELECT t0.secti...', Array)
wallabag_1  | wallabag/wallabag#1 /var/www/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(844): Doctrine\DBAL\Driver\PDOConnection->prepare('SELECT t0.secti...')
wallabag_1  | wallabag/wallabag#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  | wallabag/wallabag#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  | wallabag/wallabag#4 /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php(73): Doctrine\ORM\EntityRepository->findOneBy(Array)
wallabag_1  | wallabag/wallabag#5 /var/www/wall" while reading response header from upstream, client: 172.18.0.2, server: _, request: "GET /login HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "bookmarks.domain.tld"

for privacy reasons i replaced domain and tld.

@j0k3r j0k3r transferred this issue from wallabag/wallabag Nov 12, 2019
@j0k3r
Copy link
Member

j0k3r commented Nov 12, 2019

Looks like an issue connecting to the database?

@fivestones
Copy link

Did you ever figure this out @aiveras ? I’m having the same problem with a new docker install.

@viktorstrate
Copy link

viktorstrate commented Feb 12, 2020

I'm having the same problem as well

Hmm... After some trial and error, I tried to delete all volumes and start it up again. I let it start up completely (took a couple of minutes) without connecting to it.
When It printed Provisioner finished. in the logs I tried to connect and now it works

@jzt308
Copy link

jzt308 commented Jul 7, 2020

I have the same issue.
As far as I can tell the database isn't created/populated (when I check the mariadb it shows no tables)

Creating wallabag_wallabag_1 ... done
Creating wallabag_redis_1 ... done
Attaching to wallabag_wallabag_1, wallabag_redis_1
wallabag_1 | Starting provisioner...
redis_1 | 1:C 07 Jul 2020 07:57:59.097 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 07 Jul 2020 07:57:59.097 # Redis version=6.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 07 Jul 2020 07:57:59.097 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1 | 1:M 07 Jul 2020 07:57:59.102 * Running mode=standalone, port=6379.
redis_1 | 1:M 07 Jul 2020 07:57:59.103 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1 | 1:M 07 Jul 2020 07:57:59.103 # Server initialized
redis_1 | 1:M 07 Jul 2020 07:57:59.103 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 07 Jul 2020 07:57:59.103 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1 | 1:M 07 Jul 2020 07:57:59.104 * Ready to accept connections
wallabag_1 | [WARNING]: Found both group and host with same name: localhost
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) 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 opt proc root run sbin srv sys tmp usr var changed: [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 fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to find /root/.my.cnf. Exception message: (1045, "Access denied for user 'root'@'172.21.0.1' (using password: NO)")"} RUNNING HANDLER [chown dir] bin dev entrypoint.sh etc home lib media mnt opt proc root run sbin srv sys tmp usr var 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=2 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
wallabag_1 | Provisioner finished.

As you can see the provisioner finishes succesfully but no joy. My docker-compose here:

version: '3.1'

services:

wallabag:
image: wallabag/wallabag:latest
restart: unless-stopped
volumes:

  • /DATA/app/wallabag/images:/var/www/wallabag/web/assets/images
    environment:
  • SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
  • SYMFONY__ENV__DATABASE_HOST=dbserverip
  • SYMFONY__ENV__DATABASE_PORT=3306
  • SYMFONY__ENV__DATABASE_NAME=dbwallabag
  • SYMFONY__ENV__DATABASE_USER=dbusr
  • SYMFONY__ENV__DATABASE_PASSWORD=dbpass
  • SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
  • SYMFONY__ENV__SECRET=secrethere
  • SYMFONY__ENV__MAILER_HOST=maileriphere
  • SYMFONY__ENV__MAILER_USER=wallabag.domain.com
  • SYMFONY__ENV__MAILER_PASSWORD=somepasshere
  • SYMFONY__ENV__FROM_EMAIL=[email protected]
  • SYMFONY__ENV__TWOFACTOR_SENDER=[email protected]
  • SYMFONY__ENV__FOSUSER_REGISTRATION=false
  • SYMFONY__ENV__DOMAIN_NAME=https://wallabag.domain.com

networks:

  • web
  • default

redis:
image: redis:alpine

networks:
web:
external: true

@meonkeys
Copy link

I was also seeing no such table: wallabag_craue_config_setting, so I exec'd into the wallabag container and ran the install, then the composer commands form this file, like so:

cd /var/www/wallabag
php bin/console wallabag:install --env=prod -n
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist

I didn't give wallabag root access to mariadb.

I have set POPULATE_DATABASE to no (just picked something random and descriptive that wasn't True).

@jzt308
Copy link

jzt308 commented Nov 28, 2020

I tried the same thing by running (replace %containername% with the ID or name or your container)
sudo docker exec -t %containername% /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction
First time it runs still an error and no tables in the database. I just ran it again and it populates the database and now works (same here no root access to mariadb).

It dit throw some errors in the process:

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 2636
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

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

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

 ------------------------ -------- ----------------
  Checked                  Status   Recommendation
 ------------------------ -------- ----------------
  PDO Driver (pdo_mysql)   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.
---------------------------------

 Creating schema...
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 272
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 275
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 281
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 287
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 296
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 314
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/wallabag/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 319
 Clearing the cache...

 Database successfully setup.

Step 3 of 4: Administration setup.
----------------------------------

 Administration successfully setup.

Step 4 of 4: Config setup.
--------------------------

 Config successfully setup.

 [OK] Wallabag has been successfully installed.

 [OK] You can now configure your web server, see https://doc.wallabag.org

@j0k3r
Copy link
Member

j0k3r commented Nov 30, 2020

It's just some warning, no errors are displayed here.

@Barraque
Copy link

Barraque commented Dec 7, 2020

I have the same problem

@jtagcat
Copy link

jtagcat commented Aug 25, 2021

@jzt308
Hey, the comment looks like a mess. Please mark logs and code.
Surround it with ```:

image


Alternatively, first mark the code/log:
image

Then, click this button:
image


You can click 'Preview', your text will now look like this:

 long thing that is hard to read long thing that is hard to read long thing that is hard to read long thing that is hard to read long thing that is hard to read
      long thing that is hard to read long thing that is hard to read long thing that is hard to read long thing that is 
  • Beautifully indented!
  • Can be copied by others!
  • Easier to read!

@jtagcat
Copy link

jtagcat commented Aug 25, 2021

@jzt308

I have the same issue.

See this line:

 volumes:

    /DATA/app/wallabag/images:/var/www/wallabag/web/assets/images

Where is the /DATA/ directory? Did you redact it here? Can you run chown nobody:nobody /DATA/app/wallabag/images?

You are likely experiencing a different issue, see here: #174 (comment)

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

8 participants