Skip to content

Magento upgrade: Failed to download elasticsearch/elasticsearch from dist [duplicate]

I am doing some upgrade testing for Magento – trying to upgrade from 2.4.4 to 2.4.6. When I run the ‘composer update’ command it is erroring with the following:

 384/511 [=====================>------]  75%    Failed to download elasticsearch/elasticsearch from dist: The "https://api.github.com/repos/elastic/elasticsearch-php/zipball/2d302233f2bb0926812d82823bb820d405e130fc" file could not be downloaded (HTTP/1.1 404 Not Found)
    Now trying to download from source

It then tries to download Elasticsearch from source and this returns the following errors:

  [RuntimeException]
  Failed to execute git clone --mirror -- 'https://<removed_for_security>:***@github.com/elastic/elasticsearch-php.git' '/home/www/.cache/composer/vcs/https---github.com-elastic-elasticsearch-php.git/'

  Cloning into bare repository '/home/www/.cache/composer/vcs/https---github.com-elastic-elasticsearch-php.git'...
  remote: Repository not found.
  fatal: repository 'https://github.com/elastic/elasticsearch-php.git/' not found

Commands that I ran to get this error:

composer require-commerce magento/product-community-edition 2.4.6 --no-update
composer update

How can I work around this so that the upgrade process does not abort?