fr0tt / benotes

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

docker-compose fr0tt/benotes:2.7.0-beta could not run with sqlite #84

Closed royalgarter closed 1 year ago

royalgarter commented 1 year ago

I followed the guide on docker-compose BETA and it worked. But when switching to sqlite, the site is not working

Found no usable log during the investigation. Only this

laravel.log
[2023-05-20 10:34:36] production.ERROR: Database migration failed.

supervisord.log
2023-05-20 17:34:18 Migrate database...
2023-05-20 17:34:23 Database migration failed. Try again...
2023-05-20 17:34:29 Database migration failed. Try again...
2023-05-20 17:34:36 Database migration failed. Try again...
2023-05-20 17:34:36 Database migration failed.
2023-05-20 17:34:36 2023-05-20 10:34:36,494 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2023-05-20 17:34:36 2023-05-20 10:34:36,497 INFO supervisord started with pid 19
2023-05-20 17:34:37 2023-05-20 10:34:37,499 INFO spawned: 'nginx' with pid 20
2023-05-20 17:34:37 2023-05-20 10:34:37,502 INFO spawned: 'php-fpm' with pid 21
2023-05-20 17:34:38 2023-05-20 10:34:38,582 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-05-20 17:34:38 2023-05-20 10:34:38,582 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-05-20 17:35:04 172.21.0.1 - - [20/May/2023:10:35:04 +0000] "GET / HTTP/1.1" 200 812 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" "-"
2023-05-20 17:35:04 172.21.0.1 - - [20/May/2023:10:35:04 +0000] "GET /api/auth/me HTTP/1.1" 401 5 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" "-"
2023-05-20 17:35:04 172.21.0.1 - - [20/May/2023:10:35:04 +0000] "POST /api/auth/refresh HTTP/1.1" 500 6634 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" "-"

Scenarios that i tried with the same error described

  1. Using the fresh compose, .env with only change DB_CONNECTION=sqlite & DB_DATABASE=storage/database.sqlite. Already ran "php artisan install" without any error in terminal.
  2. Same as above, but tried to "touch storage/database.sqlite && chown $user:$user storage/database.sqlite" before install.
  3. Using the working pgsql, switch to sqlite as above, "php artisan install" again.
fr0tt commented 1 year ago

You're right. It should work if you change in your .env file DB_DATABASE to /var/www/storage/database.sqlite

royalgarter commented 1 year ago

Thanks, its working now