Original Error

After updating to Drupal 10.3.0, there’s this system_post_update_add_langcode_to_all_translatable_config function added to the web/core/modules/system/system.post_update.php update file, which will get triggered when running post update via drush updb or visiting /update.php.

For some site, this seem to run without any hiccups, but for some others, when running drush updb, I got the following:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 -------- ----------------------------------------- ------------- ------------------------------------------------------ 
  Module   Update ID                                 Type          Description                                           
 -------- ----------------------------------------- ------------- ------------------------------------------------------ 
  system   add_langcode_to_all_translatable_config   post-update   Adds a langcode to all simple config which needs it.  
 -------- ----------------------------------------- ------------- ------------------------------------------------------ 


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

>  [notice] Update started: system_post_update_add_langcode_to_all_translatable_config
> PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php on line 211
> PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0

In ProcessBase.php line 171:
                                                                                                                                                   
  Unable to decode output into JSON: Syntax error                                                                                                  
                                                                                                                                                   
  Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/web/core/lib/Drupal/Core/Plugi  
  n/DefaultPluginManager.php on line 211                                                                                                           
                                                                                                                                                   
  Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0                             
                                                                                                                                                   

Failed to run drush updb: exit status 1

And updating via the GUI interface at update.php will just end up in infinite loading.

Solution

After some digging around, I found this comment #7 under issue #3466103, he claims the issues are theme related, and he worked around it via:

  1. turn on site maintenance mode
  2. exporting the current settings as backup via drush cex
  3. set the default theme to bartik , disable the custom theme (and bootstrap_barrio)
  4. re-trying the drush updb
  5. re-importing the settings via drush cim
  6. flush cache
  7. turn off site maintenance mode

Below is the CLI command you can run in the terminal to archive these:

1
2
3
4
5
6
7
8
drush state:set system.maintenance_mode 1
drush cex
drush theme:install bartik
drush config-set system.theme default bartik
drush theme:uninstall <custom-theme-name>
# drush theme:uninstall bootstrap_barrio
drush cim
drush state:set system.maintenance_mode 0

Reference