Closed screw closed 3 weeks ago
Hey, how did you identify this as a Clockwork issue? Do you have a full exception trace? The error only mentions PDOConnection.php
, which doesn't seem to be a file included in Laravel.
Well when I disable package discovery for clockwork, or remove clockwork altogether I don't get any error.
Also when I configure clockwork to use files
as the storage, the build succeeds.
That's why I thought it is related to clockwork.
So I've been looking into this and I don't think we can do anything to improve the situation here.
Currently we are constructing the storage instance when the Laravel service provider is registered, which causes the database connection to be made. We could do it a little bit later when the service provider is booted, but this does not change anything, since running artisan commands both registers and boots all service providers.
In fact I would consider this a misconfiguration on your part as you are setting Clockwork to use SQL database without having the database available. I would suggest overriding the CLOCKWORK_STORAGE
for your CI process to not use database or even fully disabling Clockwork using CLOCKWORK_ENABLE=false
.
My app build fails with clockwork during composer install because clockwork tries to access the SQL connection. But the SQL connection is another docker container which is not present during the build.
clockwork.php includes:
In my Dockerfile I have:
composer install --no-interaction --classmap-authoritative
which then triggers:
"post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ],
which results in:
Any idea how I can prevent clockwork from trying to access the storage during package discovery?