我正在配置redmine以从关联的git存储库中提取提交历史记录。我已经设置了一个本地镜像。我有项目设置中定义的镜像路径>>存储库标签。但当我浏览项目的存储库选项卡时,我得到:
404
在存储库中找不到条目或修订版。
生产日志显示:
Started GET "/projects/allsaints/repository" for 108.58.11.138 at 2013-03-24 17:51:27 -0400
Processing by RepositoriesController#show as HTML
Parameters: {"id"=>"allsaints"}
[1m[35m (0.1ms)[0m SELECT MAX(`settings`.`updated_on`) AS max_id FROM `settings`
[1m[36mUser Load (0.1ms)[0m [1mSELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 1 AND (users.status = 1) LIMIT 1[0m
Current user: Shawn (id=1)
[1m[35mProject Load (0.1ms)[0m SELECT `projects`.* FROM `projects` WHERE `projects`.`identifier` = 'allsaints' LIMIT 1
[1m[36mRepository Load (0.1ms)[0m [1mSELECT `repositories`.* FROM `repositories` WHERE `repositories`.`project_id` = 3 AND (is_default = 1) LIMIT 1[0m
Shelling out: '/usr/local/git/bin/git' '--git-dir' '/Library/WebServer/Sites/redmine2/extra/repositories/allsaints.git/' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--date=iso' '--pretty=fuller' '--no-merges' '-n' '1'
[1m[35m (0.2ms)[0m BEGIN
[1m[36m (0.7ms)[0m [1mUPDATE `repositories` SET `root_url` = '/Library/WebServer/Sites/redmine2/extra/repositories/allsaints.git/', `extra_info` = '---\nextra_report_last_commit: \'0\'\n' WHERE `repositories`.`type` IN ('Repository::Git') AND `repositories`.`id` = 21[0m
[1m[35m (0.1ms)[0m COMMIT
Shelling out: '/usr/local/git/bin/git' '--git-dir' '/Library/WebServer/Sites/redmine2/extra/repositories/allsaints.git/' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
[1m[36mEnabledModule Load (0.2ms)[0m [1mSELECT name FROM `enabled_modules` WHERE `enabled_modules`.`project_id` = 3[0m
Shelling out: '/usr/local/git/bin/git' '--git-dir' '/Library/WebServer/Sites/redmine2/extra/repositories/allsaints.git/' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'ls-tree' '-l' 'HEAD:'
Rendered common/error.html.erb within layouts/base (0.3ms)
[1m[35mUserPreference Load (0.2ms)[0m SELECT `user_preferences`.* FROM `user_preferences` WHERE `user_preferences`.`user_id` = 1 LIMIT 1
[1m[36mSQL (0.4ms)[0m [1mSELECT `members`.`id` AS t0_r0, `members`.`user_id` AS t0_r1, `members`.`project_id` AS t0_r2, `members`.`created_on` AS t0_r3, `members`.`mail_notification` AS t0_r4, `projects`.`id` AS t1_r0, `projects`.`name` AS t1_r1, `projects`.`description` AS t1_r2, `projects`.`homepage` AS t1_r3, `projects`.`is_public` AS t1_r4, `projects`.`parent_id` AS t1_r5, `projects`.`created_on` AS t1_r6, `projects`.`updated_on` AS t1_r7, `projects`.`identifier` AS t1_r8, `projects`.`status` AS t1_r9, `projects`.`lft` AS t1_r10, `projects`.`rgt` AS t1_r11, `roles`.`id` AS t2_r0, `roles`.`name` AS t2_r1, `roles`.`position` AS t2_r2, `roles`.`assignable` AS t2_r3, `roles`.`builtin` AS t2_r4, `roles`.`permissions` AS t2_r5, `roles`.`issues_visibility` AS t2_r6 FROM `members` LEFT OUTER JOIN `projects` ON `projects`.`id` = `members`.`project_id` LEFT OUTER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` LEFT OUTER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` WHERE `members`.`user_id` = 1 AND (projects.status<>9) ORDER BY projects.name[0m
[1m[35m (0.2ms)[0m SELECT COUNT(DISTINCT `versions`.`id`) FROM `versions` LEFT OUTER JOIN `projects` ON `projects`.`id` = `versions`.`project_id` WHERE (projects.id = 3 OR (projects.status <> 9 AND ( versions.sharing = 'system' OR (projects.lft >= 1 AND projects.rgt <= 2 AND versions.sharing = 'tree') OR (projects.lft < 1 AND projects.rgt > 2 AND versions.sharing IN ('hierarchy', 'descendants')) OR (projects.lft > 1 AND projects.rgt < 2 AND versions.sharing = 'hierarchy'))))
[1m[36mWiki Load (0.1ms)[0m [1mSELECT `wikis`.* FROM `wikis` WHERE `wikis`.`project_id` = 3 LIMIT 1[0m
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM `boards` WHERE `boards`.`project_id` = 3
Completed 404 Not Found in 108ms (Views: 40.1ms | ActiveRecord: 2.7ms)
我的理解是,通过检查production.log的所有者,可以验证运行哪个用户redmine。采用任何这些Shelling out:条目,剥离单引号并运行生成的命令,就像该用户产生正确的输出一样。
为什么404错误?
答案 0 :(得分:1)
这确实是权限问题。默认情况下,乘客已启用user switching,以便rails应用程序运行config/environment.rb
的所有者。绊倒我的是应用程序没有继承该用户的所有组成员身份,而是默认情况下将该组显式设置为该用户的主要组。我正在使用组权限来访问这些文件。将PassengerGroup指令插入到明确设置正确组的此站点的虚拟主机块中为我解决了这个问题。
答案 1 :(得分:0)
我遇到了同样的问题,这是许可问题。 您应该将存储库移动到另一个位置,例如/tmp/xxx.git我在我的主目录中给了存储库的完全权限,但是我收到错误,因为redmine无法读取我的主目录。