-
Notifications
You must be signed in to change notification settings - Fork 638
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
[5.x]: Applying project config changes will sometimes revert the config folder to an early state #16086
Comments
The next time this happens, can you capture the resulting (“original”) project config that gets output, and compare it with the actual original project config? I’m curious if there are any changes that stick around from the deployed project config changes. |
@brandonkelly Thanks for the reply, I'll try to check that next time it happens. Pretty sure there were no changes between the previous config and the resulting config, though. At the moment, we're seeing this issue frequently in dev – we'll switch branches, apply the config, and instead the config is reset to the state of the previous branch. Anything we can check in that state to see where it went wrong, or provide more debug info? Though some instances of this were in outdated Craft versions, so this might also muddy the waters. I'm trying to get all our current projects updated to 5.5+ to see if it's still an issue there. |
@brandonkelly Some more context – I'm noticing that this happens at least every time there's any other error that causes That's definitely not the only time this happens, but it's definitely a pain point. |
@brandonkelly Just had this happen again during a Craft 4 to 5 update on a production site. This time, we tested the deployment thoroughly on a local development environment – right before the update, we made a backup of the live database and files and installed those locally, so the dev environment had completely identical content to the live environment. Then we executed the update in the dev environment, which worked without problems. Deploying those exact changes in production again caused the project config to be reset to the previous version.
You can see exactly where this happens in the deployment log (left some parts out, the log is thousands of lines):
This is the relevant part of the deployment script:
The No idea what's causing this, and why it only happens in production (at least in this case). We tested the exact same steps and they worked correctly in dev. Only difference is that the dev environment uses ddev, and that the mode is set to
As fas as I could tell, the contents of the |
@MoritzLost Can you try creating a new testing environment modeled after the production environment, and reproducing from there? And assuming you’re able to reliably reproduce it, can you give us access to that testing environment? |
What happened?
Description
I'm still seeing the issue described in #15012. I can't reliably reproduce it, but sometimes, running
up
orproject-config/apply
will not apply the config, but will instead reset the config to an earlier state (essentially runningproject-config/write
).I've encountered this in two scenarios:
dev
mode withallowAdminChanges
set totrue
).production
mode withallowAdminChanges
set tofalse
).Not sure if those are the same issue, or two unrelated issues.
I don't know what causes this or how to reproduce it. Just now I saw this while deploying an update from Craft 4 to Craft 5. The environment doesn't allow admin changes, and the deployment script only applies the most recent state from GitHub, here's the relevant part:
Now I can see in the deployment log that the Composer installation ran successfully, and the first set of migrations (before the
project-config/apply
step) were also executed correctly. But after that, theproject-config/apply
command resulted in an error:Checking the files on the server, I could see that the
config/
folder was reset to the state before the deployment started. After runninggit reset --hard
andgit clean -df
, I restarted the deployment. This time, it finished successfully.So something caused Craft to write out the existing config instead of applying it. Either as part of the
migrate/all --no-content
step, or at the beginning of theproject-config/apply
step.Steps to reproduce
Unclear.
Expected behavior
project-config/apply
should never, in any circumstances, change any files in theconfig/
folder. If the config can't be applied for any reason, it should throw an error, and possibly advice on how to fix the issue.allowAdminChanges
is set tofalse
, Craft should never, ever write anything to theconfig/
folder.Actual behavior
In some situations, running
up
orproject-config/apply
will have unexpectedly revert the config to the current state in the database, acting likeproject-config/write
.Craft CMS version
5.4.10
PHP version
8.3
Operating system and version
No response
Database type and version
MySQL 8
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: