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

[5.x]: Something is changing Project Config files even when allowAdminChanges is disabled #15012

Closed
lindseydiloreto opened this issue May 16, 2024 · 7 comments
Labels

Comments

@lindseydiloreto
Copy link
Contributor

What happened?

Description

My staging server is set to automatically deploy (via Ploi) when I push a commit. It works great, but lately we've been running into this issue.

Something on the staging site is making changes to the Project Config YAML files. I'm certain this environment is properly configured, with the allowAdminChanges setting disabled. In theory, nothing in this environment should be able to make project config changes.

Since something is making PC changes, it prevents my automatic deployments from working properly. Ploi is using a basic git pull on the staging site, but it's unable to pull because there are "uncommitted changes". If you SSH into the server and just discard those changes, the automatic deployment begins working again.

Unfortunately, I encountered this last week when I was in a hurry, so while I repeatedly discarded changes in the PC files, I never took a moment to deeply investigate those changes. So I don't recall exactly what they were, other than that they "weren't important". I believe it may have simply been comments added to the YAML files.

Fortunately (I guess), a few other people have recently mentioned this exact same issue on Discord. So perhaps between the group of us, we can track down whatever you need to fix the issue.

https://discord.com/channels/456442477667418113/456442477667418115/1240584785315893258

Ω  2024-05-16  10 11 35

https://discord.com/channels/456442477667418113/456442477667418115/1240615296210047087

Ω  2024-05-16  10 11 56

Thanks for looking into it!

Steps to reproduce

  1. See above

Expected behavior

If allowAdminChanges is disabled, nothing should ever be written to the Project Config YAML files.

Actual behavior

Something is writing to the Project Config YAML files, even though allowAdminChanges is disabled.

Craft CMS version

Craft Pro 5.0.5

PHP version

8.3.6

Operating system and version

Linux 5.15.0-67-generic

Database type and version

MySQL 8.0.36

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

Amazon S3 (v2.2.1)
CKEditor (v4.0.3)
Control Panel CSS (v3.0.0)
CP Field Inspect (v2.0.1)
DigitalOcean Spaces Filesystem (v3.0.0-beta.1)
Formie (v3.0.0-beta.8)
Google Maps (v5.0.2)
Knock Knock (v3.0.0-beta.1)
Mailgun (v3.1.0)
Navigation (v3.0.0-beta.3)
Obfuscator (v1.2.0)
Retour (v5.0.0)
SEOmatic (v5.0.2)

@mmikkel
Copy link
Contributor

mmikkel commented May 16, 2024

I can consistently reproduce this issue on Craft 5.1.3.

After running craft up to apply pending project config changes (no migrations are pending), in an environment where allowAdminChanges is false, a bunch of YAML files end up with changes – specifically, comments have been removed:

CleanShot 2024-05-16 at 20 39 02@2x

This only happens when using craft up. Running craft project-config/apply instead, to apply the same changes, in the same environment, does not change the YAML files.

@mmikkel
Copy link
Contributor

mmikkel commented May 16, 2024

I was able to put together a reduced test case, and have sent over a database dump + Composer and project config files to support.

@terryupton
Copy link

Is there any temporary solution to bypass this, as it is a little too crippling and frustrating at the moment...

@terryupton
Copy link

Is there any temporary solution to bypass this, as it is a little too crippling and frustrating at the moment...

Just thought of a possible solution and I will add git stash before I pull and deploy and git stash clear afterwards.

@brandonkelly
Copy link
Member

Got this fixed for the next release, due out later today. Thanks for the files @mmikkel!

@brandonkelly
Copy link
Member

Craft 4.9.5 and 5.1.5 are out with that fix.

@lindseydiloreto
Copy link
Contributor Author

Great, thanks @brandonkelly! 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants