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

Fails to install dependencies randomly. #876

Closed
ShurikAg opened this issue Jul 4, 2012 · 29 comments
Closed

Fails to install dependencies randomly. #876

ShurikAg opened this issue Jul 4, 2012 · 29 comments
Labels

Comments

@ShurikAg
Copy link

ShurikAg commented Jul 4, 2012

We have Jenkins running on RedHat 5 after on of the updates the installation of dependencies on that box specifically started to fail randomly with the following error:

[exec]   - Installing ea/guzzle-bundle (1.0.0-beta)
     [exec]     Cloning 1.0.0-beta
     [exec] 
     [exec] 
     [exec]                                    
     [exec]   [RuntimeException]               
     [exec]   Failed to execute git branch -r  

It happens of different bundles in different cases and sometimes it works properly.
We reverted to version '1.0.0-alpha3' and it works perfectly fine.

@Seldaek
Copy link
Member

Seldaek commented Jul 5, 2012

I think we had someone report this on irc the other day. It just seems that in some environments the process returns a non-zero exit code, even though it ran through fine. I'm not sure how to proceed, ignoring exit codes isn't really a great idea, but it seems to be a bug in php's proc_open handling, or hopefully it lies in the Process component we use and then it'd be maybe fixable. Anyway until I can get my hands on a box that does that, I don't really know how to best debug and fix this.

@patcon
Copy link

patcon commented Jul 5, 2012

For what it's worth, here's the differing line for anyone interested
1.0.0-alpha3...1.0.0-alpha4#L63R81

@Seldaek
Copy link
Member

Seldaek commented Jul 5, 2012

If anyone experiencing this could give as much details as they can about their environment (OS, php version, configure params) it would maybe help.

@ShurikAg
Copy link
Author

ShurikAg commented Jul 5, 2012

Here are the details of our jenkins server:

[PHP Modules]
apc
bcmath
bz2
Core
ctype
curl
date
dom
ereg
fileinfo
filter
gd
gettext
gmp
hash
http
iconv
json
libxml
mbstring
mcrypt
memcache
oci8
openssl
pcre
PDO
PDO_OCI
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]
Xdebug

PHP:
PHP 5.4.3 (cli) (built: May 8 2012 16:34:37)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans

OS:
Linux eac-easoapp11.eac.ad.ea.com 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

cURL:
curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Anything else?

@Seldaek
Copy link
Member

Seldaek commented Jul 5, 2012

Which OS is it? and can you paste a php -i | grep 'Configure Command' too? To be honest I don't know if/when I'll have time to setup a VM to try it, but that may help us narrow it down if we get more reports at least.

@ShurikAg
Copy link
Author

ShurikAg commented Jul 5, 2012

Configure Command => './configure' '--host=x86_64-linux' '--prefix=/opt/easw/tools/php-5.4.3' '--with-apxs2=/opt/easw/tools/apache2/bin/apxs' '--with-openssl' '--with-sqlite3' '--with-zlib' '--with-curl' '--enable-mbstring' '--with-xsl' '--with-pear' '--with-zlib-dir' '--with-xmlrpc' '--with-gd' '--enable-gd-native-ttf' '--with-pdo-oci=instantclient,/home/build/rpmbuild/BUILD/easw_php54/instantclient_11_1,11.1' '--with-png-dir' '--with-jpeg-dir' '--with-pic' '--disable-debug' '--disable-ipv6' '--with-bz2' '--with-gettext' '--with-gmp' '--with-iconv' '--with-mcrypt' '--enable-bcmath' '--enable-sockets' '--enable-zip' '--with-ldap=shared' '--with-snmp=shared'

@patcon
Copy link

patcon commented Jul 5, 2012

@ShurikAg

Which OS is it?

uname is just the kernel, but could be rhel5/centos5/scientific/etc :)

@ShurikAg
Copy link
Author

ShurikAg commented Jul 5, 2012

oh sorry, it's rhel5

@iJanki
Copy link

iJanki commented Jul 7, 2012

I'm having the same problem on centos5 installing symfony-standard 2.1. composer alpha 3 works fine instead.

Updating dependencies

  • Installing doctrine/doctrine-bundle (dev-master)
    Cloning c9ea46d1f0c48bb88bb87b44214fe44e03c0c692

    [RuntimeException]
    Failed to execute git branch -r

Here's host data:

Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mhash' '--enable-force-cgi-redirect' '--libdir=/usr/lib64/php' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--enable-mysqlnd=shared' '--with-mysql=shared,mysqlnd' '--with-mysqli=shared,mysqlnd' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-oci8=shared,instantclient,/usr/lib64/oracle/11.2/client64/lib,11.2' '--with-pdo-oci=shared,instantclient,/usr,11.2' '--with-interbase=shared,/usr/lib64/firebird' '--with-pdo-firebird=shared,/usr/lib64/firebird' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--without-sqlite3' '--with-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'

Linux 2.6.18-308.8.2.el5 #1 SMP Tue Jun 12 09:58:12 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

I'm using php-5.3.14-1.el5.remi.rpm

In my case it never works installing certain packages like doctrine/doctrine-bundle (dev-master)

@robzienert
Copy link

The referenced issue in symfony was closed. Fabien says it's an issue with Composer. Should this be reopened?

@stof
Copy link
Contributor

stof commented Jul 10, 2012

@robzienert This issue is open.

@robzienert
Copy link

Oh, I'm sorry. I was thrown off by the closed reference issue above my comment. :(

@cs278
Copy link
Contributor

cs278 commented Jul 11, 2012

Process runs fine as expected, but the return value is -1. proc_open() manual page states this:

The exit code returned by the process (which is only meaningful if running is FALSE). Only first call of this function return real value, next calls return -1.

@Seldaek
Copy link
Member

Seldaek commented Jul 14, 2012

So would anyone have a clue what we can do to work around this? Does it fail on all CentOS5/RHEL5? All CentOS/RHEL?

@mtdowling
Copy link

Don't have much info right now, but failed for me quite a bit on RHEL5 running Jenkins. I have to run composer install several times in order to get all of my dependencies.

@iJanki
Copy link

iJanki commented Jul 17, 2012

I had a chance to try centos6. It works there.

With Centos5 installations always fail for me with a
[RuntimeException]
Failed to execute git branch -r

Alpha 3 works fine. Doesn't it check return values?

@jcroll
Copy link

jcroll commented Jul 17, 2012

I am having this same issue with CentOS 5.8.

@Seldaek
Copy link
Member

Seldaek commented Jul 17, 2012

So it seems it's something in CentOS/RHEL 5.. most likely some patch they applied to their php version that blew things up. A few things:

  • Can everyone experiencing the problem run and report here those commands: php -i | grep configure and php -v?
  • Does anyone know how to detect conclusively from PHP that the current machine is a broken CentOS5/RHEL 5? I don't have any experience with those OSs so if someone can do a detection script, I can bypass (or fallback to more esoteric methods) the return value checks at least in the GitDownloader.
  • Can anyone try if this phar fixes it? http://getcomposer.org/rhelcomposer.phar

@iJanki yes, alpha3 works fine because it did not do the same stuff, and the current behavior needs to know if the command failed to proceed.

@jcroll
Copy link

jcroll commented Jul 17, 2012

$ php -i | grep configure
Configure Command => './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/lib/mysql/mysql_config' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr/lib/mysql/mysql_config' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--without-readline' '--with-libedit' '--with-pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--enable-fileinfo=shared' '--enable-intl=shared' '--with-icu-dir=/usr' '--with-enchant=shared,/usr' '--with-recode=shared,/usr'

$ php -v
PHP 5.3.13 (cli) (built: May 8 2012 15:37:21)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans

@jcroll
Copy link

jcroll commented Jul 17, 2012

I gave the rhelcomposer.phar a try. I used it to attempt to install the latest beta release of Symphony 2.1.x:

$ php /usr/local/bin/rhelcomposer.phar create-project symfony/framework-standard-edition  v2.1.0-BETA3
Installing symfony/framework-standard-edition (dev-master v2.1.0-BETA3)
  - Installing symfony/framework-standard-edition (dev-master)
    Cloning master



  [RuntimeException]
  Failed to execute git branch -r && echo .





create-project [--prefer-source] [--repository-url="..."] [--dev] package [directory] [version]

@jcroll
Copy link

jcroll commented Jul 17, 2012

BTW is there an easy way to roll back composer as iJanki said Alpha 3 works fine? thx

@cs278
Copy link
Contributor

cs278 commented Jul 17, 2012

@jcroll
Copy link

jcroll commented Jul 17, 2012

@cs278 thank you!

@iJanki
Copy link

iJanki commented Jul 17, 2012

@Seldaek you can detect os version reading /etc/redhat-release file.
For Centos 5 is

cat /etc/redhat-release
CentOS release 5.8 (Final)

I don't have rhel5 though to see how it would appear.

@cs278
Copy link
Contributor

cs278 commented Jul 18, 2012

Seems to be a problem in Symfony, see the above PR.

fabpot added a commit to symfony/symfony that referenced this issue Jul 19, 2012
Commits
-------

310c458 [Process] Fixed a problem on RHEL5 where the exit code was incorrect

Discussion
----------

[Process] Fixed a problem on RHEL5 where the exit code was incorrect

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

RHEL5 will intermittently result in an exit code of -1 due to `proc_get_status()` being called after the process has completed but outside of `updateStatus()` which saves the exit code.

See composer/composer#876
@fabpot
Copy link
Contributor

fabpot commented Jul 19, 2012

The PR on Symfony has been merged now. Can you all confirm that it fixes the issue?

@Seldaek
Copy link
Member

Seldaek commented Jul 19, 2012

I upgraded the deps of composer, so if you update to the latest phar it should include the patch from @cs278

@jcroll
Copy link

jcroll commented Jul 19, 2012

Hi yes this appears to work. Nice work all.

@Seldaek
Copy link
Member

Seldaek commented Jul 20, 2012

Ok looks like it is fixed so I will close the issue for now. If it pops up again with a recent composer version please do tell.

@Seldaek Seldaek closed this as completed Jul 20, 2012
craigmarvelley pushed a commit to craigmarvelley/symfony that referenced this issue Nov 26, 2013
RHEL5 will intermittently result in an exit code of -1 [1] due to
proc_get_status() being called after the process has completed
but outside of updateStatus() which saves the exit code.

[1]: composer/composer#876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants