<blockquote>
<p>Changes to the project config are not possible while in read-only mode.</p>
</blockquote>
<p>This is the error you get when your <a href="https://craftcms.com/docs/3.x/config/config-settings.html#allowadminchanges" rel="nofollow noreferrer">allowAdminChanges config setting</a> is set to <code>false</code>, which is the default for staging/production environments. If you have not modified the <a href="https://github.com/craftcms/craft/blob/main/config/general.php" rel="nofollow noreferrer">default config/general.php</a>, admin changes will only be allowed in dev environments (determined by your <code>ENVIRONMENT</code> setting in your <code>.env</code> file).</p>
<p>The root cause of this issue is that you tried updating directly on a production/staging site, which is discouraged for exactly the reason you encountered (updates potentially breaking something on a live site). The encouraged workflow for updating Craft 3 sites would be as follows:</p>
<ol>
<li>Test the update in your local development environment and make sure everything works. Update any custom code if necessary.</li>
<li>Commit your <code>composer.json</code> and <code>composer.lock</code> file as well as the <code>config/</code> directory and any other adjustments you made to your Git repository.</li>
<li>On the staging/production site, pull down the changes to your production site. Then run <code>composer install</code>, <code>php craft project-config/apply</code> and <code>php craft migrate/all</code> to update the dependencies and sync up your database to the latest version.</li>
</ol>
<p>This ensures updates go smooth and you don't encounter any unexpected errors while updating.</p>
<p>Take a look at the following resources to learn more about this workflow:</p>
<ul>
<li><a href="https://craftcms.com/docs/3.x/project-config.html#propagating-changes" rel="nofollow noreferrer">Project config -&gt; Propagating changes</a></li>
<li><a href="https://craftcms.com/knowledge-base/deployment-best-practices" rel="nofollow noreferrer">Deployment best practices</a></li>
</ul>

CC BY-SA 4.0
2021-07-14T10:28:03.507Z
Thanks for the help
mitrol
CC BY-SA 4.0
2021-07-14T07:56:16.083Z
2021-07-14T07:56:16.083Z
MoritzLost
<p>Probably my fault — I’m generally OK with this stuff until something goes wrong — but…</p>
<p>I updated a local install (MAMP PRO) to Craft 3.7 by clicking that lovely 'update' button. And it worked fine, first time, no issues.</p>
<p>I then went to update a staging install on my server via SSH and it ran through until it hit this error:</p>
<pre><code>*** applying m210602_111300_project_config_names_in_config
Exception: Changes to the project config are not possible while in read-only mode. (/home/***/***.***.***/vendor/craftcms/cms/src/services/ProjectConfig.php:492)
</code></pre>
<p></p>
<p>So then I decided to back out, and told it to restore the database backup as prompted. Which lead to this error:</p>
<pre><code>error: PDOStatement::execute(): MySQL server has gone away
The SQL being executed was: SELECT GET_LOCK('c4ba60e2215081fdd4fd2710bb13db075668ce52', 2)
</code></pre>
<p></p>
<p>At this point my staging site is giving me the Craft branded 'site unavailable' message you get if a version is out of sync somewhere.</p>
<p>But it said I could manually restore using [file]. I FTP to the staging space, and the file (plus a couple of others) are there. So I download them.</p>
<p>I open up TablePlus, connect to the database, and use the restore DB option with the file the terminal specified. It says it’s done it, and it looks OK to the untrained eye (ie. I can see content in there) but now my staging site has changed to an internal server error.</p>
<p></p>
<p>So… I think my best bet is to trash the current staging install, build a new one from the local database, and manually copy and paste the data (that a client had tweaked) from the content table into the brand new site. Irritating, and a bit slow, but hopefully OK.</p>
<p>But I’m concerned about that initial error (the read-only mode). Did I have something misconfigured to set this off?</p>
<p>The original install on the staging site was created with composer, and I understood that composer sets the right permissions as it performs the install.</p>
<p>I’m sure I have updated this install, via SSH, at least once, because it’s a few months old and I try to keep up to date.</p>
<p>Any tips, suggestions, observations etc. before I dig myself a deeper hole gratefully received.</p>

<updates><3.7>
Updating to 3.7 issue (applying m210602_111300_project_config_names_in_config)
# Updating to 3.7 issue (applying m210602_111300_project_config_names_in_config)

(Asked by: username_0 on 2021-07-13)

Probably my fault — I’m generally OK with this stuff until something goes wrong — but…
I updated a local install (MAMP PRO) to Craft 3.7 by clicking that lovely 'update' button. And it worked fine, first time, no issues.
I then went to update a staging install on my server via SSH and it ran through until it hit this error:
*** applying m210602_111300_project_config_names_in_config
Exception: Changes to the project config are not possible while in read-only mode. (/home/***/***.***.***/vendor/craftcms/cms/src/services/ProjectConfig.php:492)


So then I decided to back out, and told it to restore the database backup as prompted. Which lead to this error:
error: PDOStatement::execute(): MySQL server has gone away
The SQL being executed was: SELECT GET_LOCK('c4ba60e2215081fdd4fd2710bb13db075668ce52', 2)


At this point my staging site is giving me the Craft branded 'site unavailable' message you get if a version is out of sync somewhere.
But it said I could manually restore using [file]. I FTP to the staging space, and the file (plus a couple of others) are there. So I download them.
I open up TablePlus, connect to the database, and use the restore DB option with the file the terminal specified. It says it’s done it, and it looks OK to the untrained eye (ie. I can see content in there) but now my staging site has changed to an internal server error.

So… I think my best bet is to trash the current staging install, build a new one from the local database, and manually copy and paste the data (that a client had tweaked) from the content table into the brand new site. Irritating, and a bit slow, but hopefully OK.
But I’m concerned about that initial error (the read-only mode). Did I have something misconfigured to set this off?
The original install on the staging site was created with composer, and I understood that composer sets the right permissions as it performs the install.
I’m sure I have updated this install, via SSH, at least once, because it’s a few months old and I try to keep up to date.
Any tips, suggestions, observations etc. before I dig myself a deeper hole gratefully received.

**Tags:** updates, 3.7

---

## 1 answers

### Answer by username_1 on 2021-07-14. Score: 2 | Accepted answer

> Changes to the project config are not possible while in read-only mode.

This is the error you get when your [allowAdminChanges config setting](https://craftcms.com/docs/3.x/config/config-settings.html#allowadminchanges) is set to `false`, which is the default for staging/production environments. If you have not modified the [default config/general.php](https://github.com/craftcms/craft/blob/main/config/general.php), admin changes will only be allowed in dev environments (determined by your `ENVIRONMENT` setting in your `.env` file).

The root cause of this issue is that you tried updating directly on a production/staging site, which is discouraged for exactly the reason you encountered (updates potentially breaking something on a live site). The encouraged workflow for updating Craft 3 sites would be as follows:

1. Test the update in your local development environment and make sure everything works. Update any custom code if necessary.
2. Commit your `composer.json` and `composer.lock` file as well as the `config/` directory and any other adjustments you made to your Git repository.
3. On the staging/production site, pull down the changes to your production site. Then run `composer install`, `php craft project-config/apply` and `php craft migrate/all` to update the dependencies and sync up your database to the latest version.

This ensures updates go smooth and you don't encounter any unexpected errors while updating.

Take a look at the following resources to learn more about this workflow:

* [Project config -> Propagating changes](https://craftcms.com/docs/3.x/project-config.html#propagating-changes)
* [Deployment best practices](https://craftcms.com/knowledge-base/deployment-best-practices)

> **Comments:**
> **username_0**: Thanks for the help  

---

