-
Notifications
You must be signed in to change notification settings - Fork 80
Description
When upgrading from Sentry module 3.9 to 4.0, we're suddenly getting Connection "default" is not defined errors in our patch helper and static testing pipelines (which obviously don't have a database set up).
$ php bin/magento module:config:status
In ResourceConnection.php line [161](https://gitlab.elgentos.nl/pluim/magento2/-/jobs/1268210#L161):
Connection "default" is not defined
We see this consistently in 10+ projects (Magento 2.4.7-p5 and 2.4.8 on PHP 8.3). A clue is that we only see this in CI, locally we can't seem to reproduce it yet.
Apparently, the changes done from 3.9 to 4.0 introduce something that requires a database connection on instantiation. But I can't find/see what it its in the diff.
I'm suspecting the newly introduced JustBetter\Sentry\Model\Collector\SentryRelatedCspCollector. That file injects the JustBetter\Sentry\Helper\Data, which has these deps;
public function __construct(
Context $context,
protected StoreManagerInterface $storeManager,
protected State $appState,
private Json $serializer,
protected ProductMetadataInterface $productMetadataInterface,
protected DeploymentConfig $deploymentConfig
) {I think one of these deps forces a database connection.
That non-nullable deploymentConfig might be it. In JustBetter\Sentry\Helper\Version that one is nullable.