cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
14.07k stars 1.56k forks source link

"unable to open database file" with L5 fresh install #689

Closed xtavras closed 9 years ago

xtavras commented 9 years ago

Hello,

I've cloned fresh cachet install following all steps in documentation [1], but if I run "php artisan migrate" it gives: "SQLSTATE[HY000] [14] unable to open database file". Here is my ".env" file:

APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost
APP_KEY=SomeRandomString

DB_DRIVER=sqlite
DB_HOST=
DB_DATABASE=cachet
DB_USERNAME=
DB_PASSWORD=

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null

Did I miss something? php5-sqlite package is installed

here is "php artisan migrate" with verbose output


  [PDOException]                                     
  SQLSTATE[HY000] [14] unable to open database file  

Exception trace:
 () at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:49
 PDO->__construct() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:49
 Illuminate\Database\Connectors\Connector->createConnection() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:37
 Illuminate\Database\Connectors\SQLiteConnector->connect() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:59
 Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:48
 Illuminate\Database\Connectors\ConnectionFactory->make() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:174
 Illuminate\Database\DatabaseManager->makeConnection() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:66
 Illuminate\Database\DatabaseManager->connection() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:168
 Illuminate\Database\Migrations\DatabaseMigrationRepository->getConnection() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:136
 Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:392
 Illuminate\Database\Migrations\Migrator->repositoryExists() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:100
 Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:58
 Illuminate\Database\Console\Migrations\MigrateCommand->fire() at n/a:n/a
 call_user_func_array() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Container/Container.php:499
 Illuminate\Container\Container->call() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Console/Command.php:150
 Illuminate\Console\Command->execute() at /var/www/cachet-l5/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Console/Command.php:136
 Illuminate\Console\Command->run() at /var/www/cachet-l5/vendor/symfony/console/Application.php:878
 Symfony\Component\Console\Application->doRunCommand() at /var/www/cachet-l5/vendor/symfony/console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /var/www/cachet-l5/vendor/symfony/console/Application.php:126
 Symfony\Component\Console\Application->run() at /var/www/cachet-l5/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:94
 Illuminate\Foundation\Console\Kernel->handle() at /var/www/cachet-l5/artisan:36

[1] http://cachet.readme.io/v1.0/docs/installing-cachet

jbrooksuk commented 9 years ago

You need to create a database.sqlite file within storage.

jbrooksuk commented 9 years ago

Firstly, remove the DB_HOST key from the .env file. Now create storage/database.sqlite and give it the relevant permissions.

jbrooksuk commented 9 years ago

FWIW I'll update the documentation when I can.

xtavras commented 9 years ago

With create you mean "touch storage/cachet.sqlite" ?

jbrooksuk commented 9 years ago

storage/database.sqlite

xtavras commented 9 years ago

Thanks, it works!

jbrooksuk commented 9 years ago

My pleasure :)