<p>Upon further testing it seems that the updates work fine. Despite these strange errors. Not sure if others have experienced this too. It is a little worrying to see errors during an update process. But doesn't seem to have an impact. Perhaps some issues to do with composer?</p>

CC BY-SA 4.0
2022-12-17T16:27:03.403Z
I don't know why that error occurs, but a viable workaround could be to not use Craft's built-in `update` command at all (it uses a bundled version of Composer, which seems related to the errors you get) – instead, update using Composer directly: First do a `composer update` inside the container to update any and all Composer dependencies, then run `php craft migrate/all` (also inside the container) to run any pending migrations.
Mats Mikkel Rummelhoff
CC BY-SA 4.0
2022-12-18T17:32:00.833Z
Thanks for the suggestion, will test that.
BrokenCode
CC BY-SA 4.0
2022-12-17T11:45:36.107Z
2022-12-17T11:45:36.107Z
BrokenCode
<p>I have a Craft 3 docker container. Craft is on version 3.7.44.</p>
<p>I log into the container with: <code>docker exec -it [container id] /bin/sh</code></p>
<p>In the container I run: <code>php craft update</code></p>
<p>Output:</p>
<blockquote>
<p>Fetching available updates ... done You’ve got 9 available updates:</p>
<pre><code>- craft 3.7.44 =&gt; 3.7.61
- blitz 3.12.4 =&gt; 3.12.7
- formie 1.6.10 =&gt; 1.6.20
- image-optimize 1.6.44 =&gt; 1.6.49
- redactor 2.10.8 =&gt; 2.10.10
- retour 3.1.73 =&gt; 3.2.7
- seomatic 3.4.32 =&gt; 3.4.45
- super-table 2.7.2 =&gt; 2.7.3
- vite 1.0.25 =&gt; 1.0.28
</code></pre>
<p>Run craft update all or craft update  to perform an update.</p>
</blockquote>
<p>I then run: <code>php craft update craft</code></p>
<p>Output:</p>
<blockquote>
<p>Fetching available updates ... done Performing one update:</p>
<pre><code>- craft 3.7.44 =&gt; 3.7.61
</code></pre>
<p>Create database backup? (yes|no) [yes]:no Skipping database backup.
Performing update with Composer ... PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 done Applying new migrations ... done Update complete!</p>
</blockquote>
<p>If I run: <code>php craft update</code> again I see that there are no more Craft updates available.</p>
<p>However in the website backend I still see that there are Craft updates available and the backend in the footer still says version <code>3.7.44</code>.</p>
<p>Running <code>git status</code> shows that 2 files have been changed:</p>
<p>composer.lock
composer.json</p>
<p>composer.json:</p>
<pre><code> &quot;name&quot;: &quot;craft-cms&quot;,
    &quot;description&quot;: &quot;Project for Craft CMS&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;require&quot;: {
        **&quot;craftcms/cms&quot;: &quot;3.7.61&quot;**,
        &quot;craftcms/redactor&quot;: &quot;2.10.8&quot;,
        &quot;mmikkel/cp-field-inspect&quot;: &quot;1.4.4&quot;,
        &quot;nystudio107/craft-emptycoalesce&quot;: &quot;1.0.6&quot;,
        &quot;nystudio107/craft-imageoptimize&quot;: &quot;1.6.44&quot;,
        &quot;nystudio107/craft-retour&quot;: &quot;3.1.73&quot;,
        &quot;nystudio107/craft-seomatic&quot;: &quot;3.4.32&quot;,
        &quot;nystudio107/craft-vite&quot;: &quot;1.0.25&quot;,
        &quot;putyourlightson/craft-blitz&quot;: &quot;3.12.4&quot;,
        &quot;putyourlightson/craft-sprig&quot;: &quot;1.13.0&quot;,
        &quot;sebastianlenz/linkfield&quot;: &quot;1.0.25&quot;,
        &quot;verbb/formie&quot;: &quot;1.6.10&quot;,
        &quot;verbb/super-table&quot;: &quot;2.7.2&quot;,
        &quot;yiisoft/yii2-redis&quot;: &quot;^2.0&quot;,
        &quot;zircote/swagger-php&quot;: &quot;^4.2&quot;
    },
</code></pre>
<p><strong>Update 1:</strong></p>
<p>If I run the Craft updates through the CMS backend, i.e. if I log into the website and navigate to Utilities &gt; Updates and I click on &quot;Update&quot; then it works as expected. Craft is updated to version 3.7.61 and both the composer.json and composer.lock files are updated.</p>

<craft3><docker>
Updating Craft from Terminal
# Updating Craft from Terminal

(Asked by: username_0 on 2022-12-16)

I have a Craft 3 docker container. Craft is on version 3.7.44.
I log into the container with: docker exec -it [container id] /bin/sh
In the container I run: php craft update
Output:

Fetching available updates ... done You’ve got 9 available updates:
- craft 3.7.44 => 3.7.61
- blitz 3.12.4 => 3.12.7
- formie 1.6.10 => 1.6.20
- image-optimize 1.6.44 => 1.6.49
- redactor 2.10.8 => 2.10.10
- retour 3.1.73 => 3.2.7
- seomatic 3.4.32 => 3.4.45
- super-table 2.7.2 => 2.7.3
- vite 1.0.25 => 1.0.28

Run craft update all or craft update  to perform an update.

I then run: php craft update craft
Output:

Fetching available updates ... done Performing one update:
- craft 3.7.44 => 3.7.61

Create database backup? (yes|no) [yes]:no Skipping database backup.
Performing update with Composer ... PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 PHP Warning:
file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php):
Failed to open stream: No such file or directory in
/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php
on line 163 done Applying new migrations ... done Update complete!

If I run: php craft update again I see that there are no more Craft updates available.
However in the website backend I still see that there are Craft updates available and the backend in the footer still says version 3.7.44.
Running git status shows that 2 files have been changed:
composer.lock
composer.json
composer.json:
 "name": "craft-cms",
    "description": "Project for Craft CMS",
    "license": "MIT",
    "require": {
        **"craftcms/cms": "3.7.61"**,
        "craftcms/redactor": "2.10.8",
        "mmikkel/cp-field-inspect": "1.4.4",
        "nystudio107/craft-emptycoalesce": "1.0.6",
        "nystudio107/craft-imageoptimize": "1.6.44",
        "nystudio107/craft-retour": "3.1.73",
        "nystudio107/craft-seomatic": "3.4.32",
        "nystudio107/craft-vite": "1.0.25",
        "putyourlightson/craft-blitz": "3.12.4",
        "putyourlightson/craft-sprig": "1.13.0",
        "sebastianlenz/linkfield": "1.0.25",
        "verbb/formie": "1.6.10",
        "verbb/super-table": "2.7.2",
        "yiisoft/yii2-redis": "^2.0",
        "zircote/swagger-php": "^4.2"
    },

Update 1:
If I run the Craft updates through the CMS backend, i.e. if I log into the website and navigate to Utilities > Updates and I click on "Update" then it works as expected. Craft is updated to version 3.7.61 and both the composer.json and composer.lock files are updated.

**Tags:** craft3, docker

---

## 1 answers

### Answer by username_0 on 2022-12-17. Score: 1

Upon further testing it seems that the updates work fine. Despite these strange errors. Not sure if others have experienced this too. It is a little worrying to see errors during an update process. But doesn't seem to have an impact. Perhaps some issues to do with composer?

> **Comments:**
> **username_1**: I don't know why that error occurs, but a viable workaround could be to not use Craft's built-in `update` command at all (it uses a bundled version of Composer, which seems related to the errors you get) – instead, update using Composer directly: First do a `composer update` inside the container to update any and all Composer dependencies, then run `php craft migrate/all` (also inside the container) to run any pending migrations.  
> **username_0**: Thanks for the suggestion, will test that.  

---

