fr0tt / benotes

An open source self hosted notes and bookmarks taking web app.
https://benotes.org
MIT License
718 stars 49 forks source link

Error 500 - Database (storage/database.sqlite) does not exist #71

Closed alexanderphoenix closed 1 year ago

alexanderphoenix commented 1 year ago

Hi,

I've been following these instructions to spin up a docker container running Benotes.

The instructions ask to wget this .env.sqlite.example which contains the following line:

DB_DATABASE=storage/database.sqlite

After following the instructions I was able to get to the login page, but upon typing in the email and password I setup nothing happened.

The docker logs showed the following at every attempt to log in:

[php-fpm:access] 127.0.0.1 -  18/Apr/2023:23:58:37 +0000 "POST /index.php" 500 /var/www/public/index.php 34.020 2048 88.18%

I was then able to access the laravel.log file and that's where I found out the following error was being output:

[previous exception] [object] (InvalidArgumentException(code: 0): Database (storage/database.sqlite) does not exist. at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:34)

This led me to change the patch on the DB_DATABASE entry in the .env file to:

DB_DATABASE=/var/www/storage/database.sqlite

When doing so everything started working upon rerunning the docker run command.

I just wanted to mention this issue to see if perhaps for the time being the .env example could be updated to avoid anyone else encountering the problem.

fr0tt commented 1 year ago

Hi,

I'm not sure what caused your error but in my case the default configuration works as expected. Have you tried to go back using a relative path after you've made it work ?