Defect #6114
closedEmpy repository screen
100%
Description
I recently switch Redmine from one server to another and updated it to 1.0.0-RC. This also involved moving the git repositories around.
One the new server I deleted the repository from the project in Redmine and verified in the DB that the records were gone and the links on the issue pages are no longer present.
I then relocated the git repository and re-added it to the project.
I then ran rake redmine:fetch_changesets to bring all the changes back into Redmine.
However when I visit the main "repository" page by clicking the link in the top links section, which takes me to http://10.80.89.174:40000/projects/panasonic/repository, I get a blank redmine page with the error notification:
"The entry or revision was not found in the repository."
instead of the overview page.
However the records are in the DB and the links appear on the issues page. If I click a commit link from an issue then I go to the correct repository page for that commit and everything works fine.
It is only the overview page with no parameters that fails.
Updated by Felix Schäfer over 14 years ago
- Priority changed from High to Normal
Jeffrey Jones wrote:
Possibly related to #5268?
What could an error on the repository page possibly have to do with some OpenID stuff?
Anyway, make sure your permissions are correct, I would suppose you see revisions because they are cached but not the repository page in itself because it tries to refresh the changesets beforehand (and fails due to permission mismatches). Can you show the content of a file from the repository in redmine?
Updated by Jeffrey Jones over 14 years ago
Transposed the numbers; meant to say #5628.
Will double check permissions.
Updated by Jeffrey Jones over 14 years ago
Did some checking:
I cannot see the repository main page
I cannot see the contents of a file
I cannot see the diff of a file
The repositories are stored in /var/repositories
/var/repositories and all sub-folders / files are owned by apache:apache and the with permissions set at 755
drwxr-xr-x 5 apache apache 4096 Aug 12 09:54 repositories
However I still cannot see the contents of the git repos.
I am running Redmine using Phusion Passenger on Apache.
I am stumped
Updated by Jeffrey Jones over 14 years ago
production.log file if it is of any use.
Processing RepositoriesController#diff (for 10.80.89.170 at 2010-08-13 13:22:13) [GET] Parameters: {"rev"=>"050883aac9524c59f4885f09dac714da00262795", "action"=>"diff", "id"=>"*****", "path"=>["db", "migrate", "20100618071926_create_*****.rb"], "controller"=>"repositories"} Rendering template within layouts/base Completed in 61ms (View: 32, DB: 8) | 500 Internal Server Error [http://10.80.89.174/projects/*****/repository/revisions/050883aac9524c59f4885f09dac714da00262795/diff/db/migrate/20100618071926_create_*****.rb]
I wasn't expecting a 500 error. I will try in Dev
Updated by Jeffrey Jones over 14 years ago
changed log level to debug, the
Shelling out: git --git-dir '/var/repositories/panasonic/' ls-tree -l '050883aac9524c59f4885f09dac714da00262795:app/controllers'
Works fine when I do it myself from the command-line using a normal user in the same group as apache.
Still get the
ompleted in 50ms (View: 24, DB: 5) | 500 Internal Server Error [http://10.80.89.174/projects/*****/repository/revisions/050883aac9524c59f4885f09dac714da00262795/diff/db/migrate/20100618071926_create_*****.rb]
Updated by Jeffrey Jones over 14 years ago
Maybe the git shell output will help?
git version 1.7.2 (Latest stable)
bash-3.2$ git --git-dir '/var/repositories/*****/' ls-tree -l '050883aac9524c59f4885f09dac714da00262795:app/controllers' 100644 blob 8b35ac1f7f5f3e32199e5ef0b1452da7dcc3f807 926 application_controller.rb 100644 blob fc5f0ad39db07ed02c63c7aabbf69b4a841794ff 222 home_controller.rb 100644 blob 814a1ff07447601dacc977107366997714d200db 866 leaflets_controller.rb 100644 blob fc7e078b1b2f93a906447901b348556d16cdd92f 2563 logos_controller.rb 100644 blob 5829af70a1110a4e9155dfd0aa603c4efff89e0d 2035 orders_controller.rb 100644 blob 2193db82b701ef62f246f080887df083bc5a7a7e 216 previews_controller.rb 100644 blob d9dff750634014dee34c04d811236997ab79622e 4328 prices_controller.rb 100644 blob 5faf14b3c63fe562f7dc344eb0e9eec3f659f4df 2108 users_controller.rb
Updated by Felix Schäfer over 14 years ago
Passenger apps do not necessarily run as the same user as apache, check the passenger docs for more info (you could inspect the process list to find out what user redmine is run as).
Updated by Jeffrey Jones over 14 years ago
I did have it before so that the repo directories were owned by the redmine user (member of the apache group) that owned the redmine web-app files but that didn't work either IIRC.
Cannot check until Monday now; will double check when I get back.
Updated by Jeffrey Jones over 14 years ago
I turned off passenger user switching and set the default as apache, still nothing. I turned user switching back on and set the /var/repositories tree to be owned by redmine (the user the redmine rails process is running under). Still nothing.
Does Redmine have any extra debugging output I can look at? I have tried running in Dev mode but I still get nothing useful about what could be causing the trouble. Could it be a problem with incompatibility with the latest git version (1.7.2)?
Updated by Toshi MARUYAMA over 14 years ago
Such as db/migrate, redmine has performance problem in many files per direcroty.
Try http://www.redmine.org/attachments/3272/git-fast-browse.patch in #4773.
Updated by Jeffrey Jones over 14 years ago
Hello Maruyama-san,
I don't think that is the problem, this is a small project with a small number of files.
I tried your change but that didn't fix the problem but thank you for the suggestions.
Updated by Toshi MARUYAMA over 14 years ago
What happens with Webrick?
In redmine directory, $ ruby script/server -e "YOUR ENV (ex. development)".
Updated by Jeffrey Jones over 14 years ago
Aha, good idea!...Yes, that works in Webrick.
If I su to the redmine user and run webrick then the repository listing works perfectly and I can see individual files and diffs.
Updated by Toshi MARUYAMA over 14 years ago
Is git in your PATH?
For apache you can use "SetEnv" in apache conf file.
Updated by Toshi MARUYAMA over 14 years ago
For example in apache conf file.
SetEnv PATH "/git-dir:${PATH}"
Updated by Jeffrey Jones over 14 years ago
hmm, that would explain why the update fetch_changeset cron jobs work but the site doesn't.
I added the SetEnv to the apache conf file (I am using centos and compiled git, the path is /usr/local/bin/git) but that didn't make a difference.
Updated by Toshi MARUYAMA over 14 years ago
Did you restart apache?
# /etc/init.d/httpd restart
Updated by Toshi MARUYAMA over 14 years ago
I use Fedora 12, and I have no trouble.
$ rpm -qf /usr/bin/git git-1.7.2.1-2.fc12.i686
Updated by Jeffrey Jones over 14 years ago
Yes I restarted apache.
Maybe of note: Passenger is 2.2.15
Updated by Toshi MARUYAMA over 14 years ago
Do you set "file///GIT-BARE-REPO" in redmine?
You don't need to use "file://". And you should set "/GIT-BARE-REPO".
Updated by Jeffrey Jones over 14 years ago
Yep, all repositories are bare repos and the path specified in redmine is
/var/repositories/name-of-repository
Updated by Toshi MARUYAMA over 14 years ago
To use development env, redmine generate #{RAILS_ROOT}/log/scm.stderr.log.
See source:tags/1.0.0/lib/redmine/scm/adapters/abstract_adapter.rb#L184 .
Updated by Jeffrey Jones over 14 years ago
Aha! I found the output in the /var/log/httpd/error_log file.
sh: git: command not found
So yes, it cannot find git even though it has been set in the apache configuration file.
Updated by Felix Schäfer over 14 years ago
Set the full path of the git binary here source:/trunk/lib/redmine/scm/adapters/git_adapter.rb#L25, that should work.
Updated by Jeffrey Jones over 14 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Excellent, that did the trick. Still wondering why it couldn't find git but I don't really have time to investigate. Ach well.
Updated by Felix Schäfer over 14 years ago
- Status changed from Resolved to Closed