bake icon indicating copy to clipboard operation
bake copied to clipboard

Connection failure checking CounterCache using non-default connection

Open othercorey opened this issue 4 years ago • 1 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

othercorey avatar Apr 11 '21 04:04 othercorey

@markstory this happens with a non default connection

othercorey avatar Oct 01 '22 12:10 othercorey

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

github-actions[bot] avatar Jan 30 '23 00:01 github-actions[bot]