Edgewall Software

Ticket #2416 (closed defect: fixed)

Opened 3 years ago

Last modified 17 months ago

Trac internal error when parsing svn history

Reported by: tjb@… Owned by: cboos
Priority: high Milestone: 0.9.3
Component: version control Version: 0.10.3.1
Severity: major Keywords: sync needinfo
Cc: tjb@…

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

Attachments

Change History

  Changed 3 years ago by anonymous

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.

  Changed 3 years ago by anonymous

  • owner changed from jonas to anonymous
  • status changed from new to assigned
  • component changed from general to version control
  • milestone set to 0.9.1

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

  Changed 3 years ago by cboos

  • owner changed from anonymous to cboos
  • priority changed from normal to high
  • status changed from assigned to new

(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!

  Changed 3 years ago by cboos

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

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

  Changed 3 years ago by tjb@…

  • status changed from closed to reopened
  • resolution fixed deleted

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.

  Changed 3 years ago by cboos

  • status changed from reopened to new

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.

  Changed 3 years ago by cboos

  • status changed from new to assigned

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.

  Changed 3 years ago by cboos

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

Ported in r2574.

  Changed 3 years ago by anonymous

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

  Changed 3 years ago by anonymous

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 0.9.1 to 0.9.2

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:

  Changed 3 years ago by cboos

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone changed from 0.9.2 to 0.9.3

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

  Changed 3 years ago by cboos

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

  Changed 3 years ago by anonymous

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?

  Changed 17 months ago by phuna

  • status changed from closed to reopened
  • version changed from 0.9 to 0.10.3.1
  • resolution fixed deleted
  • milestone changed from 0.9.3 to 0.10.4

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.

  Changed 17 months ago by cboos

  • 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"?)

follow-up: ↓ 17   Changed 17 months ago by cboos

  • keywords needinfo added
  • milestone 0.10.4 deleted

Not that urgent, apparently...

in reply to: ↑ 16   Changed 17 months ago by phuna

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

  Changed 17 months ago by cboos

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone set to 0.9.3

No feedback, closing again.

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

  Changed 17 months ago by anonymous

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

  Changed 17 months ago by cboos

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.

Add/Change #2416 (Trac internal error when parsing svn history)

Author



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