You are not logged in.

#1 2020-08-18 23:16:35

Smith oo4
From: Calgary, Alberta, Canada
Registered: 2007-12-30
Posts: 35

Grocy Slim Application Error

I am trying to run Grocy, however when I point a browser at the machine I installed it on I get the following error:

Slim Application Error
The application could not run because of the following error:
Type: PDOException
Code: 14
Message: SQLSTATE[HY000] [14] unable to open database file
File: /usr/share/webapps/grocy/services/DatabaseService.php
Line: 39
#0 /usr/share/webapps/grocy/services/DatabaseService.php(39): PDO->__construct()
#1 /usr/share/webapps/grocy/services/DatabaseService.php(66): Grocy\Services\DatabaseService->GetDbConnectionRaw()
#2 /usr/share/webapps/grocy/services/DatabaseMigrationService.php(9): Grocy\Services\DatabaseService->ExecuteDbStatement()
#3 /usr/share/webapps/grocy/controllers/SystemController.php(20): Grocy\Services\DatabaseMigrationService->MigrateDatabase()
#4 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(43): Grocy\Controllers\SystemController->Root()
#5 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Routing/Route.php(381): Slim\Handlers\Strategies\RequestResponse->__invoke()
#6 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): Slim\Routing\Route->handle()
#7 /usr/share/webapps/grocy/middleware/SessionAuthMiddleware.php(35): Slim\MiddlewareDispatcher->handle()
#8 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): Grocy\Middleware\SessionAuthMiddleware->__invoke()
#9 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle()
#10 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Routing/Route.php(341): Slim\MiddlewareDispatcher->handle()
#11 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Routing/RouteRunner.php(84): Slim\Routing\Route->run()
#12 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(60): Slim\Routing\RouteRunner->handle()
#13 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\RoutingMiddleware->process()
#14 /usr/share/webapps/grocy/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): class@anonymous->handle()
#15 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\ErrorMiddleware->process()
#16 /usr/share/webapps/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle()
#17 /usr/share/webapps/grocy/vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle()
#18 /usr/share/webapps/grocy/vendor/slim/slim/Slim/App.php(199): Slim\App->handle()
#19 /usr/share/webapps/grocy/app.php(68): Slim\App->run()
#20 /usr/share/webapps/grocy/public/index.php(27): require_once('/usr/share/weba...')
#21 {main}

I have installed this on a freshly installed Arch Linux VM using PHP-FPM and Caddy V1 web server. Below are the instructions I followed:

yay -Syu caddy sqlite php php-fpm php-sqlite php-gd grocy

sudo sed -i 's/;extension=pdo_sqlite/extension=pdo_sqlite/g' /etc/php/php.ini
sudo sed -i 's/;extension=sqlite3/extension=sqlite3/g' /etc/php/php.ini
sudo sed -i 's/;extension=gd/extension=gd/g' /etc/php/php.ini

sudo systemctl start php-fpm
sudo systemctl enable php-fpm
sudo systemctl status php-fpm

sudo nano /etc/caddy/conf.d/grocy.conf 

:9283 {
        errors /var/log/caddy/grocy_error.log
        root /usr/share/webapps/grocy/public
            fastcgi / unix:/run/php-fpm/php-fpm.sock php {
                index index.php

sudo systemctl enable caddy
sudo systemctl start caddy
sudo systemctl status caddy

I have tried installing using NGINX instead of caddy as well as manually downloading the latest Grocy release, extracting, copying the confing file, changing permissions, etc. instead of using the AUR package as well. I have checked the permission of the ‘data’ folder in the Grocy install, (where the app saves its database) and it looks correct to me; “drwxr-xr-x 1 http root”. I have gone as far as to chmod -R 0777 the Grocy install. I have tried installing on an Arch derivative (Endeavouros and Manjaro) incase I screwed up the os install. In all case I have got the same error. I can get Grocy running on Fedora or FreeBSD so I think it must be something related to Arch Linux or my ability to uses it.

Any suggestions on how to fix or troubleshoot this?

Thank you

Last edited by Smith oo4 (2020-08-19 13:07:37)


#2 2020-08-19 01:29:53

From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,415

Re: Grocy Slim Application Error

Moving to AUR issues.

Please edit your post and fix it to use BBCode Code tags around all program output and file contents.  And, only use quote tags for quotes.

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
How to Ask Questions the Smart Way


Board footer

Powered by FluxBB