Project

General

Profile

Actions

Defect #2294

closed

Problems displaying repository files and diffs

Added by Dave Winzler over 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
Administration
Target version:
-
Start date:
2008-12-07
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

I just upgraded to redmine 0.8RC1, and I've lost the ability to look at files in the repository, or diffs from the repository. It does display changesets, and the names of the affected files, but clicking on a filename or View differences, or diff results in the dread "The entry or revision was not found in the repository" error.

When migrating the database it told me I needed to upgraded to the Rails 2.1.2 gem, which I did.

I'm running on Mac OSX 10.5.5, Ruby 1.8.6, mysql 5.0.45.

The entry in the log when trying to view a file from the repository:

Processing RepositoriesController#entry (for 127.0.0.1 at 2008-12-07 14:18:44) [GET]
Session ID: 5c49c40d8bb784df097fbb58f0af6c4f
Parameters: {"rev"=>"862", "action"=>"entry", "id"=>"antics", "controller"=>"repositories", "path"=>["office", "oEnclosures.cgi"]}
Rendering template within layouts/base
Completed in 0.03646 (27 reqs/sec) | Rendering: 0.01483 (40%) | DB: 0.00960 (26%) | 500 Internal Server Error [http://redmine/repositories/entry/antics/office/oEnclosures.cgi?rev=862]

Actions #1

Updated by Dave Winzler over 15 years ago

One more thing: running under passenger 2.0.5.

Thanks!

Actions #2

Updated by Jean-Philippe Lang over 15 years ago

Could you provide the following information please:
  • SCM used (including version)
  • Redmine version you upgraded from
  • and last (but not least) the log with log level set to debug (see config/environment.rb)

Thanks

Actions #3

Updated by Dave Winzler over 15 years ago

SCM used (including version):
Mercurial 1.0.2
Redmine version you upgraded from:
2008-07-06 v0.7.3
and last (but not least) the log with log level set to debug (see config/environment.rb)

Processing RepositoriesController#diff (for 127.0.0.1 at 2008-12-08 17:48:20) [GET]
Session ID: 6673efe7f7e6666aae3432bf182740c6
Parameters: {"rev"=>"298", "action"=>"diff", "id"=>"sweete", "controller"=>"repositories", "path"=>[]}
[4;35;1mSQL (0.000532)[0m [0mSELECT max(`settings`.updated_on) AS max_updated_on FROM `settings` [0m
[4;36;1mUser Load (0.001037)[0m [0;1mSELECT * FROM `users` WHERE (`users`.`id` = 3) AND (users.status = 1) [0m
[4;35;1mProject Load (0.000870)[0m [0mSELECT * FROM `projects` WHERE (`projects`.`identifier` = 'sweete') LIMIT 1[0m
[4;36;1mRepository Load (0.000754)[0m [0;1mSELECT * FROM `repositories` WHERE (`repositories`.project_id = 3) LIMIT 1[0m
[4;35;1mEnabledModule Load (0.000698)[0m [0mSELECT * FROM `enabled_modules` WHERE (`enabled_modules`.project_id = 3) [0m
[4;36;1mUserPreference Load (0.000552)[0m [0;1mSELECT * FROM `user_preferences` WHERE (`user_preferences`.user_id = 3) LIMIT 1[0m
Cached fragment hit: views/repositories/diff/3/4fa023df94b109151b1051d48b0d48ab (0.00002)
Shelling out: hg -R 'file:///Users/dave/Sites/sweetenergy//' diff -r 297 -r 298 --nodates
Rendering template within layouts/base
[4;35;1mSQL (0.000868)[0m [0mSELECT count(DISTINCT `members`.id) AS count_all FROM `members` LEFT OUTER JOIN `projects` ON `projects`.id = `members`.project_id LEFT OUTER JOIN `roles` ON `roles`.id = `members`.role_id WHERE (`members`.user_id = 3 AND (projects.status=1)) [0m
[4;36;1mProject Load Including Associations (0.001953)[0m [0;1mSELECT `projects`.`id` AS t0_r0, `projects`.`name` AS t0_r1, `projects`.`description` AS t0_r2, `projects`.`homepage` AS t0_r3, `projects`.`is_public` AS t0_r4, `projects`.`parent_id` AS t0_r5, `projects`.`projects_count` AS t0_r6, `projects`.`created_on` AS t0_r7, `projects`.`updated_on` AS t0_r8, `projects`.`identifier` AS t0_r9, `projects`.`status` AS t0_r10, `parents_projects`.`id` AS t1_r0, `parents_projects`.`name` AS t1_r1, `parents_projects`.`description` AS t1_r2, `parents_projects`.`homepage` AS t1_r3, `parents_projects`.`is_public` AS t1_r4, `parents_projects`.`parent_id` AS t1_r5, `parents_projects`.`projects_count` AS t1_r6, `parents_projects`.`created_on` AS t1_r7, `parents_projects`.`updated_on` AS t1_r8, `parents_projects`.`identifier` AS t1_r9, `parents_projects`.`status` AS t1_r10 FROM `projects` LEFT OUTER JOIN `projects` parents_projects ON `parents_projects`.id = `projects`.parent_id INNER JOIN members ON projects.id = members.project_id WHERE ((`members`.user_id = 3) AND ((projects.status=1))) [0m
Rendered layouts/_project_selector (0.00716)
[4;35;1mSQL (0.000490)[0m [0mSELECT count() AS count_all FROM `versions` WHERE (`versions`.project_id = 3) [0m
[4;36;1mWiki Load (0.000507)[0m [0;1mSELECT * FROM `wikis` WHERE (`wikis`.project_id = 3) LIMIT 1[0m
[4;35;1mSQL (0.000352)[0m [0mSELECT count(
) AS count_all FROM `boards` WHERE (`boards`.project_id = 3) [0m
Completed in 0.03475 (28 reqs/sec) | Rendering: 0.01491 (42%) | DB: 0.00861 (24%) | 500 Internal Server Error [http://redmine/repositories/diff/sweete?rev=298]

Actions #4

Updated by Marek Pułczyński over 15 years ago

Same here but with svn.

Actions #5

Updated by Jean-Philippe Lang over 15 years ago

Thanks. And what does this command gives when you run it from your Redmine server:

hg -R 'file:///Users/dave/Sites/sweetenergy//' diff -r 297 -r 298 --nodates
Actions #6

Updated by Dave Winzler over 15 years ago

Thanks, Jean-Philippe. It outputs this:

--- a/cgi-bin/a_lib.pm
+++ b/cgi-bin/a_lib.pm
@@ -1714,7 +1714,7 @@

     my $date = shift;
     my($m, $d, $y) = split '/', $date;
-    return 0 unless $m and $d and $y;                            # 9/28/04 check for bad dates
+    return 0 unless $m>0 and $d>0 and $y>0;                        # 9/28/04 check for bad dates
     $y += 1900 if $y < 1900;                                    # 1/19/05 handle unix years

     my($M, $D, $Y) = split '/', today();
@@ -2615,7 +2615,7 @@

 #------------------------------------------------------------------------
 #                                                    getCouponDescription
-# 
+# 12/07/08 now handles multi-level coupons
 #------------------------------------------------------------------------
 sub getCouponDescription {

@@ -2623,75 +2623,137 @@

     chomp $couponLine;

-    my($code, $startDate, $endDate, $minOrder, $discount, $freestock) = split "\t", $couponLine;
-
-    if ($freestock eq 'FJA-F') {
-        $freestock = 'Sample of our best Apricots';
-    }
-        
-    my $text;
-    if ($discount) {
-        $discount = dollarOf($discount) unless $discount =~ m/\%/;
-        $text .= "Get $discount off your order";
-    }
-    elsif ($freestock) {
-        $text .= "Get a free $freestock";
-    }

[going on for 1300+ lines, ending with]

+    return strtoupper(substr($text, 0, 1)) . substr($text, 1) . $good;
+    
+}
+
+
 ?>
\ No newline at end of file
Actions #7

Updated by Jean-Philippe Lang over 15 years ago

It looks fine. Can you check that the user that runs redmine has read access on your repository?

Actions #8

Updated by Dave Winzler over 15 years ago

The repository is world-readable, so redmine should be able to read it. Actually, redmine CAN read it, since the repository tab displays the latest changesets, and clicking on a changeset displays the files in it. It's only when I try to see the differences that I run into problems.

This is on a Mac, if that makes a difference.

Thanks for looking into this,

- d
Actions #9

Updated by Jean-Philippe Lang over 15 years ago

redmine CAN read it, since the repository tab displays the latest changesets, and clicking on a changeset displays the files in it.

Changesets and files changes are stored in the database, that's why they are properly displayed.

Actions #10

Updated by Dave Winzler over 15 years ago

Changesets and files changes are stored in the database, that's why they are properly displayed.

OK, that makes sense then. Anyway, the repository is world-readable, and nothing has changed on the repository end since Redmine 0.7.3. Any ideas why 0.8 is having problems with it? Anything else I can check on my end?

Actions #11

Updated by Jean-Philippe Lang over 15 years ago

To see what happens when redmine calls hg:

  • apply this patch in order to capture hg errors:
Index: lib/redmine/scm/adapters/abstract_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/abstract_adapter.rb    (revision 2094)
+++ lib/redmine/scm/adapters/abstract_adapter.rb    (working copy)
@@ -172,7 +172,7 @@
         def self.shellout(cmd, &block)
           logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
           begin
-            IO.popen(cmd, "r+") do |io|
+            IO.popen("#{cmd} 2>#{RAILS_ROOT}/log/scm.stderr.log", "r+") do |io|
               io.close_write
               block.call(io) if block_given?
             end
  • clear tmp/cache directory of the app
  • restart the app
  • try to browse or display a diff and see what you've got in log/scm.stderr.log
Actions #12

Updated by Dave Winzler over 15 years ago

Bingo, that showed me that HG_BIN wasn't set correctly. Now that I fixed that path it's working like a charm!

Thanks for all your help, Jean-Philippe!

Actions #13

Updated by Jean-Philippe Lang over 15 years ago

  • Status changed from New to Closed
  • Affected version (unused) deleted (0.8.0-RC1)

OK, thanks for the feedback.

Actions #14

Updated by JANIAUT Valentin about 15 years ago

I had the same problem, and I applied the patch and I get the following output :

Traceback (most recent call last):
File "/home/valeuf/bin/hg", line 11, in ?
from mercurial import demandimport; demandimport.enable()
ImportError: No module named mercurial

Any Idea ?

Actions

Also available in: Atom PDF