vagrant@local:/var/www/project$ drush updb
 ------------------- ----------- --------------- ------------------------------ 
  Module              Update ID   Type            Description                   
 ------------------- ----------- --------------- ------------------------------ 
  simple_sitemap      8203        hook_update_n   Splitting                     
                                                  simple_sitemap.settings       
                                                  configuration into            
                                                  simple_sitemap.settings,      
                                                  simple_sitemap.entity_types   
                                                  and simple_sitemap.custom.    
  simple_sitemap      8204        hook_update_n   Removing entity type          
                                                  settings for entity types     
                                                  which do not have the         
                                                  canonical  link template.     
  simple_sitemap      8205        hook_update_n   Splitting                     
                                                  simple_sitemap.entity_types   
                                                  into individual               
                                                  configuration objects  for    
                                                  each bundle.                  
  simple_sitemap      8206        hook_update_n   Placing custom links in a     
                                                  subkey of                     
                                                  simple_sitemap.custom         
                                                  configuration.                
  simple_sitemap      8207        hook_update_n   Updating entity_id field of   
                                                  simple_sitemap_entity_overri  
                                                  des table to varchar(32).     
  simple_sitemap      8208        hook_update_n   Adding changefreq setting to  
                                                  all existing bundle and       
                                                  entity instance settings.     
  simple_sitemap      8209        hook_update_n   Adding image inclusion        
                                                  setting to all existing       
                                                  bundle and entity instance    
                                                  settings.                     
  simple_sitemap      8210        hook_update_n   Adding 'type' and 'delta'     
                                                  fields to simple_sitemap      
                                                  table.                        
  simple_sitemap      8211        hook_update_n   Adding                        
                                                  simple_sitemap.variants and   
                                                  simple_sitemap.types to       
                                                  configuration.                
  simple_sitemap      8212        hook_update_n   Changing storage data type    
                                                  of 'index' and                
                                                  'include_images' from         
                                                  integer to boolean.           
  simple_sitemap      8213        hook_update_n   Altering the configuration    
                                                  storage of variants.          
  simple_sitemap      8214        hook_update_n   Removing sitemap types from   
                                                  configuration as they are to  
                                                  be stored as plugins in       
                                                  code.                         
  simple_sitemap      8215        hook_update_n   Adding 'status' field to      
                                                  simple_sitemap table and      
                                                  weight to variants.           
  simple_sitemap      8216        hook_update_n   Adding per-variant bundle     
                                                  and entity override           
                                                  configuration.                
  simple_sitemap      8217        hook_update_n   Adding per-variant custom     
                                                  link configuration.           
  simple_sitemap      8301        hook_update_n   Changing id and delta fields  
                                                  of simple_sitemap table from  
                                                  smallint to int.              
  simple_sitemap      8302        hook_update_n   Removing unused               
                                                  batch_process_limit key from  
                                                  simple_sitemap.settings       
                                                  configuration.                
  menu_link_content   make_menu   post-update     Update custom menu links to   
                      _link_con                   be revisionable.              
                      tent_revi                                                 
                      sionable                                                  
  system              add_expan   post-update     Initialize                    
                      d_all_ite                   'expand_all_items' values to  
                      ms_key_in                   system_menu_block.            
                      _system_m                                                 
                      enu_block                                                 
  system              clear_men   post-update     Clear the menu cache.   @see  
                      u_cache                     https:www.drupal.orgprojectd  
                                                  rupalissues3044364            
  system              fix_jquer   post-update     Clear the library cache and   
                      y_extend                    ensure aggregate files are    
                                                  regenerated.                  
  taxonomy            make_taxo   post-update     Update taxonomy terms to be   
                      nomy_term                   revisionable.                 
                      _revision                                                 
                      able                                                      
  taxonomy            remove_hi   post-update     Remove the 'hierarchy'        
                      erarchy_f                   property from vocabularies.   
                      rom_vocab                                                 
                      ularies                                                   
  views               exposed_f   post-update     Update exposed filter blocks  
                      ilter_blo                   label display to be           
                      cks_label                   disabled.                     
                      _display                                                  
  views               make_plac   post-update     Rebuild cache to allow        
                      eholders_                   placeholder texts to be       
                      translata                   translatable.                 
                      ble                                                       
 ------------------- ----------- --------------- ------------------------------ 


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > 

>  [notice] Update started: simple_sitemap_update_8203
>  [error]  Argument 1 passed to Drupal\Core\Config\Config::setData() must be of the type array, null given, called in /var/www/project/docroot/modules/contrib/simple_sitemap/simple_sitemap.install on line 298 
>  [error]  Update failed: simple_sitemap_update_8203 
 [error]  Update aborted by: simple_sitemap_update_8203 
 [error]  Finished performing updates. 
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ARUN AK created an issue. See original summary.

ARUN AK’s picture

Category: Support request » Bug report
FileSize
568 bytes
gbyte’s picture

Version: 8.x-3.3 » 8.x-3.x-dev
Status: Active » Closed (cannot reproduce)

Thanks for the patch.

Please always test the dev version of the module and submit bug reports against the dev version.

This is out of ordinary, something must be wrong with your installation given that you are missing the settings configuration key.

I will mark this as cannot reproduce, but will be happy to take another look if other people can confirm this issue.

bburg’s picture

I ran into this issue after pushing to a remote dev site and running my deploy scripts. My hunch is that this can happen depending on the order of the commands you run during deployment. In my case, I needed a Feed Type config to exist before running database updates (I normally run them in the other order, but the deployment I am preparing for required it), so I ran config import before running database updates. However, this code up simple_sitemap_update_8203() expects the key "settings" to exist before it sets it as the "simple_sitemap.settings" config. I ran config-export locally before committing my config files and pushing them to dev.

  $settings = $old_config->get('settings');
  \Drupal::service('config.factory')->getEditable("simple_sitemap.settings")
    ->setData($settings)->save();

So it would seem that updating your config before deployment, and then running drush config-import before running updb is likely causing this. My suggestion would be to perhaps to check if $settings is not null here before attempting to save it.

bburg’s picture

Whoops, I created this patch before realizing ARUN AK's does pretty much exactly the same thing.

agileadam’s picture

I just had this issue with 3.7.0. The patch in #2 worked well.

frondeau’s picture

I propose a patch for current version 4.x, nearly the same as previous ones but with difference of lines.

Please report it to current version to fix the updates to Drupal 9.

  • gbyte committed 188173f on 4.x
    Issue #3073753 by informaid, ARUN AK, bburg, gbyte: Updb fails,...
gbyte’s picture

Version: 4.0.0 » 4.x-dev
Status: Patch (to be ported) » Fixed

I don't want people to update to 2.x/3.x, so we leave it in 4.x only.

Apparently there is a lot of strange use cases one needs to think about when writing update hooks...

Status: Fixed » Closed (fixed)

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