Project

General

Profile

Repository page (Git) shows 404 since upgrade to 1.2.1

Added by Martin Simons about 13 years ago

Hi everytbody,

we just upgraded a rather old Redmine installation to the latest version (Redmine 1.2.1.stable.7077).

Although everything appears to work just fine, when trying to view the repository tab for a Git repository the only output is a 404 stating

The entry or revision was not found in the repository.

Following output shows up in the log when requesting the page:

Processing RepositoriesController#show (for xxx.xxx.xxx.xxx at 2011-09-09 09:10:12) [GET]
  Parameters: {"action"=>"show", "id"=>"airlinesim", "controller"=>"repositories"}
  SQL (0.1ms)   SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings` 
  User Load (0.1ms)   SELECT * FROM `users` WHERE (`users`.`id` = 5) AND (users.status = 1) AND ( (`users`.`type` = 'User' OR `users`.`type` = 'AnonymousUser' ) ) 
  Project Load (0.1ms)   SELECT * FROM `projects` WHERE (`projects`.`identifier` = 'airlinesim') LIMIT 1
  Repository Load (0.1ms)   SELECT * FROM `repositories` WHERE (`repositories`.project_id = 1) LIMIT 1
Shelling out: '/usr/bin/git' '--git-dir' '/opt/git/airlinesim.git' 'branch' '--no-color'
  EnabledModule Load (0.1ms)   SELECT name FROM `enabled_modules` WHERE (`enabled_modules`.project_id = 1) 
Shelling out: '/usr/bin/git' '--git-dir' '/opt/git/airlinesim.git' 'ls-tree' '-l' 'HEAD:'
Rendering template within layouts/base
Rendering common/error (404)
  UserPreference Load (0.2ms)   SELECT * FROM `user_preferences` WHERE (`user_preferences`.user_id = 5) LIMIT 1
  Member Load Including Associations (0.2ms)   SELECT `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 (`members`.`id` = `member_roles`.`member_id`) LEFT OUTER JOIN `roles` ON (`roles`.`id` = `member_roles`.`role_id`) WHERE (`members`.user_id = 5 AND (projects.status=1)) ORDER BY projects.name
  SQL (0.1ms)   SELECT count(DISTINCT `versions`.id) AS count_all FROM `versions` LEFT OUTER JOIN `projects` ON `projects`.id = `versions`.project_id WHERE (projects.id = 1 OR (projects.status = 1 AND ( versions.sharing = 'system' OR (projects.lft >= 1 AND projects.rgt <= 6 AND versions.sharing = 'tree') OR (projects.lft < 1 AND projects.rgt > 6 AND versions.sharing IN ('hierarchy', 'descendants')) OR (projects.lft > 1 AND projects.rgt < 6 AND versions.sharing = 'hierarchy')))) 
  Wiki Load (0.1ms)   SELECT * FROM `wikis` WHERE (`wikis`.project_id = 1) LIMIT 1
  SQL (0.1ms)   SELECT count(*) AS count_all FROM `boards` WHERE (`boards`.project_id = 1) 
Completed in 99ms (View: 35, DB: 1) | 404 Not Found [http://xxx/projects/airlinesim/repository]

Similar threads suggest a permission issue concerning the repo location, but even setting it to 777 (for testing) didn't help so I guess that's not the cause. It might also we worth noting that the repository view for SVN-repositories is working just fine. Also I can view single (existing) Git revisions but I suppose that's only data from the database being displayed, not from Git directly.

Any idea what might be the problem here?


Replies (18)

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Oh, and forgot:

We upgraded from 0.8.1 (I think) and Redmine runs as a passenger modul in Apache.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Sounds like a different problem to me, but I don't know.

But the issue you linked to has been closed in 1.2.0 when I'm not mistaken, so it shouldn't occur anymore.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

You're right, this is not the same issue, sorry.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Another bit of information:

As mentioned above, I can still view a revision that Redmine already knows about.

Now I tried to view a revision which Redmine hasn't loaded yet and I get another 404. I tried this to figure out whether the problem was similar to #8256, but doesn't look like it.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Anybody?

Still the same problem and one of the most important features of Redmine is missing because of this. Does nobody have an idea what could be done about this? Am I the only one encountering this issue?

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by James Ang about 13 years ago

I also encountered the same using a fresh installation of v1.2.1 from truck and from stable branch.
Both have the same 404 issues with GIT repository.

Please help and advise.

Thks in adv.

James.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

You could try to run manually the command logged in the log file (Shelling out: '/usr/bin/git' '--git-dir' '/opt/git/airlinesim.git' 'ls-tree' '-l' 'HEAD:' here) to get more details?

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

This is what I get (run as the user that Redmine runs as):

sh-3.2$ '/usr/bin/git' '--git-dir' '/opt/git/airlinesim.git' 'ls-tree' '-l' 'HEAD:'
100644 blob c538fdbb1298d80c94f89d48d200aaeec9d01147    1187    .classpath
100644 blob ea8c4bf7f35f6f77f75d92ad8ce8349f6e81ddba       8    .gitignore
100644 blob 6e83ad499d19d31d679d06c31a7eefddf897bcdf    1179    .project
040000 tree 142cc4a8e2f86eed5d67d9f7f4cf0b825aa91981       -    .settings
100644 blob c631dc944f148fa8f7167fe7d27b794a062de3e7   34148    changelog.txt
100644 blob 27959b8cfdc6634aeafb20cda9b8b1165da271fc    4644    changelog_en.txt
040000 tree 1ed7e40dd1320eb0bea691e613bfe13269264404       -    config
040000 tree cb69eddbf171394facd60213495308708d4197a5       -    game
100644 blob f66bc4304b52e37ba030641a25695082c0fd8c59    9856    pom.xml
040000 tree 7f9787afd14aadd59c30a01c9a07b264eff8c09d       -    src

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

Is the administration "Autofetch commits" option enabled?

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Etienne Massip wrote:

Is the administration "Autofetch commits" option enabled?

Yes, option is enabled.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by James Ang about 13 years ago

Is it that we must point the GIT SCM to a bare repository?

Can it point to a working git repository where changes are committed to the same folder and RM is still able to see the changes in the Repository Tab?

Thanks

James.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

Right, you need a bare repo (see RedmineRepositories#Git-repository).

Don't know if that solve your 404 issue, though.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Martin Simons about 13 years ago

Since it was working before the upgrade an my repo is a bare one, I doubt that this is the cause of the issue.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

Are the contents of your changesets table up-to-date?

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by James Ang about 13 years ago

Hi,

the 404 problem has been solved by pointing to the .git folder of the cloned "normal" repository.
(i.e. git clone git://url <folder>)

Thus, I believe it need not be a bare repository.

Please correct me or advise what will goes wrong in using a normal repository.

Thanks in adv.

James.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by Etienne Massip about 13 years ago

I'm sorry, Toshi should be able to answer you best on this point, I don't use Git.

RE: Repository page (Git) shows 404 since upgrade to 1.2.1 - Added by James Ang about 13 years ago

Hi,

No need to apologies for such matters. (^^,)

The wiki might have to be amended to tell user to point to the .git folder for a full cloned repository in alternative Use-Case.

There is still the question if directly pointing to a working git repository will have any side-effect on Redmine to be investigated and reported for clarification.

Cheers~!

    (1-18/18)