drupal-console
drupal-console copied to clipboard
`console` - Error: Undefined index: init in Drupal\Console\Core\EventSubscriber\SaveStatisticsListener->getCommandStatisticsAsArray()
Problem/Motivation
The first time i run drupal cache:rebuild
after bringing my docker container online, I get the following warnings:
[ERROR] <em class="placeholder">Notice</em>: Undefined index: init in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(
)</em> (line <em class="placeholder">185</em> of <em
class="placeholder">/var/www/html/vendor/drupal/console-core/src/EventSubscriber/SendStatisticsListener.php</e
m>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(Ar
ray, Array) (Line: 131)
Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 214)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1028)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 187)
Drupal\Console\Core\Application->doRun(Object, Object) (Line: 64)
Drupal\Console\Application->doRun(Object, Object) (Line: 148)
Symfony\Component\Console\Application->run() (Line: 89)
require('/var/www/html/vendor/drupal/console/bin/drupal.php') (Line: 4)
</pre>
[ERROR] <em class="placeholder">Notice</em>: Trying to access array offset on value of type null in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(
)</em> (line <em class="placeholder">185</em> of <em
class="placeholder">/var/www/html/vendor/drupal/console-core/src/EventSubscriber/SendStatisticsListener.php</e
m>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(Ar
ray, Array) (Line: 131)
Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 214)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1028)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 187)
Drupal\Console\Core\Application->doRun(Object, Object) (Line: 64)
Drupal\Console\Application->doRun(Object, Object) (Line: 148)
Symfony\Component\Console\Application->run() (Line: 89)
require('/var/www/html/vendor/drupal/console/bin/drupal.php') (Line: 4)
</pre>
[ERROR] <em class="placeholder">Notice</em>: Undefined index: init in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(
)</em> (line <em class="placeholder">186</em> of <em
class="placeholder">/var/www/html/vendor/drupal/console-core/src/EventSubscriber/SendStatisticsListener.php</e
m>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(Ar
ray, Array) (Line: 131)
Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 214)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1028)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 187)
Drupal\Console\Core\Application->doRun(Object, Object) (Line: 64)
Drupal\Console\Application->doRun(Object, Object) (Line: 148)
Symfony\Component\Console\Application->run() (Line: 89)
require('/var/www/html/vendor/drupal/console/bin/drupal.php') (Line: 4)
</pre>
[ERROR] <em class="placeholder">Notice</em>: Trying to access array offset on value of type null in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(
)</em> (line <em class="placeholder">186</em> of <em
class="placeholder">/var/www/html/vendor/drupal/console-core/src/EventSubscriber/SendStatisticsListener.php</e
m>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getCommandStatisticsAsArray(Ar
ray, Array) (Line: 131)
Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 214)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1028)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 187)
Drupal\Console\Core\Application->doRun(Object, Object) (Line: 64)
Drupal\Console\Application->doRun(Object, Object) (Line: 148)
Symfony\Component\Console\Application->run() (Line: 89)
require('/var/www/html/vendor/drupal/console/bin/drupal.php') (Line: 4)
</pre>
[ERROR] <em class="placeholder">Notice</em>: Undefined index: en in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getLanguageStatisticsAsArray
()</em> (line <em class="placeholder">203</em> of <em
class="placeholder">/var/www/html/vendor/drupal/console-core/src/EventSubscriber/SendStatisticsListener.php</e
m>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->getLanguageStatisticsAsArray(A
rray, Array) (Line: 132)
Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 214)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1028)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 187)
Drupal\Console\Core\Application->doRun(Object, Object) (Line: 64)
Drupal\Console\Application->doRun(Object, Object) (Line: 148)
Symfony\Component\Console\Application->run() (Line: 89)
require('/var/www/html/vendor/drupal/console/bin/drupal.php') (Line: 4)
</pre>
How to reproduce
This is happening in all my containers pretty consistently. After the warnings have been shown once, the don't appear for some time, or until I take the container down and bring it up again.
- Drupal version: 8.9.0-dev (has been the same since 8.6)
- Console version: 1.9.4
- Console Launcher version: 1.9.4
Solution
This is very similar to #4088, but the proposed resolution in that thread has no effect on this issue.