Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[Process] stream_select error #543

Closed
1ed opened this Issue · 7 comments

2 participants

@1ed
1ed commented

Hi! After I updated to the most recent composer version I got this error with a composer.json like in symfony-standard:

$ c self-update
You are using the latest composer version.
$ c -V
Composer version 146215e
$ c update -v
Updating dependencies
Updating kriswallsmith/assetic (dev-master) to kriswallsmith/assetic(dev-master)
  - Package kriswallsmith/assetic (dev-master)



  [ErrorException]                                     
  stream_select(): 385 is not a valid stream resource  



Exception trace:
 () at phar:///home/egabor/bin/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php:287
 Composer\Util\ErrorHandler::handle() at n/a:n/a
 stream_select() at phar:///home/egabor/bin/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php:287
 Symfony\Component\Process\Process->wait() at phar:///home/egabor/bin/composer.phar/vendor/symfony/process/Symfony/Component/Process/Process.php:157
 Symfony\Component\Process\Process->run() at phar:///home/egabor/bin/composer.phar/src/Composer/Util/ProcessExecutor.php:43
 Composer\Util\ProcessExecutor->execute() at phar:///home/egabor/bin/composer.phar/src/Composer/Downloader/GitDownloader.php:63
 Composer\Downloader\GitDownloader->enforceCleanDirectory() at phar:///home/egabor/bin/composer.phar/src/Composer/Downloader/VcsDownloader.php:69
 Composer\Downloader\VcsDownloader->update() at phar:///home/egabor/bin/composer.phar/src/Composer/Downloader/DownloadManager.php:169
 Composer\Downloader\DownloadManager->update() at phar:///home/egabor/bin/composer.phar/src/Composer/Installer/LibraryInstaller.php:109
 Composer\Installer\LibraryInstaller->update() at phar:///home/egabor/bin/composer.phar/src/Composer/Installer/InstallationManager.php:155
 Composer\Installer\InstallationManager->update() at phar:///home/egabor/bin/composer.phar/src/Composer/Installer/InstallationManager.php:114
 Composer\Installer\InstallationManager->execute() at phar:///home/egabor/bin/composer.phar/src/Composer/Installer.php:298
 Composer\Installer->run() at phar:///home/egabor/bin/composer.phar/src/Composer/Command/UpdateCommand.php:63
 Composer\Command\UpdateCommand->execute() at phar:///home/egabor/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:237
 Symfony\Component\Console\Command\Command->run() at phar:///home/egabor/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///home/egabor/bin/composer.phar/src/Composer/Console/Application.php:70
 Composer\Console\Application->doRun() at phar:///home/egabor/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at phar:///home/egabor/bin/composer.phar/src/Composer/Console/Application.php:59
 Composer\Console\Application->run() at phar:///home/egabor/bin/composer.phar/bin/composer:9
 require() at /home/egabor/bin/composer.phar:15


update [--prefer-source] [--dry-run] [--no-install-recommends] [--install-suggests]
@Seldaek
Owner

Does it happen every time or was it a random failure?

@1ed
1ed commented

Yes, every time. It seems libs downloaded as archives are OK, but if they come from git I get the error. I've got this for a fresh symfony-standard intstall:

$ c install
Installing dependencies
  - Package monolog/monolog (1.0.2)
    Downloading: 100%         

  - Package swiftmailer/swiftmailer (4.1.6)
    Downloading: 100%         

  - Package kriswallsmith/assetic (dev-master)


  [ErrorException]                                      
  stream_select(): 1111 is not a valid stream resource  

I have Ubuntu 11.10, PHP 5.3.6 and git version 1.7.9.4 if it helps.

@Seldaek
Owner

Oh on ubuntu even? Is git accessible in your path? It's weird that it would throw an error exception anyway because stream_select is called with @ in front. Do you have xdebug with scream enabled maybe (php -i | grep scream to check)?

@1ed
1ed commented

Hmm, I've not seen that the error handler converts errors to exceptions so It's working without scream. Is it possible avoid using @ there or using scream is not a good idea anyway?

@Seldaek
Owner

Well, I think in general using scream isn't a good idea unless when you're trying to debug some crappy old code that abuses the @ operator, but there are a few legitimate use cases for it.

Anyway I'll try to enable scream here and see if I can improve the situation when it's enabled.

@Seldaek Seldaek referenced this issue in symfony/symfony
Merged

Process fixes #3838

@Seldaek Seldaek closed this in 5c64455
@Seldaek
Owner

Ok, so I sent a PR to Symfony to fix the root cause of your issue with stream_select - and I partly take back what I said about scream because it really highlighted a bug ;)

In the meantime, and because there are a few legitimate uses of @, I also added a warning in the error output if scream is enabled that maybe this is not a normal error.

Thanks for reporting

@fabpot fabpot referenced this issue from a commit in symfony/symfony
@fabpot fabpot merged branch Seldaek/process_fix (PR #3838)
Commits
-------

6dca141 [Process] Skip signal assertion on windows
4cd0fb4 [Process] Skip test that is still getting stuck on windows
e82a05d [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation
f4227b5 [Process] Removing useless code (this is already done in updateStatus)
2d586d2 [Process] Fix a mistake triggering stream_select errors

Discussion
----------

Process fixes

A few fixes, including making the tests pass on windows and fixing composer/composer#543. Given the sensitivity of this code I did a bunch of very granular commits explaining everything.
127cff0
@1ed
1ed commented

Great! Thank you!

@felixalias felixalias referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@felixalias felixalias referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mmucklo mmucklo referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@digitalkaoz digitalkaoz referenced this issue from a commit in digitalkaoz/composer
@Seldaek Seldaek Remove unnecessary @ operator, refs #543 d202484
@digitalkaoz digitalkaoz referenced this issue from a commit in digitalkaoz/composer
@Seldaek Seldaek Warn users about having scream enabled, fixes #543 5803eb5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.