Mercurial / Redmine - 访问存储库时出现404错误

时间:2012-01-10 23:47:30

标签: mercurial redmine

希望这对有经验的人来说是一个快速解决方案!

我刚刚完成在我的共享hostgator服务器上安装Mercurial和Redmine到Redmine和Mercurial文档的tee,但是遇到了一个小问题。 Mercurial完美地工作,我能够创建一个仓库,克隆它,并同步到它没有任何问题,除非我将回购添加到Redmine并转到存储库选项卡,我得到404错误。我确保仔细检查我是否从根目录开始设置目录,但它不起作用。我尝试了多种不同的方式来编写目录,但仍然没有运气。我最后打开了我的production.log,这是每次收到404错误时写入的条目。

Processing RepositoriesController#show (for 74.56.***.*** at 2012-01-10 13:59:43) [GET]
  Parameters: {"action"=>"show", "id"=>"testhg1", "controller"=>"repositories"}
hg: error during getting info: hg exited with non-zero status: 255
hg: error during getting info: hg exited with non-zero status: 255
Rendering template within layouts/base
Rendering common/error (404)
Completed in 280ms (View: 12, DB: 2) | 404 Not Found [http://redmine.mydomain.org/projects/testhg1/repository]

对此的任何帮助将不胜感激!谢谢!

2 个答案:

答案 0 :(得分:2)

我们在Centos 6.3服务器上遇到了同样的错误。 在我们的案例中,我们在/var/log/httpd/error_log

中也收到了以下错误
abort: requirement 'dotencode' not supported!

我们使用RhodeCode创建了我们的存储库,RhodeCode使用的是更新版本的mercurial(2.3.2)而不是CentOS 6.3(1.4)附带的版本。使用repoforge中的预构建RPM更新系统上的mercurial版本解决了这个问题。可以从CentOS上的yum获得的极其旧版本的mercurial不支持较新的2.3.2 Mercurial正在使用的dotencode功能。

答案 1 :(得分:0)

进入开发模式以获得更好的日志记录:

Processing RepositoriesController#show (for ***.***.***.*** at 2012-03-15 22:54:47) [GET]
  Parameters: {"action"=>"show", "id"=>"go", "controller"=>"repositories"}
  Setting Columns (0.9ms)   SHOW FIELDS FROM `settings`

... more unimportant queries ...

  Repository::Mercurial Columns (0.7ms)   SHOW FIELDS FROM `repositories`
Shelling out: '/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhsummary'
hg: error during getting info: hg exited with non-zero status: 255
Shelling out: '/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhmanifest' '-r' 'tip' ''
Rendering template within layouts/base
Rendering common/error (404)

因此错误似乎与此命令有关:

'/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhsummary'

在我运行时工作正常

root@redacted:/var/www/corp/redmine# '/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhsummary'

... returns XML that S. O. doesn't want to show ...
(if you know how to fix this, please edit)







但我的网络服务器以www-data运行,无法访问hg dir

root@redacted:/var/www/corp/redmine# sudo su - www-data
$ '/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhsummary'
abort: repository /var/lib/hg/godc not found!
$ ls -l /var/lib/hg
ls: cannot open directory /var/lib/hg: Permission denied
$

让我的www-data用户访问repo,命令现在可以正常工作:

$ groups
www-data hg
$ '/usr/bin/hg' '-R' '/var/lib/hg/godc' '--encoding' 'utf-8' '--config' 'extensions.redminehelper=/var/www/corp/redmine/lib/redmine/scm/adapters/mercurial/redminehelper.py' '--config' 'diff.git=false' 'rhsummary'

... returns XML that S. O. doesn't want to show ...








$

在redmine上测试它仍然出现错误,但是当我重新启动apache时,一切都应该如此。

(我正在使用喷射乘客。)

升级结果是一个红色的鲱鱼,导致这种情况的实际原因是从脚本/服务器作为我的用户(具有回购访问权限)运行到正确安装的错误乘客生产实例。

在您的情况下,假设您的$ host / month hostgator共享服务器安装,我确信您无权修改权限,但您可以使用我描述的过程来尝试确定问题。我对hostgator的安装知之甚少,但似乎你可能遇到同样的问题。

相关问题