-
Notifications
You must be signed in to change notification settings - Fork 642
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
Craft migration throws "Changes to the project config are not possible while in read-only mode" error #3653
Comments
Same problem here. |
@khalwat That cms/src/migrations/m190112_124737_fix_user_settings.php Lines 18 to 23 in c4fafa3
So in theory the only way you’d get that exception is if you run this migration for the first time on an environment that has @smcyr If you were getting this on an environment that already theoretically had the project config changes in place (and |
@brandonkelly What would be the procedure to update my staging/production environments to Craft 3.1 ? Here is the steps I did:
But from the logs, maybe the problem lies with my code or Seomatic. Here are some parts of the log:
Thanks for the help! |
I tried to do the upgrade in local from Craft 3.0 to 3.1 with the project.yaml previously generated and the
So, the culprit is this migration |
If I comment the code that changes the Should I set |
The |
In our case, we run migrations on It sounds like we're potentially running into scenarios where we have environments where migrations really should be run, but we also want I feel like I'm missing something? It seems a pretty common scenario where we have a live environment where we don't want admin changes, and we don't want Are you saying if we had run said migrations locally, it would have updated |
@khalwat Yeah that is the expected workflow. It’s just that one |
Just added a warning to the allowAdminChanges config setting docs to clear this up. |
Just wanted to let you know that I migrated all my environments to 3.1 successfully with |
I'm still getting Shouldn't it basically stop you making admin changes in the CMS, but allow updates that were committed and deployed? It's kind of weird/annoying that it won't let you update the file even though the changes came from the local machine. |
@darylknight Are you pushing Matrix changes? If so you might be getting bit by #3695. If it’s something else, please post a new issue that includes the stack trace from the logs leading up to the error. |
Yes; several / most of them are Matrix changes. Hopefully that release will solve the problem - thanks Brandon! |
I just had this issue still, and hit a problem where I couldn't resync the To resolve I changed |
@bymayo Can you try comparing the server’s |
Also running into this issue... to me it seems like this flies in the face of what people wanted project.yaml for?? Ie: make changes in a dev environment where |
Pretty sure this has been fixed for a while. Or, at least, the various things that could have caused is. If you're experiencing this, can you send your pre-update DB, |
We're running into this now as well and after scanning the above I'm not sure I understand what the appropriate solution is yet. Here's an open ticket we have with this issue on Sprout Forms: Here's the migration causing the issue: As I'm understanding this, our migration is trying to do to things.
I believe the recommended Project Config workflow is to disable However, the changes to the Project Config are meaningless until we've added the new database tables to the database. Those new db tables don't have any relationship to the Project Config and the migration to add them would need to be run in all environments that have Is there a workflow that I'm missing here where we don't have to give the user multi-step instructions to get things upgraded properly? |
@BenParizek pretty sure @putyourlightson has already covered that in https://github.com/putyourlightson/craft-how-project-config-works#plugin-migrations Your migration should always run the DB schema changes, but check the schema version for project config changes. The logic there being that the same deploy that pushes the migration will also push a So you should update your migration to check for that. Here's a simple example for a migration that performs changes in DB and checks the schema version in |
We also explain it here: https://docs.craftcms.com/v3/extend/project-config.html#project-config-migrations |
Thanks @andris-sevcenko @brandonkelly. It's making sense now. |
Just ran into this issue while running Craft 3.7.1
|
@knynkwl Please write into [email protected] with a database backup (prior to the deployment) and your |
@knynkwl Thanks for the help – we were able to reproduce, and just released 3.7.3 with a fix. |
@brandonkelly whoops sorry for not sending the files, I fixed it before you responded. But, i fixed it by removing the staging DB table 'projectconfig' and replacing it with my local version. Glad to hear you were able to reproduce! 🙌 |
@cherrykoda Had you run |
oh hey! that's new for me, I've done composer update for years without |
It’s a shortcut for |
Description
If you have:
...in your
general.php
Craft will throw an error when you attempt to run pending migrations (whether via the AdminCP or via the CLI).It looks like this migration is the culprit:
https://github.com/craftcms/cms/blob/3.1/src/migrations/m190112_124737_fix_user_settings.php#L27
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: