After upgrading to Drupal Console 1.9 release, I got two errors on each Drupal console, even via simple drupal run without arguments. Here is output
[ERROR] <em class="placeholder">Notice</em>: Undefined index: statistics in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SaveStatisticsListener->saveStatistics()</em> (line
<em class="placeholder">78</em> of <em
class="placeholder">vendor/drupal/console-core/src/EventSubscri
ber/SaveStatisticsListener.php</em>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SaveStatisticsListener->saveStatistics(Object,
'console.terminate', Object) (Line: 212)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1014)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 188)
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('vendor/drupal/console/bin/drupal.php')
(Line: 4)
</pre>
[ERROR] <em class="placeholder">Notice</em>: Undefined index: statistics in <em
class="placeholder">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics()</em>
(line <em class="placeholder">71</em> of <em
class="placeholder">vendor/drupal/console-core/src/EventSubscri
ber/SendStatisticsListener.php</em>). <pre
class="backtrace">Drupal\Console\Core\EventSubscriber\SendStatisticsListener->calculateStatistics(Object,
'console.terminate', Object) (Line: 212)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.terminate', Object)
(Line: 44)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.terminate', Object) (Line:
1014)
Symfony\Component\Console\Application->doRunCommand(Object, Object, Object) (Line: 255)
Symfony\Component\Console\Application->doRun(Object, Object) (Line: 188)
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('vendor/drupal/console/bin/drupal.php')
(Line: 4)
</pre>
All seems works well, but those errors are annoying. What does they mean and how to fix them?
@MurzNN thanks for your report.
We couldn't reproduce your error, could you help us with the following info
To try to fix your error I recommend you run the command drupal init -f to force to overwrite your config, but please rescue your current setup before to help us to fix and improve Drupal Console.
All versions are 1.9:
$ drupal --version
Drupal Console version 1.9.0
$ /usr/local/bin/drupal --version
Drupal Console version 1.9.0
$ vendor/drupal/console/bin/drupal --version
Drupal Console version 1.9.0
Drupal Console core version (from `composer.json`) - "drupal/console": "1.9",
Drupal: "drupal/core": "^8.6",
~/.console/config.yml
application:
environment: 'prod'
language: 'en'
# editor: 'vim'
temp: '/tmp'
develop: 'false'
command: 'list'
checked: 'false'
clear: 'false'
extras:
alias: 'true'
extend: 'true'
config: 'true'
chains: 'true'
mappings: 'true'
overrides:
config:
skip-validate-site-uuid: true
remote:
port: '22'
user: 'drupal'
type: 'ssh'
options:
learning: false
# target: 'site-alias.dev'
# uri: 'multi-site.dev'
generate-inline: false
generate-chain: false
Hi @MurzNN, I couldn't reproduce this issue, but I added an extra validation to avoid future issues like this one.
It will be available in the next version 1.9.1 (in a month). But if you want to try this, you need to set up a development environment.
Here a guide to set up a development environment:
Choose the repos, You only need the console and the console-core
https://docs.drupalconsole.com/en/contributing/getting-the-project.html
finally, following this guide to finish:
https://docs.drupalconsole.com/en/contributing/running-the-project.html
If you have questions, let me know. @MurzNN
I had the same issue. I added these lines to config.yml -- after seeing what changed after a drupal init -- and it went away:
statistics:
enabled: true
url: 'https://drupalconsole.com/statistics?_format=json'
last-attempted: ~
times-attempted: 0
Thanks @ndouglas The next release will fix it.
@harold20 is this fixed?
Yes @jmolivas it was fixed
Yes, fixed!
Most helpful comment
Thanks @ndouglas The next release will fix it.