Problem/Motivation

I would like to regenerate the sitemap.xml on a website which has Config ReadOnly enabled.
This is currently not possible because I get the following error:

-> % drush xmlsitemap:regenerate
>  [notice] https://mysite.local/sitemap.xml?page=1 wurde mit 535 Links erzeugt.
> 
> In ConfigReadonlyStorage.php line 142:
>                                                              
>   Your site configuration active store is currently locked.  
>                                                              
> 

In ProcessBase.php line 155:
                    
  Output is empty.  
                    

This also seems to be a problem when the regeneration process is being triggered via Drupal Cron because I get the following error in the watchdog

Drupal\config_readonly\Exception\ConfigReadonlyStorageException: Your site configuration active store is currently locked. in Drupal\config_readonly\Config\ConfigReadonlyStorage->checkLock() (line 142 of /home/purecnbk/dev/docroot/modules/contrib/config_readonly/src/Config/ConfigReadonlyStorage.php).

XML Sitemap Module 1.2
Drupal 9.3.3
Config ReadOnly 1.0.0-beta4

Issue fork xmlsitemap-3260837

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kevin.pfeifer created an issue. See original summary.

kevin.pfeifer’s picture

kevin.pfeifer’s picture

The following patch fixed at least the problem with the drush CLI not working.

kevin.pfeifer’s picture

Status: Active » Needs review

Dave Reid made their first commit to this issue’s fork.

dave reid’s picture

Version: 8.x-1.2 » 8.x-1.x-dev
StatusFileSize
new1.04 KB

I don't think this is the right fix. We want to avoid calling xmlsitemap_sitemap_save() entirely, since that calls the save() method on the XmlSitemap config entity. We only care about saving the state information about the generation. Let's see if this test coverage fails.

Status: Needs review » Needs work

The last submitted patch, 6: 3260837-generation-config-readonly-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new778 bytes

Try that test again now that I added config_readonly as a test dependency to 8.x-1.x.

Status: Needs review » Needs work

The last submitted patch, 8: 3260837-generation-config-readonly-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.25 KB

One more test try.

Status: Needs review » Needs work

The last submitted patch, 10: 3260837-generation-config-readonly-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dave reid’s picture

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new1.75 KB

Let's try the patch version.

dave reid’s picture

I have been able to confirm with a Kernel test the failure during sitemap generation and the MR now contains a fix that should pass the test.

dave reid’s picture

StatusFileSize
new4.52 KB

Let's test the patch version, this passes locally for me.

  • Dave Reid committed f61dbad on 8.x-1.x
    Issue #3260837 by Dave Reid, kevin.pfeifer: Fixed sitemap file...
dave reid’s picture

Status: Needs review » Fixed

Confirmed and merged the fix!

Status: Fixed » Closed (fixed)

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