When performing updates from 2.6 to 2.7, I am getting the following error running updates with Drush:

TypeError: Argument 1 passed to Drupal\Core\Config\Config::setData() must be of the type array, null given, called in       [error]
/var/www/html/modules/contrib/simple_sitemap/simple_sitemap.install on line 216 in Drupal\Core\Config\Config->setData()
(line 106 of /var/www/html/core/lib/Drupal/Core/Config/Config.php) #0
/var/www/html/modules/contrib/simple_sitemap/simple_sitemap.install(216): Drupal\Core\Config\Config->setData(NULL)

This also happens when running the update script:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /update.php/start?id=15&op=do_nojs&op=do
StatusText: OK
ResponseText: TypeError: Argument 1 passed to Drupal\Core\Config\Config::setData() must be of the type array, null given, called in /var/www/html/modules/contrib/simple_sitemap/simple_sitemap.install on line 216 in Drupal\Core\Config\Config->setData() (line 106 of /var/www/html/core/lib/Drupal/Core/Config/Config.php).

Using the dev version results in the same error.

Here is the stack trace:

#1 /var/www/vendor/drush/drush/commands/core/drupal/update.inc(60): simple_sitemap_update_8203(Array)
#2 /var/www/vendor/drush/drush/commands/core/drupal/batch.inc(163): drush_update_do_one('simple_sitemap', 8203, Array,
Object(DrushBatchContext))
#3 /var/www/vendor/drush/drush/commands/core/drupal/batch.inc(111): _drush_batch_worker()
#4 /var/www/vendor/drush/drush/includes/batch.inc(98): _drush_batch_command('15')
#5 /var/www/vendor/drush/drush/commands/core/drupal/update.inc(174): drush_batch_command('15')
#6 /var/www/vendor/drush/drush/commands/core/core.drush.inc(1224): _update_batch_command('15')
#7 /var/www/vendor/drush/drush/includes/command.inc(422): drush_core_updatedb_batch_process('15')
#8 /var/www/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#9 /var/www/vendor/drush/drush/includes/command.inc(199): drush_command('15')
#10 /var/www/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 /var/www/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /var/www/vendor/drush/drush/drush.php(12): drush_main()
#13 {main}.

Comments

dobrzyns created an issue. See original summary.

dobrzyns’s picture

Issue summary: View changes

Adding results when running with the update script to the issue summary.

gbyte’s picture

It appears you are missing either simple_sitemap.custom, or simple_sitemap.entity_types from your configuration. I am not sure how this could happen. Can you paste the contents of all your configuration files beginning with simple_sitemap?

abaier’s picture

I also had a problem with this update. After running the update script from the web interface, returning to the update page, I got the following php error, wsod. It does not show up anymore after clearing all caches, but I am not sure if everything was updated as expected.

Uncaught PHP Exception
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "simple_sitemap.form". Did you mean one of these: "simple_sitemap.form_helper", "simple_sitemap.logger"?" at /Applications/MAMP/htdocs/pleasuremag2016/www/core/lib/Drupal/Component/DependencyInjection/Container.php line 157
abaier’s picture

Ok, I had to run update.php again to perform the updates correctly. Without errors this time.

dobrzyns’s picture

From the config export (using the Drush command with config_split), the only simple_sitemap config file I have is simple_sitemap.settings.yml.

simple_sitemap.settings.yml

settings:
  max_links: 2000
  cron_generate: true
  remove_duplicates: true
  skip_untranslated: true
  batch_process_limit: 1500
entity_types:
  node:
    article:
      index: 1
      priority: 0.5
    basic_page:
      index: 1
      priority: 0.5
  menu_link_content: {  }
  yamlform_submission: {  }
  redirect:
    redirect:
      index: 1
      priority: 0.5
gbyte’s picture

If you have v. 8.x-2.6, your simple_sitemap.settings.yml should include the custom: {} key as well. No idea what happened to it; have you made any manual changes to the config?. Just add the above line at the bottom of the config using the devel module and then run the update. Alternatively just reinstall the module, but you will loose your config.

gbyte’s picture

Status: Active » Postponed (maintainer needs more info)
dobrzyns’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I didn't edit the config files manually. I exported the config with Features as well, just to see the output, and that file was also missing custom: {}. After adding this line to the bottom of the config file (core--removed Features config file simple_sitemap.settings.yml), I still had the same errors on running updates.

In the end, I just uninstalled and reinstalled the module to resolve the issue. Since this doesn't seem to be a common problem (I'm guessing there's something specific to my site somewhere), I'm closing the issue. (Ideally, I would do more investigation to try to figure out the exact cause but unfortunately do not have the bandwidth to do so right now.)

jeroent’s picture

I had the same error when updating from 2.6 to 2.7. Re-installing the module solved the problem.

gbyte’s picture

Version: 8.x-2.7 » 8.x-2.x-dev
Status: Closed (cannot reproduce) » Fixed

Fixed in dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.