Edgewall Software

Ticket #3752 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Unable to browse source in sub project

Reported by: andreas.l@… Owned by: cboos
Priority: normal Milestone: 0.9.7
Component: version control Version: 0.9.6
Severity: major Keywords: browse source timeline error
Cc: daniel.l@…

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

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

Change History

Changed 2 years ago by andreas.l@…

Python traceback

Changed 2 years ago by cboos

  • owner changed from jonas to cboos
  • component changed from general to version control
  • severity changed from normal to major
  • milestone set to 0.9.7

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.

Changed 2 years ago by andreas.l@…

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.

Changed 2 years ago by andreas.l@…

Python dump

Changed 2 years ago by andreas.l@…

Modified cache.py

Changed 2 years ago by cboos

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)

Changed 2 years ago by andreas.l@…

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

Changed 2 years ago by andreas.l@…

Python dump

Changed 2 years ago by andreas.l@…

Modified svn_fs.py

Changed 2 years ago by cboos

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

Changed 2 years ago by andreas.l@…

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

Changed 2 years ago by andreas.l@…

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.

Changed 2 years ago by cboos

  • status changed from new to closed
  • resolution set to fixed

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.

Add/Change #3752 (Unable to browse source in sub project)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.