Project

General

Profile

git is in path - but failing with "bad file descriptor"

Added by Aakash Chopra over 10 years ago

Hi any help would be appreciated regarding this problem:

For some reason svn works but not git... I tried both by not modifying <REDMINE_HOME>/config/configuration.yml and by modifying to include the full path to git (/bin/git) but no go...

Environment:

[redmine@blah ~]$ env | grep PATH
PATH=/home/redmine/.rbenv/shims:/home/redmine/.rbenv/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/redmine/.local/bin:/home/redmine/bin:/opt/java/bin

[redmine@blah ~]$ which git
/bin/git

[redmine@blah ~]$ file /bin/git
/bin/git: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xcf3bc88bf2eca6ed809655250eba6a8afb7807b9, stripped

[redmine@blah ~]$ which svn
/bin/svn

[redmine@blah ~]$ file /bin/svn
/bin/svn: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x2a7e61ca4a69acb42928ce26e23f41ff5be67a80, stripped

In rails server log

SCM command failed, make sure that your SCM command (e.g. svn) is in PATH (/home/redmine/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/bin:/home/redmine/.rbenv/versions/jruby-1.7.4/bin:/home/redmine/.rbenv/libexec:/home/redmine/.rbenv/plugins/ruby-build/bin:/home/redmine/.rbenv/shims:/home/redmine/.rbenv/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/redmine/.local/bin:/home/redmine/bin:/opt/java/bin)
You can configure your scm commands in config/configuration.yml.
'/bin/git' --version --no-color
with: Bad file descriptor - Bad file descriptor
scm: error during get scm available: Bad file descriptor - Bad file descriptor

So I tried this:

[redmine@blah redmine-2.3.2]$ ruby ./script/rails c production
/home/redmine/redmine-2.3.2/lib/redmine.rb:66 warning: already initialized constant FCSV
Loading production environment (Rails 3.2.13)
irb(main):001:0> `git --version --nocolor`
=> "git version 1.8.3.1\n" 
irb(main):002:0>

And it works... WT?

Any ideas?


Replies (2)

RE: git is in path - but failing with "bad file descriptor" - Added by Manuel Jesús Recena Soto over 10 years ago

Hi Aakash,

I have the same problem. I found this issue with these environments:

a.1) GNU/Linux Debian + JRuby 1.7.3 + Redmine 2.3.2 + Tomcat 6.0.36 + Oracle JDK 1.7 + Git 1.7.2.5
a.2) GNU/Linux Debian + JRuby 1.7.3 + Redmine 2.3.2 + Tomcat 6.0.36 + Oracle JDK 1.7 + Git 1.8.4

b.1) GNU/Linux Debian + JRuby 1.7.3 + Redmine 2.2.4 + Tomcat 6.0.36 + Oracle JDK 1.7 + Git 1.7.2.5

There is an important issue here related with Bad file descriptor
https://github.com/jruby/jruby/issues/781

Regards,

RE: git is in path - but failing with "bad file descriptor" - Added by Manuel Jesús Recena Soto over 10 years ago

Hi Aakash,

The problem seems complex and it is related to JRuby + JDK + SubProcess.
You can read more about this here

Regards,

    (1-2/2)