MR database initiation issue

140 views
Skip to first unread message

Hakim Ahmadi

unread,
Mar 4, 2021, 1:05:17 AM3/4/21
to munkireport
Hello, 
I have a new setup of MR on a linux machine. I'm using SQLite as the database for MR. I have configured the .env file db section as below:

# DATABASE
# --------
CONNECTION_DRIVER="sqlite"
CONNECTION_DATABASE="APP_ROOT . 'app/db/db.sqlite'"

#CONNECTION_DRIVER="mysql"
#CONNECTION_HOST="127.0.0.1"
#CONNECTION_PORT=3306
#CONNECTION_DATABASE="munkireport"
#CONNECTION_USERNAME="root"
#CONNECTION_PASSWORD=""
#CONNECTION_CHARSET="utf8mb4"
#CONNECTION_COLLATION="utf8mb4_unicode_ci"
#CONNECTION_STRICT=TRUE
#CONNECTION_ENGINE="InnoDB"

And the db/db.sqlite is writable by the www-data user. But when I run the ./please migrate I get the following error. 

sudo ./please migrate
PHP Warning:  touch(): Unable to create file APP_ROOT . 'app/db/db.sqlite' because No such file or directory in /munkireport/munkireport-php/app/Console/Commands/MigrateCommand.php on line 87

In Connection.php line 664:

  Database (APP_ROOT . 'app/db/db.sqlite') does not exist. (SQL: select * from sqlite_master where type = 'table' and name = migrations)


In SQLiteConnector.php line 34:

  Database (APP_ROOT . 'app/db/db.sqlite') does not exist.

migrate

But the db.sqlite actually exists. When browsing the MR via a web browser, I see the below error when I go to the system status page and the error under Database section. 
Screen Shot 2021-03-03 at 9.46.43 PM.png 
As I mentioned above, I've set the database connection to an embedded SQlite. I assume if my settings were correct this page would show PDO Database driver: sqlite, instead of mysql. 

Can someone please see if I am missing any settings somewhere?  of if more information is required, please let me know. 

A.E. van Bochoven

unread,
Mar 4, 2021, 2:33:36 AM3/4/21
to munki...@googlegroups.com
Make sure that /munkireport/munkireport-php/app/db is also writable by the webserver

Hello, 
<Screen Shot 2021-03-03 at 9.46.43 PM.png> 
As I mentioned above, I've set the database connection to an embedded SQlite. I assume if my settings were correct this page would show PDO Database driver: sqlite, instead of mysql. 

Can someone please see if I am missing any settings somewhere?  of if more information is required, please let me know. 

--
You received this message because you are subscribed to the Google Groups "munkireport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munkireport...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/munkireport/ee8ceb9e-5c9a-4a1f-b006-8d2839fbdccbn%40googlegroups.com.

hahmadi

unread,
Mar 4, 2021, 6:59:53 PM3/4/21
to munkireport
Thanks for the reply. I verified that the www-data user has read/write access to the /munkireport/munkireport-php/app/db path. 
I modified the .enf file and included the full path to the database file in front of the Connection_Database. So it looks like this now.

# DATABASE
# --------
CONNECTION_DRIVER="sqlite"
CONNECTION_DATABASE="/munkireport/munkireport-php/app/db/db.sqlite'"

I also checked inside the db folder and saw that there was already a file called db.sqlite there and www-data user had rwx access to it. I moved it out of the way and re-ran the sudo ./please migrate. and this time it returned the following. Basically, the first line of the error from the previous time was not shown anymore. Though it still complained about the driver. 

sudo ./please migrate

In Connection.php line 664:
could not find driver (SQL: select * from sqlite_master where type = 'table' and name = migrations)
In Exception.php line 18:
  could not find driver
In PDOConnection.php line 38:
  could not find driver

migrate



Reply all
Reply to author
Forward
0 new messages