Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation #192

Closed
pouete opened this issue Jul 17, 2014 · 12 comments
Closed

Installation #192

pouete opened this issue Jul 17, 2014 · 12 comments

Comments

@pouete
Copy link

pouete commented Jul 17, 2014

Hello,

I am installing http://snipeitapp.com/index.php and i encounter some difficulties while following this guide :
http://docs.snipeitapp.com/linuxosx/README.html
on the php artisan app:install command. ( database file is correct )
i get this error :
[InvalidArgumentException]
Database [] not configured.

OS : Ubuntu 14.04 LTS
PHP 5.5.9-1ubuntu4.3
snipeit Commit hash : 04ea052 on branch master ( same problem on branch develop )

Pouete
Keep coding

@snipe
Copy link
Owner

snipe commented Jul 17, 2014

Are you installing for production or local? And did you pass the environment flag through to artisan when you ran the install? We usually see that when the machine is configured for local development, but the hostname is wrong, so it's defaulting to production.

@pouete
Copy link
Author

pouete commented Jul 17, 2014

Wow, that was a quick answer ! thanks :)
i edited the app/config/production/database.php file, so i suppose it is production config anyway ?

@snipe
Copy link
Owner

snipe commented Jul 17, 2014

Do me a favor and move that database.php into app/config (one level above the localized directories) and tell me if that helps.

@pouete
Copy link
Author

pouete commented Jul 17, 2014

Yep, solved :)
thanks !
What was the problem ?

@snipe
Copy link
Owner

snipe commented Jul 17, 2014

Not sure. In a localized environment, it should default to production being in the app/config/production directory, but I have seen it happen where it wants to look for them in app/config instead. I'll look into it.

@notklaatu
Copy link

I also experienced this problem. The solution (moving database.php ..) also fixed it for me.

Also confused as to why.

@ohforheavenssake
Copy link

i'm experiencing the same problem, but moving database.php doesn't seem to fix it. Is there some requirement as to the setup of the database that must be satisfied prior to running the app:install command? Right now all i have is an empty database and an associated user (with all permissions) and the corresponding database.php file.

Hmm...on further inspection (just discovered the log!) it appears that this is related to DatabaseMigrationRepository getConnection, which simply returns $this->resolver->connection($this->connection) which, for some reason, is null.

@snipe
Copy link
Owner

snipe commented Oct 15, 2015

@ohforheavenssake what environment are you running this in? (production, I assume?)

@snipe
Copy link
Owner

snipe commented Oct 15, 2015

(And what environment do your logs think you're running in?)

@ohforheavenssake
Copy link

I'm running (or trying to install/configure) in the production environment.

And the logs...<click mouse, look at log>, hmm...I THINK it's production as evidenced by the first line:

[2015-10-14 08:47:26] production.ERROR: exception 'InvalidArgumentException' with message 'Database [] not configured.' in C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php:263
Stack trace:
#0 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php(156): Illuminate\Database\DatabaseManager->getConfig(NULL)
#1 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\DatabaseManager.php(64): Illuminate\Database\DatabaseManager->makeConnection(NULL)
#2 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\Migrations\DatabaseMigrationRepository.php(167): Illuminate\Database\DatabaseManager->connection(NULL)
#3 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\Migrations\DatabaseMigrationRepository.php(115): Illuminate\Database\Migrations\DatabaseMigrationRepository->getConnection()
#4 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\InstallCommand.php(52): Illuminate\Database\Migrations\DatabaseMigrationRepository->createRepository()
#5 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Console\Command.php(112): Illuminate\Database\Console\Migrations\InstallCommand->fire()
#6 C:\wamp\www\snipe-it\vendor\symfony\console\Symfony\Component\Console\Command\Command.php(253): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Console\Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Console\Command.php(128): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 C:\wamp\www\snipe-it\app\commands\AppCommand.php(90): Illuminate\Console\Command->call('migrate:install')
#10 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Console\Command.php(112): AppCommand->fire()
#11 C:\wamp\www\snipe-it\vendor\symfony\console\Symfony\Component\Console\Command\Command.php(253): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Console\Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 C:\wamp\www\snipe-it\vendor\symfony\console\Symfony\Component\Console\Application.php(889): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 C:\wamp\www\snipe-it\vendor\symfony\console\Symfony\Component\Console\Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(AppCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 C:\wamp\www\snipe-it\vendor\symfony\console\Symfony\Component\Console\Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 C:\wamp\www\snipe-it\artisan(59): Symfony\Component\Console\Application->run()
#17 {main} [] []

@snipe
Copy link
Owner

snipe commented Oct 15, 2015

Can you show me your app/config/production/database.php file, obscuring the password?

@ohforheavenssake
Copy link

Sure, here it is!

PDO::FETCH_CLASS, /* |-------------------------------------------------------------------------- | Default Database Connection Name |-------------------------------------------------------------------------- | | Here you may specify which of the database connections below you wish | to use as your default connection for all database work. Of course | you may use many connections at once using the Database library. | */ 'default' => 'mysql', /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring each database platform that is | supported by Laravel is shown below to make development simple. | | | All database work in Laravel is done through the PHP PDO facilities | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | */ 'connections' => array( 'sqlite' => array( 'driver' => 'sqlite', 'database' => __DIR__.'/../database/production.sqlite', 'prefix' => '', ), 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'snipeit', 'username' => '**********', 'password' => '**********', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), 'pgsql' => array( 'driver' => 'pgsql', 'host' => 'localhost', 'database' => 'database', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', ), 'sqlsrv' => array( 'driver' => 'sqlsrv', 'host' => 'localhost', 'database' => 'database', 'username' => 'root', 'password' => '', 'prefix' => '', ), ), /* |-------------------------------------------------------------------------- | Migration Repository Table |-------------------------------------------------------------------------- | | This table keeps track of all the migrations that have already run for | your application. Using this information, we can determine which of | the migrations on disk have not actually be run in the databases. | */ 'migrations' => 'migrations', /* |-------------------------------------------------------------------------- | Redis Databases |-------------------------------------------------------------------------- | | Redis is an open source, fast, and advanced key-value store that also | provides a richer set of commands than a typical key-value systems | such as APC or Memcached. Laravel makes it easy to dig right in. | */ 'redis' => array( 'cluster' => true, 'default' => array( 'host' => '127.0.0.1', 'port' => 6379, 'database' => 0, ), ), ``` ); ..glen From: snipe [mailto:notifications@github.com] Sent: Thursday, October 15, 2015 10:39 AM To: snipe/snipe-it Cc: Glen Baker Subject: Re: [snipe-it] Installation (#192) Can you show me your app/config/production/database.php files, obscuring the password? — Reply to this email directly or view it on GitHubhttps://github.com//issues/192#issuecomment-148468504.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants