mongo-php-driver icon indicating copy to clipboard operation
mongo-php-driver copied to clipboard

PIE: Could not find release by tag name for mongodb/mongodb-extension:1.20.0

Open mickverm opened this issue 1 year ago • 4 comments

Bug Report

I was trying out the initial release of PIE (https://github.com/php/pie/releases/tag/0.1.0) and was unable to install this extension. I'm guessing it's caused by the missing v16 in the PHP 8.3 release file names on Github. Installing older versions doesn't work either, since they don't include the vs16/vs17 at all, which seems to be a requirement of PIE: https://github.com/php/pie/blob/main/docs/extension-maintainers.md#windows-support

image

Environment

  • Windows 11
  • PHP 8.3.12 ts, vs16

Test Script

php .\pie.phar install mongodb/mongodb-extension -v
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.3.12
Target PHP installation: 8.3.12 ts, vs16, on Windows x86_64 (from C:\Apache24\php\php.exe)
Found package: mongodb/mongodb-extension:1.20.0 which provides ext-mongodb

In CouldNotFindReleaseAsset.php line 28:

  [Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset]
  Could not find release by tag name for mongodb/mongodb-extension:1.20.0


Exception trace:
  at phar://C:/pie.phar/src/Downloading/Exception/CouldNotFindReleaseAsset.php:28
 Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset::forPackageWithMissingTag() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:100
 Php\Pie\Downloading\GithubPackageReleaseAssets->getReleaseAssetsForPackage() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:43
 Php\Pie\Downloading\GithubPackageReleaseAssets->findWindowsDownloadUrlForPackage() at phar://C:/pie.phar/src/Downloading/WindowsDownloadAndExtract.php:26
 Php\Pie\Downloading\WindowsDownloadAndExtract->__invoke() at phar://C:/pie.phar/src/Command/CommandHelper.php:183
 Php\Pie\Command\CommandHelper::downloadPackage() at phar://C:/pie.phar/src/Command/InstallCommand.php:52
 Php\Pie\Command\InstallCommand->execute() at phar://C:/pie.phar/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at phar://C:/pie.phar/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/pie.phar/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at phar://C:/pie.phar/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at phar://C:/pie.phar/bin/pie:63
 require() at C:\pie.phar:15

install [--with-php-config [WITH-PHP-CONFIG]] [--with-php-path [WITH-PHP-PATH]] [--] <requested-package-and-version>

mickverm avatar Oct 10 '24 07:10 mickverm

I see the file name has changed, but the issue persists. The file name probably wasn't the issue.

php .\pie.phar install mongodb/mongodb-extension -vvv

Box Requirements Checker
========================

> Using PHP 8.3.12
> PHP is using the following php.ini file:
  C:\Apache24\php\php.ini

> Checking Box requirements:
  ✔ This application requires a PHP version matching "8.1.*||8.2.*||8.3.*||8.4.*".
  ✔ The package "guzzlehttp/guzzle" requires the extension "json".
  ✔ The package "composer/ca-bundle" requires the extension "openssl".
  ✔ The package "composer/ca-bundle" requires the extension "pcre".
  ✔ This application requires the extension "zip".
  ✔ The package "symfony/service-contracts" conflicts with the extension "psr".


 [OK] Your system is ready to run the application.


Loading config file C:/Users/mv/AppData/Roaming/Composer/config.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/auth.json
Checked CA file C:\Apache24\php\extras\ssl\curl-ca-bundle.crt: valid
Executing command (C:\): git branch -a --no-color --no-abbrev -v
Executing command (C:\): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (C:\): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (C:\): hg branch
Executing command (C:\): fossil branch list
Executing command (C:\): fossil tag list
Executing command (C:\): svn info --xml
Reading C:/Users/mv/AppData/Roaming/Composer/composer.json (C:\Users\mv\AppData\Roaming\Composer\composer.json)
Loading config file C:/Users/mv/AppData/Roaming/Composer/config.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/auth.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/composer.json (C:\Users\mv\AppData\Roaming\Composer\composer.json)
Loading config file C:\Users\mv\AppData\Roaming\Composer/auth.json
Reading C:\Users\mv\AppData\Roaming\Composer/auth.json (C:\Users\mv\AppData\Roaming\Composer\auth.json)
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.3.12
Target PHP installation: 8.3.12 ts, vs16, on Windows x86_64 (from C:\Apache24\php\php.exe)
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing C:/Users/mv/AppData/Local/Composer/repo/https---repo.packagist.org/packages.json into cache
Downloading https://repo.packagist.org/p2/mongodb/mongodb-extension.json
[200] https://repo.packagist.org/p2/mongodb/mongodb-extension.json
Writing C:/Users/mv/AppData/Local/Composer/repo/https---repo.packagist.org/provider-mongodb~mongodb-extension.json into cache
Found package: mongodb/mongodb-extension:1.20.0 which provides ext-mongodb

In CouldNotFindReleaseAsset.php line 28:

  [Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset]
  Could not find release by tag name for mongodb/mongodb-extension:1.20.0


Exception trace:
  at phar://C:/pie.phar/src/Downloading/Exception/CouldNotFindReleaseAsset.php:28
 Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset::forPackageWithMissingTag() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:100
 Php\Pie\Downloading\GithubPackageReleaseAssets->getReleaseAssetsForPackage() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:43
 Php\Pie\Downloading\GithubPackageReleaseAssets->findWindowsDownloadUrlForPackage() at phar://C:/pie.phar/src/Downloading/WindowsDownloadAndExtract.php:26
 Php\Pie\Downloading\WindowsDownloadAndExtract->__invoke() at phar://C:/pie.phar/src/Command/CommandHelper.php:183
 Php\Pie\Command\CommandHelper::downloadPackage() at phar://C:/pie.phar/src/Command/InstallCommand.php:52
 Php\Pie\Command\InstallCommand->execute() at phar://C:/pie.phar/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at phar://C:/pie.phar/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/pie.phar/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at phar://C:/pie.phar/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at phar://C:/pie.phar/bin/pie:63
 require() at C:\pie.phar:15

install [--with-php-config [WITH-PHP-CONFIG]] [--with-php-path [WITH-PHP-PATH]] [--] <requested-package-and-version>

I'll have a look into the source code of PIE, to see what goes wrong.

mickverm avatar Oct 11 '24 14:10 mickverm

Found the issue, this line makes a request to the incorrect URL: https://api.github.com/repos/mongodb/mongodb-extension/releases/tags/1.20.0.

It even has a @todo comment above it 😛

mickverm avatar Oct 11 '24 14:10 mickverm

Found the issue, this line makes a request to the incorrect URL: https://api.github.com/repos/mongodb/mongodb-extension/releases/tags/1.20.0.

I assume it's pulling that from https://github.com/mongodb/mongo-php-driver/blob/v1.x/composer.json#L2. I'll leave @alcaeus to sort this out, as he previously worked with @asgrim on this. I'm not sure if the appropriate fix is on our side or in PIE itself (although the @todo suggests it may be upstream).

jmikola avatar Oct 11 '24 16:10 jmikola

Yep I agree it appears it's related to the @todo :) will investigate php/pie#68 soon and hopefully fix :+1:

Just to note, you will need the vs/vc version in the Windows assets though!

asgrim avatar Oct 11 '24 16:10 asgrim

I received similar error:

D:>programs\xampp\php\php.exe D:\LocalHost\pie.phar install mongodb/mongodb-extension This command may need elevated privileges, and may prompt you for your password. You are running PHP 8.2.0 Target PHP installation: 8.2.0 ts, vs16, on Windows x86_64 (from D:\programs\xampp\php\php.exe) Found package: mongodb/mongodb-extension:1.20.1 which provides ext-mongodb

In CouldNotFindReleaseAsset.php line 19:

Could not find release asset for mongodb/mongodb-extension:1.20.1 named one of "php_mongodb-1.20.1-8.2-ts-vs16-x86_ 64.zip, php_mongodb-1.20.1-8.2-vs16-ts-x86_64.zip"

install [-j|--make-parallel-jobs MAKE-PARALLEL-JOBS] [--with-phpize-path WITH-PHPIZE-PATH] [--with-php-config WITH-PHP-CONFIG] [--with-php-path WITH-PHP-PATH] [--enable-mongodb-coverage ENABLE-MONGODB-COVERAGE] [--enable-mongodb-crypto-system-profile ENABLE-MONGODB-CRYPTO-SYSTEM-PROFILE] [--enable-mongodb-developer-flags ENABLE-MONGODB-DEVELOPER-FLAGS] [--with-mongodb-client-side-encryption WITH-MONGODB-CLIENT-SIDE-ENCRYPTION] [--with-mongodb-sasl WITH-MONGODB-SASL] [--with-mongodb-snappy WITH-MONGODB-SNAPPY] [--with-mongodb-ssl WITH-MONGODB-SSL] [--with-mongodb-system-libs WITH-MONGODB-SYSTEM-LIBS] [--with-mongodb-zlib WITH-MONGODB-ZLIB] [--with-mongodb-zstd WITH-MONGODB-ZSTD] [--] <requested-package-and-version>

I used PIE v0.2.0.

nikunjbhatt avatar Dec 05 '24 21:12 nikunjbhatt

It seems the release name is mixed up (note, x86_64 vs x64_86):

Expected: php_mongodb-1.20.1-8.2-ts-vs16-x86_64.zip
Actual:   php_mongodb-1.20.1-8.2-ts-vs16-x64_86.zip

asgrim avatar Dec 05 '24 21:12 asgrim

Closed in #1762.

alcaeus avatar Mar 10 '25 12:03 alcaeus