Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing cache forces project config sync #5220

Closed
jasonmccallister opened this issue Nov 7, 2019 · 10 comments
Closed

Clearing cache forces project config sync #5220

jasonmccallister opened this issue Nov 7, 2019 · 10 comments
Assignees
Labels
project config 🐫 features related to Project config

Comments

@jasonmccallister
Copy link
Member

Description

Ok, I thought I was crazy but I just confirmed it. I was working locally in Docker and I kept getting the Changes to project.yaml must be applied to the loaded project config. prompt. It turns out this is happening when I clear caches.

Steps to reproduce

  1. Load the website
  2. Clear cache
  3. Visit front end and see 503 ServiceUnavailable Exception
  4. Sync changes
  5. Verify the site now loads

Additional info

  • Craft version: 3.3.15
  • PHP version: 7.3.9
  • Database driver & version: MySQL 5.6.45
@brandonkelly
Copy link
Member

brandonkelly commented Nov 7, 2019

Craft needs to check if anything changed in project.yaml on each request. Most of the time, it will just check the modify date for the file and compare that to its cached record of the last modified date.

If you clear caches, Craft loses track of its record of the last modification date for config/project.yaml, so it will need to do a deeper dive into the file to see if anything has changed.

It should only be asking you to sync new changes if it finds that something actually did change, though – which is working as expected on my end. So something must not be getting synced correctly, for some reason.

Can you please send your composer.json, composer.lock, and config/project.yaml files, plus a database backup, over to support@craftcms.com so we can look into this?

@brandonkelly brandonkelly added the project config 🐫 features related to Project config label Nov 7, 2019
@jasonmccallister
Copy link
Member Author

Will do!

@baileydoestech
Copy link

We are also seeing this happen after updating to Craft 3.3.19 - was there any resolution to this?

@andris-sevcenko
Copy link
Contributor

@lukebailey Not yet, but will be before 3.4 release!

@andris-sevcenko andris-sevcenko added this to the 3.4 milestone Jan 7, 2020
@baileydoestech
Copy link

As a follow up we only see the issue when cleearing the Data caches, others seem to work as expected

@andris-sevcenko
Copy link
Contributor

@lukebailey I'm unable to reproduce this locally. Is this happening on an install where it's possible to get CP and FTP access to debug further? If so, could you get in touch via support@craftcms.com referencing this issue?

@baileydoestech
Copy link

Sure have emailed a response

@brandonkelly
Copy link
Member

brandonkelly commented Jan 8, 2020

We were able to reproduce this, and in our case it was because a worker environment for the site was accidentally configured to point to a different Craft install’s database, but used the correct Redis cache DB. So if the worker happened to be the first thing to load the project config on empty cache, it would pull it from the wrong DB, then the query results would get cached to the right Redis DB, and then the following web request for the site would think that project.yaml was out of date, as compared to the other Craft install’s info.config value.

That same thing happening for you @lukebailey? 🙃

@baileydoestech
Copy link

Thanks @brandonkelly but our environments all point to an single RDS cluster endpoint. I can't see how the above would be the cause in our situation, however as of this morning the issue appears to have resolved itself.

Mostly likely a caching issue somewhere in the chain but stuggling to diagnose further - as a side thought would it be possible add some logging or display (on the sync prompt?) as to exactly what the project config thinks has changed. Wouldn't require any action but just useful for future situations like this.

@andris-sevcenko andris-sevcenko removed this from the 3.4 milestone Jan 8, 2020
@andris-sevcenko
Copy link
Contributor

@lukebailey I'm not sure. Other than debugging this issue that happened once and cannot be reproduced, not sure if there is much use in there? Also, as a debugging need, this is "sort of" addressed, actually. Just recalled that there should be backups in the storage/config-backups folder, which can be diffed to figure out what the changes were.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project config 🐫 features related to Project config
Projects
None yet
Development

No branches or pull requests

4 participants