Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3752 closed defect (fixed)

Unable to browse source in sub project

Reported by: andreas.l@… Owned by: Christian Boos
Priority: normal Milestone: 0.9.7
Component: version control Version: 0.9.6
Severity: major Keywords: browse source timeline error
Cc: daniel.l@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Config We have a problem browsing the source on one of our sub projects. Currently we are running subversion with just one repository and all projects are stored in a hierarki. There are multiple Trac-config and just one Trac-installation. We are running:

  • Apache/2.0.58 (Win32)
  • SVN/1.4.0
  • DAV/2
  • mod_auth_sspi/1.0.4
  • mod_ssl/2.0.58
  • OpenSSL/0.9.8b
  • mod_python/3.2.8
  • Python/2.3.5

Problem During the night, access via Trac to the source is lost. When pressing "Browse source" the following error message is shown:

Trac detected an internal error:
list.index(x): x not in list

Same thing happens when clicking on Timeline

(Python traceback for both errors is attached to this ticket)

Temporary workaround In trac.ini the following line defines the path to the project:

repository_dir = d:/www/svn/repository/customer/project/subproject/

d:/www/svn/repository is the path to the repository directory. In order to get it working temporarily i just delete "/customer/project/subproject/" and saves the ini-file. Browsing will now work although all customer's projects are now visible. Changing it back to "d:/www/svn/repository/customer/project/subproject/", the system then works as it intended to. The ini-file is exactly the same as before but the system is running without a problem until the next day. (I am not sure for how many hours the system is working but it is always broken in the morning.)

Attachments (5)

trac_error.txt (2.5 KB ) - added by andreas.l@… 18 years ago.
Python traceback
trac_error2.txt (1.4 KB ) - added by andreas.l@… 18 years ago.
Python dump
cache.py (6.3 KB ) - added by andreas.l@… 18 years ago.
Modified cache.py
trac_error3.txt (1.4 KB ) - added by andreas.l@… 18 years ago.
Python dump
svn_fs.py (19.0 KB ) - added by andreas.l@… 18 years ago.
Modified svn_fs.py

Download all attachments as: .zip

Change History (13)

by andreas.l@…, 18 years ago

Attachment: trac_error.txt added

Python traceback

comment:1 by Christian Boos, 18 years ago

Component: generalversion control
Milestone: 0.9.7
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalmajor

Can you try out this patch?

Index: trac/versioncontrol/cache.py
===================================================================
--- trac/versioncontrol/cache.py	(revision 3387)
+++ trac/versioncontrol/cache.py	(working copy)
@@ -71,7 +71,10 @@
             self.log.info("Syncing with repository (%s to %s)"
                           % (youngest_stored, self.repos.youngest_rev))
             if youngest_stored:
-                current_rev = self.repos.next_rev(youngest_stored)
+                try:
+                    current_rev = self.repos.next_rev(youngest_stored)
+                except ValueError:
+                    current_rev = int(youngest_stored) + 1 # for scoped repos.
             else:
                 try:
                     current_rev = self.repos.oldest_rev

In any case, support for scoped repositories has much improved since 0.9, so if you use this setup intensively as it seems, you should consider upgrading to 0.10.

comment:2 by andreas.l@…, 18 years ago

Thank you for your quick response!

I have tried the patch. I am not exactly sure how I should apply it so I modified the file C:\Apache\Python\Lib\site-packages\trac\versioncontrol\cache.py. Was this correct?

The temp solution seems to have worked only for a short period of time today since the problem has already appeared again. After applying the patch there was no difference. I can try the temporary solution again and se for how long it holds. Attached is the error message and modified cache.py.

by andreas.l@…, 18 years ago

Attachment: trac_error2.txt added

Python dump

by andreas.l@…, 18 years ago

Attachment: cache.py added

Modified cache.py

comment:3 by Christian Boos, 18 years ago

Ok, here's another attempt:

Index: svn_fs.py
===================================================================
--- svn_fs.py	(revision 3387)
+++ svn_fs.py	(working copy)
@@ -308,9 +308,12 @@
             return rev + 1
         if rev == 0:
             return self.oldest_rev
-        idx = self.history.index(rev)
-        if idx > 0:
-            return self.history[idx - 1]
+        try:
+            idx = self.history.index(rev)
+            if idx > 0:
+                return self.history[idx - 1]
+        except ValueError:
+            return rev + 1 # for scoped repos.
         return None
 
     def rev_older_than(self, rev1, rev2):

(you can either leave the other change in place or revert it)

comment:4 by andreas.l@…, 18 years ago

I am afraid it didn't help. I will try temp solution again to se if there is a difference. Attached is error log and sv_fs.py

by andreas.l@…, 18 years ago

Attachment: trac_error3.txt added

Python dump

by andreas.l@…, 18 years ago

Attachment: svn_fs.py added

Modified svn_fs.py

comment:5 by Christian Boos, 18 years ago

Looks like you didn't reinstall the modified svn_fs.py

comment:6 by andreas.l@…, 18 years ago

Ok, forgot to restart apache i guess. It's done now and I'll get back to you weather it worked or not.

comment:7 by andreas.l@…, 18 years ago

The system seems to be stable now. The second patch seems to have done the trick.

Thank you very much for a great support! We are looking forward to using the system for long time.

comment:8 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

You're welcome. However support for 0.9.x won't last forever… even if I scheduled the fix for 0.9.7, it's not guaranteed that a 0.9.7 release will ever be made; that will happen only if there's a critical security fix to be released.

Patch applied as r3757.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.