cakephp / bake

The Bake Command Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection failure checking CounterCache using non-default connection

othercorey opened this issue · comments

Association::getTarget() constructs the Table object using default connection instead of through ModelCommand::getTableObject() which uses the custom connection from -c option.

This table has a composite key so some of the association code is skipped.

One moment while associations are detected.
Bake cannot generate associations for composite primary keys at this time.
Exception: Connection to Postgres could not be established: SQLSTATE[08006] [7] could not translate host name "port=" to address: Unknown host
In [vendor\cakephp\cakephp\src\Database\Driver.php, line 140]

2021-04-10 22:57:20 Error: [Cake\Database\Exception\MissingConnectionException] Connection to Postgres could not be established: SQLSTATE[08006] [7] could not translate host name "port=" to address: Unknown host in Stack Trace:
- vendor\cakephp\cakephp\src\Database\Driver\Postgres.php:109
- vendor\cakephp\cakephp\src\Database\Schema\SchemaDialect.php:47
- vendor\cakephp\cakephp\src\Database\Driver\Postgres.php:146
- vendor\cakephp\cakephp\src\Database\Schema\Collection.php:53
- vendor\cakephp\cakephp\src\Database\Connection.php:399
- vendor\cakephp\cakephp\src\ORM\Table.php:512
- vendor\cakephp\bake\src\Command\ModelCommand.php:927
- vendor\cakephp\bake\src\Command\ModelCommand.php:904
- vendor\cakephp\bake\src\Command\ModelCommand.php:132
- vendor\cakephp\bake\src\Command\ModelCommand.php:98
- vendor\cakephp\bake\src\Command\ModelCommand.php:81
- vendor\cakephp\cakephp\src\Console\BaseCommand.php:179
- vendor\cakephp\cakephp\src\Console\CommandRunner.php:336
- vendor\cakephp\cakephp\src\Console\CommandRunner.php:172
- bin\cake.php:11

@markstory this happens with a non default connection

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days