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

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

Open
mickverm opened this issue Oct 10, 2024 · 6 comments · Fixed by #1762
Open

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

mickverm opened this issue Oct 10, 2024 · 6 comments · Fixed by #1762

Comments

@mickverm
Copy link
Contributor

mickverm commented Oct 10, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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 😛

@jmikola
Copy link
Member

jmikola commented Oct 11, 2024

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).

@asgrim
Copy link

asgrim commented Oct 11, 2024

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

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

@nikunjbhatt
Copy link

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.

@asgrim
Copy link

asgrim commented Dec 5, 2024

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

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