drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

`console` - Error: Undefined index: init in Drupal\Console\Core\EventSubscriber\SaveStatisticsListener->getCommandStatisticsAsArray()

Open glaux opened this issue 4 years ago • 0 comments

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-&gt;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-&gt;getCommandStatisticsAsArray(Ar
         ray, Array) (Line: 131)                                                                                        
         Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;calculateStatistics(Object,                     
         &#039;console.terminate&#039;, Object) (Line: 214)                                                             
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch(Array, &#039;console.terminate&#039;, Object) 
         (Line: 44)                                                                                                     
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&#039;console.terminate&#039;, Object) (Line:   
         1028)                                                                                                          
         Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 255)                     
         Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 187)                                    
         Drupal\Console\Core\Application-&gt;doRun(Object, Object) (Line: 64)                                           
         Drupal\Console\Application-&gt;doRun(Object, Object) (Line: 148)                                               
         Symfony\Component\Console\Application-&gt;run() (Line: 89)                                                     
         require(&#039;/var/www/html/vendor/drupal/console/bin/drupal.php&#039;) (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-&gt;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-&gt;getCommandStatisticsAsArray(Ar
         ray, Array) (Line: 131)                                                                                        
         Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;calculateStatistics(Object,                     
         &#039;console.terminate&#039;, Object) (Line: 214)                                                             
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch(Array, &#039;console.terminate&#039;, Object) 
         (Line: 44)                                                                                                     
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&#039;console.terminate&#039;, Object) (Line:   
         1028)                                                                                                          
         Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 255)                     
         Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 187)                                    
         Drupal\Console\Core\Application-&gt;doRun(Object, Object) (Line: 64)                                           
         Drupal\Console\Application-&gt;doRun(Object, Object) (Line: 148)                                               
         Symfony\Component\Console\Application-&gt;run() (Line: 89)                                                     
         require(&#039;/var/www/html/vendor/drupal/console/bin/drupal.php&#039;) (Line: 4)                              
         </pre>                                                                                                         
                                                                                                                        

                                                                                                                        
 [ERROR] <em class="placeholder">Notice</em>: Undefined index: init in <em                                              
         class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;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-&gt;getCommandStatisticsAsArray(Ar
         ray, Array) (Line: 131)                                                                                        
         Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;calculateStatistics(Object,                     
         &#039;console.terminate&#039;, Object) (Line: 214)                                                             
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch(Array, &#039;console.terminate&#039;, Object) 
         (Line: 44)                                                                                                     
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&#039;console.terminate&#039;, Object) (Line:   
         1028)                                                                                                          
         Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 255)                     
         Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 187)                                    
         Drupal\Console\Core\Application-&gt;doRun(Object, Object) (Line: 64)                                           
         Drupal\Console\Application-&gt;doRun(Object, Object) (Line: 148)                                               
         Symfony\Component\Console\Application-&gt;run() (Line: 89)                                                     
         require(&#039;/var/www/html/vendor/drupal/console/bin/drupal.php&#039;) (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-&gt;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-&gt;getCommandStatisticsAsArray(Ar
         ray, Array) (Line: 131)                                                                                        
         Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;calculateStatistics(Object,                     
         &#039;console.terminate&#039;, Object) (Line: 214)                                                             
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch(Array, &#039;console.terminate&#039;, Object) 
         (Line: 44)                                                                                                     
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&#039;console.terminate&#039;, Object) (Line:   
         1028)                                                                                                          
         Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 255)                     
         Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 187)                                    
         Drupal\Console\Core\Application-&gt;doRun(Object, Object) (Line: 64)                                           
         Drupal\Console\Application-&gt;doRun(Object, Object) (Line: 148)                                               
         Symfony\Component\Console\Application-&gt;run() (Line: 89)                                                     
         require(&#039;/var/www/html/vendor/drupal/console/bin/drupal.php&#039;) (Line: 4)                              
         </pre>                                                                                                         
                                                                                                                        

                                                                                                                        
 [ERROR] <em class="placeholder">Notice</em>: Undefined index: en in <em                                                
         class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;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-&gt;getLanguageStatisticsAsArray(A
         rray, Array) (Line: 132)                                                                                       
         Drupal\Console\Core\EventSubscriber\SendStatisticsListener-&gt;calculateStatistics(Object,                     
         &#039;console.terminate&#039;, Object) (Line: 214)                                                             
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;doDispatch(Array, &#039;console.terminate&#039;, Object) 
         (Line: 44)                                                                                                     
         Symfony\Component\EventDispatcher\EventDispatcher-&gt;dispatch(&#039;console.terminate&#039;, Object) (Line:   
         1028)                                                                                                          
         Symfony\Component\Console\Application-&gt;doRunCommand(Object, Object, Object) (Line: 255)                     
         Symfony\Component\Console\Application-&gt;doRun(Object, Object) (Line: 187)                                    
         Drupal\Console\Core\Application-&gt;doRun(Object, Object) (Line: 64)                                           
         Drupal\Console\Application-&gt;doRun(Object, Object) (Line: 148)                                               
         Symfony\Component\Console\Application-&gt;run() (Line: 89)                                                     
         require(&#039;/var/www/html/vendor/drupal/console/bin/drupal.php&#039;) (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.

glaux avatar Feb 28 '20 11:02 glaux