Project

General

Profile

Actions

Defect #1126

closed

Unable to display Bazaar repository

Added by Andreas Deininger over 16 years ago. Updated almost 14 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

Hi,

I couldn't succeed in setup a Bazaar repository for one of my projects, the URL
http://www.mydomain.eu/projects/show/www yields an internal error.

According to http://www.redmine.org/wiki/1/RedmineRepositories I ran

PS D:\> ruby D:\my\path\redmine\script\runner "Repository.fetch_changesets" -e production
C:/Programme/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb:47: D:/Websites/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:
125:in `popen': Exec format error - bzr revno "D:\FTP-Sites\xxx\yyy\zzz\BZR-Repo\stiegele.eu/" (Errno::ENOEXEC)
from D:/Websites/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:125:in `shellout'
from D:/Websites/redmine/lib/redmine/scm/adapters/bazaar_adapter.rb:32:in `info'
from D:/Websites/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:108:in `retrieve_root_url'
from D:/Websites/redmine/lib/redmine/scm/adapters/abstract_adapter.rb:31:in `initialize'
from D:/Websites/redmine/app/models/repository.rb:34:in `new'
from D:/Websites/redmine/app/models/repository.rb:34:in `scm'
from D:/Websites/redmine/app/models/repository/bazaar.rb:51:in `fetch_changesets'
from C:/Programme/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/symbol.rb:11:in `__send__'
from C:/Programme/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/symbol.rb:11:in `to_proc'
from D:/Websites/redmine/app/models/repository.rb:79:in `each'
from D:/Websites/redmine/app/models/repository.rb:79:in `fetch_changesets'
from (eval):1
from C:/Programme/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `eval'
from C:/Programme/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb:47
from C:/Programme/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from C:/Programme/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from D:/Websites/redmine/script/runner:3

However, using bazaar, I can retrieve the revision number successfully:

PS D:\Websites\redmine> bzr revno "D:\FTP-Sites\xxx\yyy\zzz\BZR-Repo\stiegele.eu/"
23

My Redmine instance is SVN revision 1369.

PS D:\Websites\redmine> bzr version
Bazaar (bzr) 1.3.1
Python interpreter: C:\Programme\Python25\python.exe 2.5.2.final.0
Python standard library: C:\Programme\Python25\lib
bzrlib: C:\Programme\Python25\lib\site-packages\bzrlib

As database backend, I'm using PostgreSQL 8.3.1.


Related issues

Related to Redmine - Defect #3743: Mercurial repository path on windows....Closed2009-08-15

Actions
Actions #1

Updated by Jean-Philippe Lang over 16 years ago

  • Target version deleted (0.7)

When you run script\runner, make sure that bzr.exe is in your PATH environment variable.
Although it should not be needed, you can try to specify the full path to the binary in lib/redmine/scm/adpaters/bazaar_adapter.rb, line 26.
Example:

BZR_BIN = "C:\\path\to\bzr.exe"
Actions #2

Updated by Andreas Deininger over 16 years ago

After specifying the full path for BZR_BIN, now I can run the script\runner successfully (bzr.bat was on the PATH already before).

However, after invoking http://my.domain.tld/repositories/show/www, I'm still getting an internal error:

Errno::ENOEXEC (Exec format error - bzr revno "D:/FTP-Sites/Stiegele/LocalUser/SdsFtpUser/BZR-Repo/stiegele.eu/"):
/lib/redmine/scm/adapters/abstract_adapter.rb:125:in `popen'
/lib/redmine/scm/adapters/abstract_adapter.rb:125:in `shellout'
/lib/redmine/scm/adapters/bazaar_adapter.rb:32:in `info'
/lib/redmine/scm/adapters/abstract_adapter.rb:108:in `retrieve_root_url'
/lib/redmine/scm/adapters/abstract_adapter.rb:31:in `initialize'
/app/models/repository.rb:34:in `new'
/app/models/repository.rb:34:in `scm'
/app/models/repository/bazaar.rb:51:in `fetch_changesets'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in `send'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in `method_missing'
/app/controllers/repositories_controller.rb:53:in `show'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/Programme/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/rails.rb:76:in `process'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `synchronize'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `process'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:159:in `process_client'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `each'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `process_client'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `initialize'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `new'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `initialize'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `new'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:282:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `each'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:128:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run'
C:/Programme/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.4-x86-mswin32-60/bin/mongrel_rails:281
C:/Programme/ruby/bin/mongrel_rails:19:in `load'
C:/Programme/ruby/bin/mongrel_rails:19

Rendering D:/Websites/redmine/public/500.html (500 Internal Server Error)

Actions #3

Updated by Jean-Philippe Lang over 16 years ago

It looks like you didn't restart the application after the change ?

Actions #4

Updated by Andreas Deininger over 16 years ago

Yes, a restart cured the isuue raised in comment #2.
I digged into the initial issue and found out that the command "bzr" does not work on Windows machines, you have to provide "bzr.bat" as command instead:

D:\>ruby -e 'IO.popen("bzr")'
-e:1:in `popen': Exec format error - bzr (Errno::ENOEXEC)
from -e:1

D:\>ruby -e 'IO.popen("bzr.bat")'

D:\>

So it's not the path that is required but the file extension .bat

Actions #5

Updated by Jean-Philippe Lang over 16 years ago

Thanks for the feedback.
bzr works for me on Win32. And I don't have bzr.bat with bazaar 1.3.1

Actions #6

Updated by Charles L over 16 years ago

This is, I believe, related to the parsing that ruby does of the command line strings. If it doesn't see any redirections etc, it saves on using the shell to launch the process, and instead does its own PATH search, and then exec.

Apparently its not appropriately doing that PATH search, probably not taking into account PATHEXT. This can be seen in an irb session:

# straight forward command line - ruby will exec itself, but not find the file.
>> IO.popen('gem list')
Errno::ENOEXEC: Exec format error - gem list
        from (irb):4:in `popen'
        from (irb):4
        from :0
# using explicit extension - ruby will exec itself, and find the batch file
>> IO.popen('gem.bat list')
=> #<IO:0x28da854>
# with a redirection - ruby offloads to the shell, which will find gem.bat
>> IO.popen('gem list > x')
=> #<IO:0x28d7a78>
# note that when using the shell, non-existent files don't raise Errno::ENOEXEC,
# instead the cmd.exe has a whinge...
?> IO.popen('nonexistent list > x')
=> #<IO:0x28d09bc>
>> 'nonexistent' is not recognized as an internal or external command,
operable program or batch file.

Basically the solution then is either

  1. Use an explicit extension - bzr.bat
  2. Actually get the shell to execute it, by either using some shell features like redirection, or explicitly using something like cmd /c

Unfortunately either of those options means that windows will need to be special cased (as the command would no longer run on linux).

Actions #7

Updated by Toshi MARUYAMA almost 14 years ago

  • Status changed from New to Closed

Svn trunk r4795 adds a feature of configurable path of executable for scm adapters (#7517).

http://launchpad.net/bzr/2.2/2.2.3/+download/bzr-2.2.3-setup.exe has bzr.exe.

Actions

Also available in: Atom PDF