<p>I have an app running with Docker and the .git directory is ignored to reduced the project's size.</p>

<p>The problem is that every time an artisan command is ran this message is displayed and stored inside the logs of Kubernetes. Moreover, in some cases is the reason why some kubernetes tasks cannot reach the HEALTHY status.</p>

<p>I have a Cronjob with kubernetes which reaches just 2/3 and the only message that the logs displayed is this one.</p>

<p><a href="https://github.com/monicahq/monica/pull/950" rel="noreferrer">monicahq/monica PR 950</a> is an example of a workaround where the Sentry configuration is modified to test for the presence of the Git repository, ensuring <code>php artisan config:cache</code> is run only once.</p>

<pre><code>// capture release as git sha
'release' =&gt; is_dir(__DIR__.'/../.git') ? trim(exec('git log --pretty="%h" -n1 HEAD')) : null,
</code></pre>
