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

composer fails in SF 4.2: " curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported " #515

Closed
hal869 opened this issue Jun 14, 2019 · 25 comments

Comments

@hal869
Copy link
Contributor

@hal869 hal869 commented Jun 14, 2019

I'm updating my v4.2 project. Composer's uptodate,

cd ~

which composer
	/usr/local/bin/composer

composer --version
	Composer version 1.8.6 2019-06-11 15:03:05

composer -vv self-update
	You are already using composer version 1.8.6 (stable channel).

but in my Symfony project,

	cd /src/www/test
	composer --version

	  [ErrorException]
	  curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported

	composer -vv self-update

		                                                              
		  [ErrorException]                                            
		  curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported  
		                                                              

		Exception trace:
		 () at /src/www/test/vendor/symfony/flex/src/CurlDownloader.php:49
		 Composer\Util\ErrorHandler::handle() at n/a:n/a
		 curl_multi_setopt() at /src/www/test/vendor/symfony/flex/src/CurlDownloader.php:49
		 Symfony\Flex\CurlDownloader->__construct() at /src/www/test/vendor/symfony/flex/src/ParallelDownloader.php:48
		 Symfony\Flex\ParallelDownloader->__construct() at /src/www/test/vendor/symfony/flex/src/Flex.php:108
		 Symfony\Flex\Flex->activate() at phar:///usr/local/bin/composer.phar/src/Composer/Plugin/PluginManager.php:236
		 Composer\Plugin\PluginManager->addPlugin() at phar:///usr/local/bin/composer.phar/src/Composer/Plugin/PluginManager.php:205
		 Composer\Plugin\PluginManager->registerPackage() at phar:///usr/local/bin/composer.phar/src/Composer/Plugin/PluginManager.php:261
		 Composer\Plugin\PluginManager->loadRepository() at phar:///usr/local/bin/composer.phar/src/Composer/Plugin/PluginManager.php:76
		 Composer\Plugin\PluginManager->loadInstalledPlugins() at phar:///usr/local/bin/composer.phar/src/Composer/Factory.php:384
		 Composer\Factory->createComposer() at phar:///usr/local/bin/composer.phar/src/Composer/Factory.php:576
		 Composer\Factory::create() at phar:///usr/local/bin/composer.phar/src/Composer/Console/Application.php:345
		 Composer\Console\Application->getComposer() at phar:///usr/local/bin/composer.phar/src/Composer/Console/Application.php:458
		 Composer\Console\Application->getPluginCommands() at phar:///usr/local/bin/composer.phar/src/Composer/Console/Application.php:156
		 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php:117
		 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer.phar/src/Composer/Console/Application.php:104
		 Composer\Console\Application->run() at phar:///usr/local/bin/composer.phar/bin/composer:61
		 require() at /usr/local/bin/composer.phar:24
@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 14, 2019

Correct! Would you mind sending a PR to drop using the flag?

fabpot added a commit that referenced this issue Jun 15, 2019
This PR was merged into the 1.2-dev branch.

Discussion
----------

remove deprecated CURLPIPE_HTTP1 support flag

cref #515

@ https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html
```
	HTTP/1 Pipelining support was disabled in 7.62.0.
```

here
```
	lsb_release -rd
		Description:    openSUSE Leap 15.1
		Release:        15.1

	curl -V
		curl 7.65.1 (x86_64-suse-linux-gnu) libcurl/7.65.1 OpenSSL/1.1.0i-fips zlib/1.2.11 libidn2/2.2.0
		...
```

manually
```
	src/CurlDownloader.php

-	        curl_multi_setopt($mh, CURLMOPT_PIPELINING, /*CURLPIPE_HTTP1 | CURLPIPE_MULTIPLEX*/ 3);
+	        curl_multi_setopt($mh, CURLMOPT_PIPELINING, /*CURLPIPE_MULTIPLEX*/ 2);
```

now, check
```
	composer --version
		Composer version 1.8.6 2019-06-11 15:03:05
```

Commits
-------

0fd8e9a remove deprecated CURLPIPE_HTTP1 support flag
@fabpot fabpot closed this Jun 15, 2019
maxhelias added a commit to maxhelias/flex that referenced this issue Jul 9, 2019
@gundamftw
Copy link

@gundamftw gundamftw commented Dec 4, 2019

Hi I'm also getting this exact same error as of today while trying to update from Symfony 4.2 to 5. My Composer version is 1.9.1.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

Wondering when this issue will be reopened and fixed

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 9, 2019

this issue is already fixed, please upgrade.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

odd i am using symfony/flex 1.5.3 which is latest. so again i am wondering when this will be fixed or what is needed to resolve this issue
image

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 9, 2019

you may have forgotten to upgrade your global flex install
compose global require symfony/flex ^1.5
BTW, don't hesitate to submit fixes next time, no need to wait when you can contribute them.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

interesting i did not read that https://symfony.com/doc/current/setup/flex.html. I am wondering if you could explain what this is doing then using composer update symfony/flex

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

That did not fix anything i only got subsequent errors.

Symfony recipes are disabled: "symfony/flex" not found in the root composer.json
@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 9, 2019

That's not an error, just an info message.

@gundamftw
Copy link

@gundamftw gundamftw commented Dec 9, 2019

That did not fix anything i only got subsequent errors.

Symfony recipes are disabled: "symfony/flex" not found in the root composer.json

What I did to fix it this was to download the latest flex release, and then replace the flex folder in app\vendor\symfony\flex with the new one.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

@gundamftw thanks for the tip but this is not possible when building in a pipeline

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

@nicolas-grekas the same error persists and after running the suggested command

composer global require symfony/flex ^1.5

nothing changed in my composer.lock file and the error is still happeing in my pipeline that is php 7.4. Let me know if there is anything i am missing or if there is any information that i can provide that may help me resolve this

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 9, 2019

I don't know anymore which error you're seeing:

  • "Symfony recipes are disabled" is not an error but a notice, you can igore it
  • CURLPIPE_HTTP1 is not found anywhere is the source code of flex - if you see something about, check the stack trace or use grep to find the offending file.
@diamondlee
Copy link

@diamondlee diamondlee commented Dec 9, 2019

@nicolas-grekas i will get the verbose output to check the file but the error is still
image
just seems odd that this also happens when you try and make a symfony skeleton project

@ddegasperi
Copy link

@ddegasperi ddegasperi commented Dec 10, 2019

@diamondlee I have just had the same error. After removing the var and the vendor folder it worked for me.
Another solution could be to run the install process without using the composer cache?

@nd-brown
Copy link

@nd-brown nd-brown commented Dec 20, 2019

I have just had the same error too. And find that problem in php version. I run into problem if I use php 7.4, but on php 7.3 everything works

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 20, 2019

@nicolas-grekas according to the documentation found at https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html it seems as if Since 7.62.0, CURLPIPE_MULTIPLEX is enabled by default. so in the construction of the flex CurlDownloader.php the line

curl_multi_setopt($mh, CURLMOPT_PIPELINING, /*CURLPIPE_MULTIPLEX*/ 2); 

could maybe be removed or updated to the correct constant? According the the stack trace produced by the composer command install this is where the problem is

Loading plugin Symfony\Flex\Flex

                                                              
  [ErrorException]                                            
  curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported  
                                                              

Exception trace:
 () at /builds/project/vendor/symfony/flex/src/CurlDownloader.php:49
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 curl_multi_setopt() at /builds/project/vendor/symfony/flex/src/CurlDownloader.php:49
 Symfony\Flex\CurlDownloader->__construct() at /builds/project/vendor/symfony/flex/src/ParallelDownloader.php:48
 Symfony\Flex\ParallelDownloader->__construct() at /builds/project/vendor/symfony/flex/src/Flex.php:108
 Symfony\Flex\Flex->activate() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php:236
 Composer\Plugin\PluginManager->addPlugin() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php:205
 Composer\Plugin\PluginManager->registerPackage() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php:261
 Composer\Plugin\PluginManager->loadRepository() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php:76
 Composer\Plugin\PluginManager->loadInstalledPlugins() at phar:///usr/bin/composer/src/Composer/Factory.php:384
 Composer\Factory->createComposer() at phar:///usr/bin/composer/src/Composer/Factory.php:576
 Composer\Factory::create() at phar:///usr/bin/composer/src/Composer/Console/Application.php:345
 Composer\Console\Application->getComposer() at phar:///usr/bin/composer/src/Composer/Console/Application.php:458
 Composer\Console\Application->getPluginCommands() at phar:///usr/bin/composer/src/Composer/Console/Application.php:156
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:104
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:61
 require() at /usr/bin/composer:24

ERROR: Job failed: exit code 1
@diamondlee
Copy link

@diamondlee diamondlee commented Dec 20, 2019

@nicolas-grekas and @hal869 and @gundamftw maybe using the PHP constant instead of the trying to use the constants value will keep the code compatible between php versions

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 20, 2019

I don't understand what this discussion is about anymore: the code doesn't use the constant anymore. About multiplex being the new default, we still need to support older releases so we can't do anything for the next few years.

If I miss something and you know what should be changed, please send a PR.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 20, 2019

@nicolas-grekas this conversation is about the fact that the symfony flex code throws an exception with php 7.4.

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Dec 20, 2019

CURLPIPE_HTTP1 doesn't exist in the code anymore. If you have the issue, the only reason I can imagine is because you didn't update flex to the latest version.

@diamondlee
Copy link

@diamondlee diamondlee commented Dec 20, 2019

@nicolas-grekas this seems to be resolved with the use of php 7.4.1 which was released 2019/18/12

@TimoBakx
Copy link

@TimoBakx TimoBakx commented Jan 20, 2020

I had this issue in a project that I haven't touched in a while.

I fixed it by:

  1. Updating the global symfony/flex using composer global require symfony/flex ^1.5 as @nicolas-grekas suggested.
  2. Removing the vendor/symfony/flex directory in my project.
  3. Running composer update.
@carherco
Copy link

@carherco carherco commented Jan 21, 2020

I had this issue in a project that I haven't touched in a while.

I fixed it by:

  1. Updating the global symfony/flex using composer global require symfony/flex ^1.5 as @nicolas-grekas suggested.
  2. Removing the vendor/symfony/flex directory in my project.
  3. Running composer update.

That worked for me. Thanks!

@mnapoli
Copy link

@mnapoli mnapoli commented Mar 11, 2020

Same issue today as well, couldn't run any composer command in my project.

If you have the issue, the only reason I can imagine is because you didn't update flex to the latest version.

Sure, but how do you updated it? I haven't installed flex globally. And I can't update anything since Composer is broken.

Thanks @TimoBakx for the solution, I had to rm -rf vendor to unblock my project…

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

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.