wallabag: PHP Fatal error

Issue details

I am trying out Wallabag and want to do it with docker compose and the build from wallabag/wallabag. I think I set up the nginx reverse proxy correctly as I am able to connect to the docker container. The problem is that nothing is shown in the browser. stderr of the container shows the following error code: Pastebin.com

The important part is probably

FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot redeclare mb_str_split() (previously declared in /var/www/wallaba
g/vendor/symfony/polyfill-mbstring/bootstrap.php:61) in /var/www/wallabag/vendor/wallabag/php-mobi/MOBIClass/RecordFactory.php on line 135" while reading response header from upstream, client: 1

I tried composer selfupdate in the container, which works. Then I tried composer install, which fails with

[...] Generating autoload files
 Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
PHP Fatal error:  Cannot redeclare mb_str_split() (previously declared in /var/www/wallabag/vend
or/symfony/polyfill-mbstring/bootstrap.php:61) in /var/www/wallabag/vendor/wallabag/php-mobi/MOB
IClass/RecordFactory.php on line 135
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post
-cmd event terminated with an exception

                                                         
  [RuntimeException]                                     
  An error occurred when generating the bootstrap file. 

Environment

  • wallabag version (or git revision) that exhibits the issue: 2.3.8
  • How did you install wallabag? Via git clone or by downloading the package? Docker container from Dockerhub wallabag/wallabag
  • php version: 7.3.11
  • OS: Docker container with Ubuntu 5.3.0-23.25-generic 5.3.7
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): MariaDB

Docker-compose.yml

version: '3'
services:
  wallabag:
    image: wallabag/wallabag
    environment:
      - MYSQL_ROOT_PASSWORD=gsfdgsd
      - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
      - SYMFONY__ENV__DATABASE_HOST=db
      - SYMFONY__ENV__DATABASE_PORT=3306
      - SYMFONY__ENV__DATABASE_NAME=test
      - SYMFONY__ENV__DATABASE_USER=test
      - SYMFONY__ENV__DATABASE_PASSWORD=test
      - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
      - SYMFONY__ENV__MAILER_HOST=127.0.0.1
      - SYMFONY__ENV__MAILER_USER=~
      - SYMFONY__ENV__FOSUSER_REGISTRATION=false
      - SYMFONY__ENV__MAILER_PASSWORD=~
      - SYMFONY__ENV__FROM_EMAIL=wallabag@test.com
      - SYMFONY__ENV__DOMAIN_NAME=https://test.com/wallabag
    ports:
            - "9812:80"
    volumes:
      - /opt/wallabag/images:/var/www/wallabag/web/assets/images
      - /opt/wallabag/data:/var/www/wallabag/data
    
  db:
    image: mariadb
    environment:
       - MYSQL_ROOT_PASSWORD=gsfdgsd
    command: ["--character-set-server=utf8mb4",  "--collation-server=utf8mb4_unicode_ci"]
    volumes:
      - /opt/wallabag/data:/var/lib/mysql
  redis:
    image: redis:alpine

Thank you for your help

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I don’t have docker, but I have the same problem. Running behind nginx proxy using uwsgi on Arch

This error appeared to me after reinstalling 2.3.8. A very dirty workaround is to rename the function mb_str_split in RecordFactory.php to something else (respectively the use of it in this file). I think it is already declared at another place.