Project

General

Profile

Actions

Defect #1682

closed

Show error if SCM executable is not in rails PATH (ENV['PATH'])

Added by Adam Grant over 16 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
Start date:
2008-07-24
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Redmine should log a message if the scm executable cannot be found in the user's path that the redmine app is running under.

For our case, the svn command was not in the user's PATH, but there was no way to figure this out without custom loggers and 2 hours of debugging.

The subversion_adapter.rb tries to shellout the command "svn list..." and "svn info..." for gathering info on the connected repository. After it tries this, IO.popen creates a variable called $? which has info on the pipe it created. Specifically, it has an exitstatus, which tells you if the command was successful, or any error it encountered.

Line 105 of lib/redmine/scm/adapters/subversion_adapter.rb has this:

return nil if $? && $?.exitstatus != 0

The $?.exitstatus for us was coming out to be 127, which is "command not found". No log was being created to warn admins about this though, and everything failed silently. It ignores all the important exitstatus numbers (besides 0) and doesn't report any problems whatsoever.

It should put a log message like:

logger.info "Your SCM (#{your_scm_command_here}) was not found in the PATH (#{ENV['PATH']})"

Or at least should log:

logger.debug("SCM Process Status: #{$?.inspect}")

which will show the exit code.

Not sure if this should bubble up to the repository setup page on the site, but it would be nice so you don't have to dig through the log just to figure out the error.


Files

redmine_patch.txt (555 Bytes) redmine_patch.txt Adam Grant, 2008-08-02 00:48
Actions

Also available in: Atom PDF