简体   繁体   中英

Redmine Project Repository 404 Error

I am configuring redmine to pull commit histories from an associated git repository. I have set up a local mirror. I have the path to the mirror defined in the project settings >> repository tab. But when I browse to the project's repository tab I get:

404

The entry or revision was not found in the repository.

The production log shows:

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)

My understanding is that one can verify which user redmine is running as by checking the owner of production.log. Taking any of these Shelling out: entries, stripping the single quotes and running the resulting command as as that user results in proper output.

So why the 404 error?

This was indeed a permissions problem. Passenger has user switching enabled by default so that the rails application runs the owner of config/environment.rb . What tripped me up was the application did not inherit all the group memberships of that user but rather the group by default is explicitly set to the primary group of that user. I am using group permissions for access to these files. Inserting a PassengerGroup directive into the Virtual Host block for this site that explicitly set the proper group resolved this problem for me.

I've got the same issue, it is the permission issue. You should move the repository to another location such as /tmp/xxx.git I gave full permission to repository in my home directory, but I got error because redmine can not read my home directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM