Page 1 of 1

Configuration parameter "adapter" missing in "db"

Posted: 07 Mar 2017, 04:32
by Mostafa
I got an error after executing

Code: Select all

php artisan aimeos:setup --option=setup/default/demo:1
The error message is:

Code: Select all

[Aimeos\MW\Setup\Exception]
Configuration parameter "adapter" missing in "db"
Do you know what is this error about?
I checked database connection and it seems to be ok.

php-version: 7.0.15
Aimeos version: 2017.03.1
ubuntu 16.04

Re: Configuration parameter "adapter" missing in "db"

Posted: 07 Mar 2017, 10:46
by aimeos
The problem is the ".env" file. Please check if it contains the "DB_CONNECTION" variable set correctly

Sometimes, it also doesn't work as expected. Ddd your database configuration to your "./config/shop.php" file directly in this case:
https://github.com/aimeos/aimeos-larave ... op.php#L29

Re: Configuration parameter "adapter" missing in "db"

Posted: 14 Mar 2017, 16:04
by Iago Calazans
"Add your database configuration to your "./config/shop.php" file directly in this case" - nothing happens, receive the same message.

In order to make it work for me, i had to pass the array['db'] values manually into the Multiple.php file. :shock:

Before ...foreach( $dbconfig as $rname => $dbconf )... on line 56, i insert:

$dbconfig = array('db' => array('adapter' => 'mysql', 'database' => 'sdbdev'));

Why to do that? I notice that $dbconfig var didn't receive the array structure, pulling only the first nivel 'db' -> array (0);

php-version: 7.0.16
Aimeos version: 2017.03.1
CentOS 6.5

Re: Configuration parameter "adapter" missing in "db"

Posted: 14 Mar 2017, 21:37
by aimeos
Did you add all necessary database configuration to your ./config/shop.php (adapter, host, port, database, username, password and stmts)? If yes, does it work if you remove the "env()" function and use only the literal strings?

Code: Select all

	'resource' => array(
		'db' => array(
			'adapter' => 'mysql',
			'host' => 'localhost',
			'port' => '',
			'database' => 'laravel',
			'username' => 'root',
			'password' => 'secret',
			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
		),
	),

Re: Configuration parameter "adapter" missing in "db"

Posted: 14 Mar 2017, 22:18
by Iago Calazans
aimeos wrote:Did you add all necessary database configuration to your ./config/shop.php (adapter, host, port, database, username, password and stmts)? If yes, does it work if you remove the "env()" function and use only the literal strings?

Code: Select all

	'resource' => array(
		'db' => array(
			'adapter' => 'mysql',
			'host' => 'localhost',
			'port' => '',
			'database' => 'laravel',
			'username' => 'root',
			'password' => 'secret',
			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
		),
	),
Yes and No. I add all the necessary database config, but even removing the "env()" it still does not work. The only way i found was a manual insert of the code line "$dbconfig = array('db' => array('adapter' => 'mysql', 'database' => 'sdbdev'));" and running php artisan aimeos:setup. After then remove the code.

Re: Configuration parameter "adapter" missing in "db"

Posted: 14 Mar 2017, 22:53
by aimeos
That can't be the solution :-/
Can you post your full ./config/shop.php file and the error message thrown by the "./artisan aimeos:setup" command?

Re: Configuration parameter "adapter" missing in "db"

Posted: 20 Mar 2017, 04:43
by Iago Calazans
aimeos wrote:That can't be the solution :-/
Can you post your full ./config/shop.php file and the error message thrown by the "./artisan aimeos:setup" command?

Code: Select all

<?php

return array(

	'routes' => array(
		// 'login' => array('middleware' => ['web']),
		// 'admin' => array('middleware' => ['web', 'auth']),
		// 'account' => array('middleware' => ['web', 'auth']),
		// 'jsonapi' => array('middleware' => ['web']),
		// 'default' => array('middleware' => ['web']),
		// 'confirm' => array('middleware' => ['web']),
		// 'update' => array(),
	),

	'page' => array(
		// 'account-index' => array( 'account/profile','account/history','account/favorite','account/watch','basket/mini','catalog/session' ),
		// 'basket-index' => array( 'basket/standard','basket/related' ),
		// 'catalog-count' => array( 'catalog/count' ),
		// 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ),
		// 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ),
		// 'catalog-stock' => array( 'catalog/stock' ),
		// 'catalog-suggest' => array( 'catalog/suggest' ),
		// 'checkout-confirm' => array( 'checkout/confirm' ),
		// 'checkout-index' => array( 'checkout/standard' ),
		// 'checkout-update' => array( 'checkout/update'),
	),

	'resource' => array(
      'db' => array(
         'adapter' => 'mysql',
         'host' => 'localhost',
         'port' => '',
         'database' => 'sctdb',
         'username' => 'root',
         'password' => '',
         'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
     ),
	),


	'admin' => array(),

	'client' => array(
		'html' => array(
			'common' => array(
				'content' => array(
					// 'baseurl' => '/',
				),
				'template' => array(
					// 'baseurl' => 'packages/aimeos/shop/themes/elegance',
				),
			),
		),
	),

	'controller' => array(
	),

	'i18n' => array(
	),

	'madmin' => array(
	),

	'mshop' => array(
	),


	'command' => array(
	),

	'frontend' => array(
	),

	'backend' => array(
	),
);
And the error is:

[Aimeos\MW\Setup\Exception]
Configuration parameter "adapter" missing in "db"

Re: Configuration parameter "adapter" missing in "db"

Posted: 20 Mar 2017, 18:19
by aimeos
We get the same problem when using the default "./config/shop.php" because it contains these lines:

Code: Select all

	'resource' => array(
		'db' => array(
			// 'adapter' => env('DB_CONNECTION', 'mysql'),
			// 'host' => env('DB_HOST', 'localhost'),
			// 'port' => env('DB_PORT', ''),
			// 'socket' => '',
			// 'database' => env('DB_DATABASE', 'laravel'),
			// 'username' => env('DB_USERNAME', 'root'),
			// 'password' => env('DB_PASSWORD', ''),
			// 'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
		),
	),
They cause an empty "resource/db" array in the Aimeos setup command but removing all comments works:

Code: Select all

	'resource' => array(
		'db' => array(
			'adapter' => env('DB_CONNECTION', 'mysql'),
			'host' => env('DB_HOST', 'localhost'),
			'port' => env('DB_PORT', ''),
			'socket' => '',
			'database' => env('DB_DATABASE', 'laravel'),
			'username' => env('DB_USERNAME', 'root'),
			'password' => env('DB_PASSWORD', ''),
			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
		),
	),
What works too is to comment out the whole block:

Code: Select all

/*
	'resource' => array(
		'db' => array(
			'adapter' => env('DB_CONNECTION', 'mysql'),
			'host' => env('DB_HOST', 'localhost'),
			'port' => env('DB_PORT', ''),
			'socket' => '',
			'database' => env('DB_DATABASE', 'laravel'),
			'username' => env('DB_USERNAME', 'root'),
			'password' => env('DB_PASSWORD', ''),
			'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ),
		),
	),
*/
Then, the default resource configuration is used.