Edgewall Software
Modify

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#2416 closed defect (fixed)

Trac internal error when parsing svn history

Reported by: tjb@… Owned by: Christian Boos
Priority: high Milestone: 0.9.3
Component: version control Version: 0.10.3.1
Severity: major Keywords: sync needinfo
Cc: tjb@… Branch:
Release Notes:
API Changes:

Description

I created a trac environment (our 4th) for a project, using the repository_dir directive in trac.ini to isolate the project to a subtree of our subversion repository.

When initialising the database, an error occurred.

("File not found: revision 2192, path '/modules/StandardDataFormat/libceatypes/Trunk/Implementation/type_handlers/cea_raw_param_type_handler.cpp'", 160013)

and then a message about cannot initialise trac environment.

Again, when accessing the trac environment from the browser, the same error occurred (pasted verbatim here form the browser)

Oops...
Trac detected an internal error:

("File not found: revision 2192, path '/modules/StandardDataFormat/libceatypes/Trunk/Implementation/type_handlers/cea_raw_param_type_handler.cpp'", 160013)

If you think this really should work and you can reproduce it. Then you should consider to report this problem to the Trac team.

Go to http://trac.edgewall.com/ and create a new ticket where you describe the problem, how to reproduce it. Don't forget to include the python traceback found below.

TracGuide — The Trac User and Administration Guide
Python traceback

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/web/modpython_frontend.py", line 206, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 139, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 107, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/web_ui/browser.py", line 114, in process_request
    self._render_directory(req, repos, node, rev)
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/web_ui/browser.py", line 146, in _render_directory
    changes = get_changes(self.env, repos, [i['rev'] for i in info])
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/web_ui/util.py", line 31, in get_changes
    changeset = repos.get_changeset(rev)
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/cache.py", line 40, in get_changeset
    self.sync()
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/cache.py", line 81, in sync
    for path,kind,action,base_path,base_rev in changeset.get_changes():
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/svn_fs.py", line 487, in get_changes
    change.base_path = fs.node_created_path(prev_root, path, pool())
SubversionException: ("File not found: revision 2192, path '/modules/StandardDataFormat/libceatypes/Trunk/Implementation/type_handlers/cea_raw_param_type_handler.cpp'", 160013)

I will obtain the subversion log for the relevant directory and attach it shortly.

Tony Butt CEA Technologies

Change History (22)

comment:1 by anonymous, 14 years ago

There is a directory move performed at revision 2192 that may have some bearing on the problem.

Our trac environment is:

Trac main branch at changeset:2569 Postgres 8.0.3 database backend Suse Enterprise Server Linux 9

If it will help, I can attach the trac.ini file too.

comment:2 by anonymous, 14 years ago

Component: generalversion control
Milestone: 0.9.1
Owner: changed from Jonas Borgström to anonymous
Status: newassigned

Ok, I see. I'm working on it.

comment:3 by Christian Boos, 14 years ago

Owner: changed from anonymous to Christian Boos
Priority: normalhigh
Status: assignednew

(forgot to login)

Tony, can you please try the following patch:

Index: trac/versioncontrol/svn_fs.py
===================================================================
--- trac/versioncontrol/svn_fs.py       (revision 2566)
+++ trac/versioncontrol/svn_fs.py       (working copy)
@@ -484,8 +484,10 @@
                     action = Changeset.ADD
             else:
                 action = Changeset.EDIT
-                change.base_path = fs.node_created_path(prev_root, path, pool())
-                change.base_rev = fs.node_created_rev(prev_root, path, pool())
+                change.base_path = fs.node_created_path(prev_root,
+                                                      change.base_path, pool())
+                change.base_rev = fs.node_created_rev(prev_root,
+                                                      change.base_path, pool())
             kind = _kindmap[change.item_kind]
             path = path[len(self.scope) - 1:]
             base_path = _scoped_path(self.scope, change.base_path)

Thanks!

comment:4 by Christian Boos, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk ([2570:2571]) and 0.9-stable (r2572).

comment:5 by tjb@…, 14 years ago

Resolution: fixed
Status: closedreopened

I tried the patch, and hit a similar problem at revision 2215. I tried recreating the environment from scratch, and still the same problem (at 2215). The output from trac-admin initenv follows:

# trac-admin initenv Test
 ... (normal output omitted)

 Indexing repository
Failed to initialize environment. ("File not found: revision 2215, path '/modules/StandardDataFormat/libceatypes/Trunk/Interface/xml_handlers/cea_array_1d_float_type_handler.hpp'", 160013)
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 577, in do_initenv
    repos.sync()
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/cache.py", line 81, in sync
    for path,kind,action,base_path,base_rev in changeset.get_changes():
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/svn_fs.py", line 490, in get_changes
    change.base_path, pool())
SubversionException: ("File not found: revision 2215, path '/modules/StandardDataFormat/libceatypes/Trunk/Interface/xml_handlers/cea_array_1d_float_type_handler.hpp'", 160013)

This is a different directory to the previous - svn log follows.

comment:6 by Christian Boos, 14 years ago

Status: reopenednew

Oops, sorry for the trouble … stupid mistake.

I'll fix it ASAP, in the meantime, simply exchange the order of the two lines, 489 and 490.

comment:7 by Christian Boos, 14 years ago

Status: newassigned

I hope everything is correct now with r2573. Please confirm and I'll port to 0.9-stable if there are no other issues with this.

comment:8 by Christian Boos, 14 years ago

Resolution: fixed
Status: assignedclosed

Ported in r2574.

comment:9 by anonymous, 14 years ago

I checked it first thing this morning - works fine now. Thanks for the quick work.

Sorry for the delay in testing the code, we are in a verydifferent timezone here, and your fixes were becoming available when I was at home at night, and could not tet until the following day.

Tony Butt
CEA Technologies, Canberra, Australia

comment:10 by anonymous, 14 years ago

Milestone: 0.9.10.9.2
Resolution: fixed
Status: closedreopened

I am using 0.9.2, which includes the fix of r2573, and I am getting essentially an identical traceback as the one shown above when trac parses the svn history. My relevant subversion changes are as follows:

rev 620 was a routine change to the trunk
rev 1239 deleted file "problem.py" from the current revision of the trunk
rev 1767 was a merge of a branch into the trunk
rev 1768 created a new branch from rev 620 of the trunk, but also included modifications to two files from revision 620, one of which was "problem.py"

When trac is parsing the svn history, I get the "file not found" error above, where the file not found is "problem.py". I don't have this problem with 0.8.4, using the same svn repository.

After an hour or so of debugging, I hacked the following patch into svn_fs.py and it solved the problem at least temporarily, though I'm not 100% confident that this is even a valid fix.

460c460,462
-         if self.rev > 0:
---
+         if self.rev == 1768:
+             prev_root = fs.revision_root(self.fs_ptr, 620, pool())
+         elif self.rev > 0:

comment:11 by Christian Boos, 14 years ago

Milestone: 0.9.20.9.3
Resolution: fixed
Status: reopenedclosed

Actually, r2573 was not enough, and subsequent changes where needed (a generalization of the fix you did, i.e. the prev_root must be created using the change.base_rev), see r2625.

Unfortunately, we were in a hurry for 0.9.2, and the fix didn't make it into that release.

While waiting for 0.9.3, you can try the latest of source:branches/0.9-stable

comment:12 by Christian Boos, 14 years ago

sigh, s/where/were/ in the above, and I need to know HowToMakeCoffee :)

comment:13 by anonymous, 14 years ago

Is it possible to release 0.9.3 faster, moving lower priority tickets to 0.9.4 so people don't have go to svn?

comment:14 by phuna, 12 years ago

Milestone: 0.9.30.10.4
Resolution: fixed
Status: closedreopened
Version: 0.90.10.3.1

I got the same problem, please see trace back below:

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 191, in dispatch
    chosen_handler = self._pre_process_request(req, chosen_handler)
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 263, in _pre_process_request
    chosen_handler = f.pre_process_request(req, chosen_handler)
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\api.py", line 73, in pre_process_request
    self.get_repository(req.authname) # triggers a sync if applicable
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\api.py", line 101, in get_repository
    repos = self._connector.get_repository(rtype, rdir, authname)
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\svn_fs.py", line 260, in get_repository
    crepos = CachedRepository(self.env.get_db_cnx(), repos, None, self.log)
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\cache.py", line 34, in __init__
    self.sync()
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\cache.py", line 91, in sync
    for path,kind,action,base_path,base_rev in changeset.get_changes():
  File "C:\Python24\Lib\site-packages\trac\versioncontrol\svn_fs.py", line 699, in get_changes
    cbase_path = fs.node_created_path(b_root, base_path, tmp())
  File "C:\Python24\Lib\site-packages\libsvn\fs.py", line 374, in svn_fs_node_created_path
    return apply(_fs.svn_fs_node_created_path, args)
SubversionException: ("File not found: revision 199, path '/dev/md/util/http.c'", 160013)

Please help, this is a quite urgent situation. Thanks in advance.

comment:15 by Christian Boos, 12 years ago

Keywords: sync added

Well, help us to help you ;-)

First, enable DEBUG level logging (see TracLogging). Then, perform again a resync and note the last version that was successfully cached (n). The revision which interest us is one ahead (n+1).

  • What's the output of svn log -v -r (n+1)?
  • Also, what's the output of svn log -v -r 199?
  • Finally, are you using a scoped repository path or not? (i.e. does the repository_dir point to your Subversion repository, or some levels "deeper"?)

comment:16 by Christian Boos, 12 years ago

Keywords: needinfo added
Milestone: 0.10.4

Not that urgent, apparently…

in reply to:  16 comment:17 by phuna, 12 years ago

Replying to cboos:

Not that urgent, apparently…

I'm sorry for my late. I track this Trac by using RSS, however I didn't see any changes. I've just read this ticket again this morning and saw that your answer was already here, maybe I made a mistake somewhere.

About your above guide, until now I cannot do it. That's because I don't have direct access to the Trac server. I can only access it using Windows's Remote Desktop Connection via VPN. This VPN connection keeps dropping all the time :(.

I'm asking my company's network admin to setup another way for me to connect to Trac server. So please wait, I'll back here ASAP.

Thank you very much for your help.

P/S: Sorry for my poor English

comment:18 by Christian Boos, 12 years ago

Milestone: 0.9.3
Resolution: fixed
Status: reopenedclosed

No feedback, closing again.

If someone has such an error again, please open a new ticket, giving the information specified in comment:15, thanks!

comment:19 by anonymous, 12 years ago

wth is milestone 0.10.3.1? you do not intend to confuse the people with a multitude of versions which get never released?

comment:20 by Christian Boos, 12 years ago

0.10.3.1 was an interim security fix only version, released between the already aging milestone:0.10.3 and the upcoming (next week) milestone:0.10.4 release.

Check the ChangeLog.

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'.

Add Comment


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