Could not find driver

Hello,

I’m a beginner with Grav. I have installed the plugin “Views” which requires the “database” plugin. When I navigate to /admin/tools/reports, I get an exception.

Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("could not find driver")."

If I want to use SQlite, Is there a driver or anything else I need to configure somewhere ? In the “database” plugin, the only parameter I can see has no meaning full label and I don’t know what I’m supposed to configure here.

In addition I get the same exception for many other plugins so I guess I have some configuration parameter missing.

Stacktrace:
#84 Twig\Error\RuntimeError in /var/www/grav/user/plugins/admin/themes/grav/templates/partials/tools-reports.html.twig:3
#83 PDOException in /var/www/grav/user/plugins/database/classes/Database.php:12
#82 PDO:__construct in /var/www/grav/user/plugins/database/classes/Database.php:12
#81 Grav\Plugin\Database\Database:connect in /var/www/grav/user/plugins/views/classes/Views.php:39
#80 Grav\Plugin\Views\Views:__construct in /var/www/grav/user/plugins/views/views.php:69
#79 Grav\Plugin\ViewsPlugin:Grav\Plugin\{closure} in /var/www/grav/vendor/pimple/pimple/src/Pimple/Container.php:122
#78 Pimple\Container:offsetGet in /var/www/grav/user/plugins/views/views.php:113
#77 Grav\Plugin\ViewsPlugin:onAdminGenerateReports in /var/www/grav/vendor/symfony/event-dispatcher/EventDispatcher.php:264
#76 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /var/www/grav/vendor/symfony/event-dispatcher/EventDispatcher.php:239
#75 Symfony\Component\EventDispatcher\EventDispatcher:callListeners in /var/www/grav/vendor/symfony/event-dispatcher/EventDispatcher.php:73
#74 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /var/www/grav/system/src/Grav/Common/Grav.php:597
#73 Grav\Common\Grav:fireEvent in /var/www/grav/user/plugins/admin/classes/plugin/Admin.php:2077
#72 Grav\Plugin\Admin\Admin:generateReports in /var/www/grav/vendor/twig/twig/src/Template.php:700
#71 Twig\Template:getAttribute in /var/www/grav/cache/twig/61/6168b1cfd2031748f64d09fd2080aeee343975f5d959b4909c0b01578bbe9087.php:34
#70 __TwigTemplate_ad6f79f72267ef0e109875cfbd6965758668b99861c7f609fa59844142824b94:doDisplay in /var/www/grav/vendor/twig/twig/src/Template.php:453
#69 Twig\Template:displayWithErrorHandling in /var/www/grav/vendor/twig/twig/src/Template.php:420
#68 Twig\Template:display in /var/www/grav/cache/twig/97/97ffc068934bf312f59ae3c2b80910e8852d23b2fb0000bc2c15bc92d79a3b49.php:166
#67 __TwigTemplate_354cebfe2873a126fa06b86bca874f32f8a1c76f4537981ddb474ae9a1fd63ab:block_content in /var/www/grav/vendor/twig/twig/src/Template.php:214
#66 Twig\Template:displayBlock in /var/www/grav/cache/twig/7d/7de08810e99c0e435f1b92a1e0c22448b6eea0912a8f15fab7fee5c8425279d2.php:318
#65 __TwigTemplate_b4ba6c7d206eb19bdf74466d08ac0f329e65b8f4cdd131b85b2336858c501800:block_content_wrapper in /var/www/grav/vendor/twig/twig/src/Template.php:214
#64 Twig\Template:displayBlock in /var/www/grav/cache/twig/7d/7de08810e99c0e435f1b92a1e0c22448b6eea0912a8f15fab7fee5c8425279d2.php:262
#63 __TwigTemplate_b4ba6c7d206eb19bdf74466d08ac0f329e65b8f4cdd131b85b2336858c501800:block_page in /var/www/grav/vendor/twig/twig/src/Template.php:214
#62 Twig\Template:displayBlock in /var/www/grav/cache/twig/7d/7de08810e99c0e435f1b92a1e0c22448b6eea0912a8f15fab7fee5c8425279d2.php:222
#61 __TwigTemplate_b4ba6c7d206eb19bdf74466d08ac0f329e65b8f4cdd131b85b2336858c501800:block_body in /var/www/grav/vendor/twig/twig/src/Template.php:214
#60 Twig\Template:displayBlock in /var/www/grav/cache/twig/7d/7de08810e99c0e435f1b92a1e0c22448b6eea0912a8f15fab7fee5c8425279d2.php:76
#59 __TwigTemplate_b4ba6c7d206eb19bdf74466d08ac0f329e65b8f4cdd131b85b2336858c501800:doDisplay in /var/www/grav/vendor/twig/twig/src/Template.php:453
#58 Twig\Template:displayWithErrorHandling in /var/www/grav/vendor/twig/twig/src/Template.php:420
#57 Twig\Template:display in /var/www/grav/cache/twig/53/5383e45d8e93046e01681a7dafe645b96cb04821d7c44d7d81b7e871bf0db18e.php:34
#56 __TwigTemplate_2a4e5c22c2edfb8bf47b56f9d064d400df01db2e9b904a6c4bb03065cd8945cb:doDisplay in /var/www/grav/vendor/twig/twig/src/Template.php:453
#55 Twig\Template:displayWithErrorHandling in /var/www/grav/vendor/twig/twig/src/Template.php:420
#54 Twig\Template:display in /var/www/grav/cache/twig/97/97ffc068934bf312f59ae3c2b80910e8852d23b2fb0000bc2c15bc92d79a3b49.php:61
#53 __TwigTemplate_354cebfe2873a126fa06b86bca874f32f8a1c76f4537981ddb474ae9a1fd63ab:doDisplay in /var/www/grav/vendor/twig/twig/src/Template.php:453
#52 Twig\Template:displayWithErrorHandling in /var/www/grav/vendor/twig/twig/src/Template.php:420
#51 Twig\Template:display in /var/www/grav/vendor/twig/twig/src/Template.php:432
#50 Twig\Template:render in /var/www/grav/vendor/twig/twig/src/TemplateWrapper.php:47
#49 Twig\TemplateWrapper:render in /var/www/grav/vendor/twig/twig/src/Environment.php:384
#48 Twig\Environment:render in /var/www/grav/system/src/Grav/Common/Twig/Twig.php:439
#47 Grav\Common\Twig\Twig:processSite in /var/www/grav/system/src/Grav/Common/Service/OutputServiceProvider.php:36
#46 Grav\Common\Service\OutputServiceProvider:Grav\Common\Service\{closure} in /var/www/grav/vendor/pimple/pimple/src/Pimple/Container.php:122
#45 Pimple\Container:offsetGet in /var/www/grav/system/src/Grav/Common/Processors/RenderProcessor.php:40
#44 Grav\Common\Processors\RenderProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#43 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#42 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/DebuggerAssetsProcessor.php:38
#41 Grav\Common\Processors\DebuggerAssetsProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#40 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#39 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/PagesProcessor.php:112
#38 Grav\Common\Processors\PagesProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#37 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#36 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/TwigProcessor.php:38
#35 Grav\Common\Processors\TwigProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#34 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#33 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/AssetsProcessor.php:39
#32 Grav\Common\Processors\AssetsProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#31 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#30 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/SchedulerProcessor.php:40
#29 Grav\Common\Processors\SchedulerProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#28 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#27 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/BackupsProcessor.php:39
#26 Grav\Common\Processors\BackupsProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#25 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#24 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/TasksProcessor.php:69
#23 Grav\Common\Processors\TasksProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#22 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#21 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/user/plugins/admin/classes/plugin/Router.php:65
#20 Grav\Plugin\Admin\Router:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#19 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#18 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/RequestProcessor.php:64
#17 Grav\Common\Processors\RequestProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#16 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#15 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/ThemesProcessor.php:38
#14 Grav\Common\Processors\ThemesProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#13 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#12 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/PluginsProcessor.php:39
#11 Grav\Common\Processors\PluginsProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#10 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#9 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Processors/InitializeProcessor.php:130
#8 Grav\Common\Processors\InitializeProcessor:Grav\Common\Processors\{closure} in /var/www/grav/system/src/Grav/Common/Debugger.php:546
#7 Grav\Common\Debugger:profile in /var/www/grav/system/src/Grav/Common/Processors/InitializeProcessor.php:131
#6 Grav\Common\Processors\InitializeProcessor:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#5 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#4 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Middlewares/MultipartRequestSupport.php:40
#3 Grav\Framework\RequestHandler\Middlewares\MultipartRequestSupport:process in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50
#2 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62
#1 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/grav/system/src/Grav/Common/Grav.php:312
#0 Grav\Common\Grav:process in /var/www/grav/index.php:47

@unefamilleavelo, You haven’t shared much about what steps you’ve taken and what you’ve configured.

I can only suggest you follow the READMEs of both plugins and let us know what you’ve done.

What I have done so far

  • installed sqlite on my machine : apt-get install sqlite3
  • created the sqlite database in /var/www/grav/user/data/sqlite/db.sqlite3
  • installed “sqlite plugin” with the Grav admin interface, pointing to the above base
  • installed “view plugin” with the Grav admin interface

My concern is that I only have one instance. When I try something my web site is down. Before I go further I need to setup a test instance.

you might be missing the sqlite driver in your PHP installation.
to check that, create a file named phpinfo.php in your webroot with the following code:

<?php
phpinfo();
?>

then point your browser to that file.
you should get something like this:


if not, then this is the problem.