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

500 Internal Server Error -> "Setting \"piwik_enabled\" couldn't be found #1881

Closed
mourningsun75 opened this issue Apr 7, 2016 · 36 comments
Closed
Assignees
Labels
Milestone

Comments

@mourningsun75
Copy link

Issue details

Installed how described: http://doc.wallabag.org/en/v2/user/installation.html
After opeing the URL i got a 500.

The prod.log:

[2016-04-07 16:48:20] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Setting "piwik_enabled" couldn't be found.") in "WallabagCoreBundle::base.html.twig" at line 73." at /var/www/wallabag/var/cache/prod/classes.php line 1242 {"exception":"[object](Twig_Error_Runtime%28code: 0%29: An exception has been thrown during the rendering of a template %28"Setting "piwik_enabled" couldn't be found."%29 in "WallabagCoreBundle::base.html.twig" at line 73. at /var/www/wallabag/var/cache/prod/classes.php:1242, RuntimeException%28code: 0%29: Setting "piwik_enabled" couldn't be found. at /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php:139)"} []

Environment

  • wallabag version (or git revision) that exhibits the issue: 2.0.0
  • How did you install wallabag? Via composer create-project
  • Last wallabag version that did not exhibit the issue (if applicable):
  • php version: 5.5.33-1~dotdeb+7.1
  • OS: Debian Wheezy
  • type of hosting (shared or dedicated): dedicated
  • which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL): mysql

Steps to reproduce/test case

Install like described in the tutorial

@Rurik19
Copy link
Contributor

Rurik19 commented Apr 8, 2016

I had the same error. Look at #1828.
This is really database setup probleme.
look at parameters.yml - for non sqlite parameter database_path must be empty or "null"

@mourningsun75
Copy link
Author

ok, that solved the problem.... now i got the next error:

404....

[2016-04-08 11:04:44] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /index.php"" at /var/www/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 123 {"exception":"[object](Symfony\Component\HttpKernel\Exception\NotFoundHttpException%28code: 0%29: No route found for "GET /index.php" at /var/www/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:123, Symfony\Component\Routing\Exception\ResourceNotFoundException%28code: 0%29: at /var/www/wallabag/var/cache/prod/appProdUrlMatcher.php:632)"} []

vhost configured like described....

@tcitworld
Copy link
Member

Are you sure about that ? Your vhost must point to web/app.php, not index.php.

@mourningsun75
Copy link
Author

Ah, sorry.... my fault..... got this one again:

[2016-04-08 11:13:39] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Setting "piwik_enabled" couldn't be found.") in "WallabagCoreBundle::base.html.twig" at line 73." at /var/www/wallabag/var/cache/prod/classes.php line 1242 {"exception":"[object](Twig_Error_Runtime%28code: 0%29: An exception has been thrown during the rendering of a template %28"Setting "piwik_enabled" couldn't be found."%29 in "WallabagCoreBundle::base.html.twig" at line 73. at /var/www/wallabag/var/cache/prod/classes.php:1242, RuntimeException%28code: 0%29: Setting "piwik_enabled" couldn't be found. at /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php:139)"} []

Build wallabag with database_path: null.
Will now try to build it with empty string

@mourningsun75
Copy link
Author

Error stays the same:

[2016-04-08 11:19:03] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Setting "piwik_enabled" couldn't be found.") in "WallabagCoreBundle::base.html.twig" at line 73." at /var/www/wallabag/var/cache/prod/classes.php line 1242 {"exception":"[object](Twig_Error_Runtime%28code: 0%29: An exception has been thrown during the rendering of a template %28"Setting "piwik_enabled" couldn't be found."%29 in "WallabagCoreBundle::base.html.twig" at line 73. at /var/www/wallabag/var/cache/prod/classes.php:1242, RuntimeException%28code: 0%29: Setting "piwik_enabled" couldn't be found. at /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php:139)"} []

@tcitworld
Copy link
Member

Can you clear the cache to be sure ? bin/console cache:clear ?

@mourningsun75
Copy link
Author

Fully deleted the cache folder. Error stays the same

@tcitworld
Copy link
Member

That's bothering if you have a different issue than in #1828

@mourningsun75
Copy link
Author

seems so :-(

@Rurik19
Copy link
Contributor

Rurik19 commented Apr 8, 2016

Did you do
php bin/console wallabag:install --env=prod
after cleaning database_path? I did.

@mourningsun75
Copy link
Author

yes, i did

@nicosomb nicosomb added the Bug label Apr 8, 2016
@nicosomb nicosomb added this to the 2.0.1 milestone Apr 8, 2016
@nicosomb nicosomb self-assigned this Apr 8, 2016
@nicosomb
Copy link
Member

nicosomb commented Apr 8, 2016

I can't reproduce this bug. I installed wallabag with mysql storage, with database_path filled or not.
Here are my commands:

git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.0.0
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod

During the composer install, I said pdo_mysql for database_driver.

Can you retry the installation?

@mourningsun75
Copy link
Author

i just wrote me a little script:

cd ~/tools
git clone https://github.com/wallabag/wallabag.git
cd wallabag
curl -s http://getcomposer.org/installer | php
git checkout 2.0.0
SYMFONY_ENV=prod php composer.phar install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
sudo rm -R /var/www/wallabag/*
sudo cp -R ~/tools/wallabag/* /var/www/wallabag
sudo chown -R www-data:www-data /var/www/wallabag

After build the following error appears:

[Exception]
DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In ca
se you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.
timezone to select your timezone.

I also use pdo_mysql.

@tcitworld
Copy link
Member

That's just a warning. You can resolve it by setting your timezone inside your php.ini file, for instance : date.timezone = America/New_York and eventually restart your webserver.

@mourningsun75
Copy link
Author

done. but the initial error stays.... :-(

@nicosomb
Copy link
Member

nicosomb commented Apr 8, 2016

You mean this error

[2016-04-08 11:19:03] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Setting "piwik_enabled" couldn't be found.") in "WallabagCoreBundle::base.html.twig" at line 73." at /var/www/wallabag/var/cache/prod/classes.php line 1242 {"exception":"object"} []

?

@mourningsun75
Copy link
Author

Yes

@j0k3r
Copy link
Member

j0k3r commented Apr 8, 2016

Do you have pdo_mysql installed? Could you list the extension loaded?

@j0k3r j0k3r removed this from the 2.0.1 milestone Apr 10, 2016
@mourningsun75
Copy link
Author

Is there a command to list? pdo_mysql is installed

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

php -m should be enough.

@mourningsun75
Copy link
Author

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
ldap
libxml
mbstring
mcrypt
memcache
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
pspell
recode
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

What do you have in your MySQL database? (like inside craue_config or sth like that)
Did you try to re-launch the wallabag:install command? (without forgetting the --env=prod)

@mourningsun75
Copy link
Author

All Tables are emtpy...

"Did you try to re-launch the wallabag:install command?" yes, multiple times

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

And which options did you select while re-running wallabag:install? Did you choose to trash everything and re-create the database?
Because it seems that creating the database is fine but when we initialize stuff it seems to fail (because your database is empty)

@mourningsun75
Copy link
Author

"Did you choose to trash everything and re-create the database?" While install i choose "reset". I will drop the database now and will try reinstall

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

Could you launch the wallabag:install command with -vvv option too ?

@mourningsun75
Copy link
Author

Nothing changes:
[2016-04-11 16:20:37] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Setting "piwik_enabled" couldn't be found.") in "WallabagCoreBundle::base.html.twig" at line 73." at /var/www/wallabag/var/cache/prod/classes.php line 1242 {"exception":"[object](Twig_Error_Runtime%28code: 0%29: An exception has been thrown during the rendering of a template %28"Setting "piwik_enabled" couldn't be found."%29 in "WallabagCoreBundle::base.html.twig" at line 73. at /var/www/wallabag/var/cache/prod/classes.php:1242, RuntimeException%28code: 0%29: Setting "piwik_enabled" couldn't be found. at /var/www/wallabag/vendor/craue/config-bundle/Util/Config.php:139)"} []

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

What's the full output of the command?
Does the database is still empty?

@mourningsun75
Copy link
Author

All settings correct for using Composer
Downloading 1.0.0...

Composer successfully installed to: /home/xxx/tools/wallabag/composer.phar
Use it: php composer.phar
HEAD is now at a119acd... Merge pull request #1835 from wallabag/v2-prepare-v2
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the prod environment with debug false


 [OK] Cache for the "prod" environment (debug=false) was successfully cleared.


> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
PHP Warning:  date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/mourningsun75/tools/wallabag/vendor/jms/serializer-bundle/JMS/SerializerBundle/DependencyInjection/Configuration.php on line 66

 Trying to install assets as relative symbolic links.

 --- -------------------- ------------------
      Bundle               Method / Error
 --- -------------------- ------------------
  ✔   FrameworkBundle      relative symlink
  ✔   NelmioApiDocBundle   relative symlink
  ✔   WallabagCoreBundle   relative symlink
 --- -------------------- ------------------


 [OK] All assets were successfully installed.


> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
Installing Wallabag...

Step 1 of 4. Checking system requirements.
+-----------------+--------+----------------+
| Checked         | Status | Recommendation |
+-----------------+--------+----------------+
| PDO Driver      | OK!    |                |
| curl_exec       | OK!    |                |
| curl_multi_init | 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? (y/N)y
Droping database, creating database and schema
Clearing the cache
PHP Warning:  date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/xxx/tools/wallabag/vendor/jms/serializer-bundle/JMS/SerializerBundle/DependencyInjection/Configuration.php on line 66

Step 3 of 4. Administration setup.
Would you like to create a new admin user (recommended) ? (Y/n)n
Step 4 of 4. Installing assets.

Wallabag has been successfully installed.
Just execute `php bin/console server:run --env=prod` for using wallabag: http://localhost:8000

@mourningsun75
Copy link
Author

The tables were created, but empty

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

Would you like to create a new admin user (recommended) ? (Y/n)n

Could you say yes instead?
The config is created right after the admin creation.

We should fix that.

@j0k3r j0k3r assigned j0k3r and unassigned nicosomb Apr 11, 2016
@j0k3r j0k3r added this to the 2.0.1 milestone Apr 11, 2016
@mourningsun75
Copy link
Author

Tried it again on another server. Could it be, that is no warning rather an error:

[Exception]
DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In ca
se you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.
timezone to select your timezone.

Exception trace:
() at /home/xxx/tools/wallabag/src/Wallabag/UserBundle/Entity/User.php:101
DateTime->__construct() at /home/xxx/tools/wallabag/src/Wallabag/UserBundle/Entity/User.php:101
Wallabag\UserBundle\Entity\User->timestamps() at /home/xxx/tools/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php:102
Doctrine\ORM\Event\ListenersInvoker->invoke() at /home/xxx/tools/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:896
Doctrine\ORM\UnitOfWork->persistNew() at /home/xxx/tools/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1683
Doctrine\ORM\UnitOfWork->doPersist() at /home/xxx/tools/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1639
Doctrine\ORM\UnitOfWork->persist() at /home/xxx/tools/wallabag/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:579
Doctrine\ORM\EntityManager->persist() at /home/xxx/tools/wallabag/src/Wallabag/CoreBundle/Command/InstallCommand.php:219
Wallabag\CoreBundle\Command\InstallCommand->setupAdmin() at /home/xxx/tools/wallabag/src/Wallabag/CoreBundle/Command/InstallCommand.php:62
Wallabag\CoreBundle\Command\InstallCommand->execute() at /home/mourningsun75/tools/wallabag/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /home/xxx/tools/wallabag/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:807
Symfony\Component\Console\Application->doRunCommand() at /home/xxx/tools/wallabag/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:186
Symfony\Component\Console\Application->doRun() at /home/xxx/tools/wallabag/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:80
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/xxx/tools/wallabag/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:117
Symfony\Component\Console\Application->run() at /home/xxx/tools/wallabag/bin/console:29

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

This is a common error on your PHP version, you can fix it: http://stackoverflow.com/q/16765158/569101

@mourningsun75
Copy link
Author

Ticket can be closed!! :-)

"That's just a warning. You can resolve it by setting your timezone inside your php.ini file, for instance : date.timezone = America/New_York and eventually restart your webserver."

No, this is not just a warning. I changed it in the wrong php.ini. For cli commands there is an own php.ini file. After setting the timezone and reinstall everything is fine. Wallabag2 works!

@mourningsun75
Copy link
Author

If you want to reproduce: Just remove the timezone frpm your php.ini file.

@j0k3r
Copy link
Member

j0k3r commented Apr 11, 2016

Yeah I'll close it after fixing the configuration problem in wallabag:install command.

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

No branches or pull requests

5 participants