# Connection problem with Fixture Factory v3.0

**URL:** <https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569>\
**Category:** Uncategorized\
**Tags:** help\
**Created:** [October 10, 2023, 4:57am UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569 "2023-10-10T04:57:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [October 10, 2023, 4:57am UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569/1 "2023-10-10T04:57:59Z")

</div>

I’m having a problem when trying to bake a new factory.  
It seems the db configuration is not being found and used?

```plaintext
Stack Trace:
- /Users/dondrake/Sites/ck5/vendor/vierge-noire/cakephp-fixture-factories/src/Command/BakeFixtureFactoryCommand.php:219
- /Users/dondrake/Sites/ck5/vendor/cakephp/cakephp/src/Console/BaseCommand.php:192
- /Users/dondrake/Sites/ck5/vendor/cakephp/cakephp/src/Console/CommandRunner.php:327
- /Users/dondrake/Sites/ck5/vendor/cakephp/cakephp/src/Console/CommandRunner.php:168
- /Users/dondrake/Sites/ck5/bin/cake.php:10
- [main]:

[TypeError] Cannot assign null to property Bake\Command\BakeCommand::$connection of type string in /Users/dondrake/Sites/ck5/vendor/cakephp/bake/src/Utility/CommonOptionsTrait.php on line 77

Stack Trace:

Bake\Command\BakeCommand->extractCommonProperties() - ROOT/vendor/vierge-noire/cakephp-fixture-factories/src/Command/BakeFixtureFactoryCommand.php, line 219
CakephpFixtureFactories\Command\BakeFixtureFactoryCommand->execute() - CORE/src/Console/BaseCommand.php, line 192
Cake\Console\BaseCommand->run() - CORE/src/Console/CommandRunner.php, line 327
Cake\Console\CommandRunner->runCommand() - CORE/src/Console/CommandRunner.php, line 168
Cake\Console\CommandRunner->run() - ROOT/bin/cake.php, line 10
[main] - [main], line 0

```

**What I’ve done so far**  
The traditional, built-in Cake fixtures work with the testing db and several unit tests that use fixture data work fine.

I composed in the new version of Fixture Factory and loaded the plugin as instructed in the Setup instructions.

Running the `bake fixture_factory <model-name>` produces the error shown.

My original efforts were in a Docker environment. The db config in this installation was a url in an `env` variable.

Thinking I might have something wrong there I made a new CakePHP 5.x app and did the setup for Fixture Factory. In this case I made the db config by setting the various array keys appropriately.

The home page shows green for all the Cake pieces.

Baking a new Factory yields the same error.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [October 10, 2023, 5:15am UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569/2 "2023-10-10T05:15:49Z")

</div>

Can confirm this error. Will look into it.

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [October 10, 2023, 5:40am UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569/3 "2023-10-10T05:40:30Z")

</div>

See [fix common options missing and warning by LordSimal · Pull Request #231 · vierge-noire/cakephp-fixture-factories · GitHub](https://github.com/vierge-noire/cakephp-fixture-factories/pull/231)

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [October 10, 2023, 3:48pm UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569/4 "2023-10-10T15:48:30Z")

</div>

That’s gonna fix it for me!

Back to my happy-place with fixtures

---

<div class="post-metadata">

**Author:** ![pabloelcolombiano](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/pabloelcolombiano/32/2095_2.png) [@pabloelcolombiano](https://discourse.cakephp.org/u/pabloelcolombiano)\
**Post date:** [October 11, 2023, 7:42pm UTC](https://discourse.cakephp.org/t/connection-problem-with-fixture-factory-v3-0/11569/5 "2023-10-11T19:42:32Z")

</div>

Fixed in v3.0.1. Thanks @dreamingmind for reporting the issue.Thanks @KevinPfeifer for the fix.
