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

Unable to update recipe #1014

Open
mvhirsch opened this issue Feb 19, 2024 · 6 comments
Open

Unable to update recipe #1014

mvhirsch opened this issue Feb 19, 2024 · 6 comments

Comments

@mvhirsch
Copy link

Hi :-)

I really love symfony/flex. I use it a lot on other projects. Currently I'm maintaining a legacy project (started with Symfony 2.3 🥳 - now Symfony 4.4, currently updating to 5.4). So I needed to switch to symfony/flex, following the official guideline. It helped a lot! ❤️

Now I'm trying to use recipes:update but it somehow fails and I don't understand why:

symfony composer recipes:update symfony/phpunit-bridge -vvv
Reading ./composer.json (/path/to/project/composer.json)
Loading config file /home/meh/.config/composer/config.json
Loading config file /home/meh/.config/composer/auth.json
Loading config file ./composer.json (/path/to/project/composer.json)
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/path/to/project): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Executing async command (/path/to/project): git rev-list develop..feature/symfony5
Executing async command (/path/to/project): git rev-list remotes/upstream/develop..feature/symfony5
Executing async command (/path/to/project): git rev-list remotes/origin/master..feature/symfony5
Executing async command (/path/to/project): git rev-list remotes/origin/develop..feature/symfony5
Reading /home/meh/.config/composer/composer.json
Loading config file /home/meh/.config/composer/config.json
Loading config file /home/meh/.config/composer/auth.json
Loading config file /home/meh/.config/composer/composer.json (/home/meh/.config/composer/composer.json)
Loading config file /home/meh/.config/composer/auth.json
Reading /home/meh/.config/composer/auth.json
Reading /path/to/project/vendor/composer/installed.json
Skipped loading "php-http/discovery" as it is not in config.allow-plugins
Reading /home/meh/.config/composer/vendor/composer/installed.json
Loading plugin PHPStan\ExtensionInstaller\Plugin (from phpstan/extension-installer)
Loading plugin Symfony\Flex\Flex (from symfony/flex)
Loading plugin Infection\ExtensionInstaller\Plugin (from infection/extension-installer, installed globally)
Running 2.4.4 (2022-10-27 14:39:29) with PHP 8.1.27 on Linux / 6.7.4-200.fc39.x86_64
Executing command (.): git status --porcelain --untracked-files=no
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-index.json from cache
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-contrib-flex-main-index.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json using proxy (http://127.0.0.1:7080)
Downloading https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
Reading ./composer.lock (/path/to/project/composer.lock)
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-archived-symfony.phpunit-bridge-170ab6f9abd4e1dab87462847116659ae138c34e.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/archived/symfony.phpunit-bridge/170ab6f9abd4e1dab87462847116659ae138c34e.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/archived/symfony.phpunit-bridge/170ab6f9abd4e1dab87462847116659ae138c34e.json
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-symfony.phpunit-bridge.5.3.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/symfony.phpunit-bridge.5.3.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/symfony.phpunit-bridge.5.3.json
  Updating recipe for symfony/phpunit-bridge...

Executing command (.): git check-ignore '.env.test' 'bin/phpunit' 'phpunit.xml.dist' 'tests/bootstrap.php' '.gitignore'
Executing command (.): git rev-parse --show-prefix
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git init
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git config commit.gpgsign false
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git config user.name "Flex Updater"
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git config user.email ""
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git add -A
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git commit -m "original files"
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git hash-object '.env.test'
Executing command (/tmp/_flex_recipe_update102080083565d32716235345.89631429): git rev-parse --absolute-git-dir
There was an error applying the recipe update patch
file_get_contents(/tmp/_flex_recipe_update102080083565d32716235345.89631429/.git/objects/9e/7162f0b01d8778e236e79f4121e0926f68c194): Failed to open stream: No such file or directory

Update the recipe by re-installing the latest version with:
  composer recipes:install symfony/phpunit-bridge --force -v
unable to run /home/meh/bin/composer recipes:update symfony/phpunit-bridge -vvv

That directory was never created:

stat /tmp/_flex_recipe_update102080083565d32716235345.89631429/.git/objects/9e/7162f0b01d8778e236e79f4121e0926f68c194
stat: cannot statx '/tmp/_flex_recipe_update102080083565d32716235345.89631429/.git/objects/9e/7162f0b01d8778e236e79f4121e0926f68c194': No such file or directory

Any clue what I'm missing here? symfony/flex works fine, the project is stable, too. But I can't update any recipe. Force-Reinstall does work, but that would probably break my setup, too.

@mvhirsch
Copy link
Author

I just noticed I'm running an outdated composer version. After a quick selfupdate, still same error.

symfony composer --version
Composer version 2.7.1 2024-02-09 15:26:28
symfony composer recipes:update symfony/phpunit-bridge
  Updating recipe for symfony/phpunit-bridge...

There was an error applying the recipe update patch
file_get_contents(/tmp/_flex_recipe_update209836198665d3285f1abfb4.66793082/.git/objects/9e/7162f0b01d8778e236e79f4121e0926f68c194): Failed to open stream: No such file or directory

Update the recipe by re-installing the latest version with:
  composer recipes:install symfony/phpunit-bridge --force -v
unable to run /home/meh/bin/composer recipes:update symfony/phpunit-bridge

@mvhirsch
Copy link
Author

Cloning the project into a new directory fixed that problem.

@mvhirsch
Copy link
Author

Now my freshly cloned repository is failing with the same error. 😭

symfony composer recipe:update symfony/framework-bundle -vvv
Reading ./composer.json (/path/to/project/composer.json)
Loading config file /home/meh/.config/composer/config.json
Loading config file /home/meh/.config/composer/auth.json
Loading config file ./composer.json (/path/to/project/composer.json)
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/path/to/project): 'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'
Reading /home/meh/.config/composer/composer.json
Loading config file /home/meh/.config/composer/config.json
Loading config file /home/meh/.config/composer/auth.json
Loading config file /home/meh/.config/composer/composer.json (/home/meh/.config/composer/composer.json)
Loading config file /home/meh/.config/composer/auth.json
Reading /home/meh/.config/composer/auth.json
Reading /path/to/project/vendor/composer/installed.json
Skipped loading "php-http/discovery" as it is not in config.allow-plugins
Reading /home/meh/.config/composer/vendor/composer/installed.json
Loading plugin PHPStan\ExtensionInstaller\Plugin (from phpstan/extension-installer)
Loading plugin Symfony\Flex\Flex (from symfony/flex)
Loading plugin Infection\ExtensionInstaller\Plugin (from infection/extension-installer, installed globally)
Running 2.7.1 (2024-02-09 15:26:28) with PHP 8.1.27 on Linux / 6.7.4-200.fc39.x86_64
Executing command (.): git status --porcelain --untracked-files=no
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-index.json from cache
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-contrib-flex-main-index.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json using proxy (http://127.0.0.1:7080)
Downloading https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
Reading ./composer.lock (/path/to/project/composer.lock)
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-archived-symfony.framework-bundle-24eb45d1355810154890460e6a05c0ca27318fe7.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/archived/symfony.framework-bundle/24eb45d1355810154890460e6a05c0ca27318fe7.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/archived/symfony.framework-bundle/24eb45d1355810154890460e6a05c0ca27318fe7.json
Reading /home/meh/.cache/composer/repo/flex/symfony-recipes-flex-main-symfony.framework-bundle.5.4.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/symfony.framework-bundle.5.4.json using proxy (http://127.0.0.1:7080)
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/symfony.framework-bundle.5.4.json
  Updating recipe for symfony/framework-bundle...

Executing command (.): git check-ignore 'config/bundles.php' 'config/bootstrap.php' 'config/packages/cache.yaml' 'config/packages/framework.yaml' 'config/packages/test/framework.yaml' 'config/preload.php' 'config/routes/dev/framework.yaml' 'config/services.yaml' 'public/index.php' 'src/Controller/.gitignore' 'src/Kernel.php' '.env' 'phpunit.xml.dist' 'composerjson' '.gitignore'
Executing command (.): git rev-parse --show-prefix
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git init
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git config commit.gpgsign false
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git config user.name "Flex Updater"
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git config user.email ""
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git add -A
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git commit -m "original files"
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'config/bundles.php'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'config/packages/cache.yaml'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'config/packages/framework.yaml'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'config/preload.php'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'config/services.yaml'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'public/index.php'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'src/Controller/.gitignore'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object 'src/Kernel.php'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git hash-object '.env'
Executing command (/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271): git rev-parse --absolute-git-dir
There was an error applying the recipe update patch
file_get_contents(/tmp/_flex_recipe_update98652119665d47158a92aa3.84155271/.git/objects/07/3ac447764f738945058d10777c8858bb3bf3fe): Failed to open stream: No such file or directory

@mvhirsch mvhirsch reopened this Feb 20, 2024
@Fly06-Fr
Copy link

Hello @mvhirsch ,
I am running into the exact same problem.
Would you mind to share your fix or workaround if you found one?
Thanks.

@mvhirsch
Copy link
Author

mvhirsch commented Sep 2, 2024

I'm sorry, I never figured out the root cause. I updated Symfony to 6.4 on this particular project (by manually applying configuration) and somehow it got fixed. Not sure if either by updating any package or symfony-cli itself.

@Fly06-Fr
Copy link

Hi @mvhirsch,
I managed to update the recipe by re-installing the latest version as suggested by composer.
Thanks for the reply.

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

No branches or pull requests

2 participants