Modify

Opened 18 years ago

Closed 3 years ago

#665 closed defect (wontfix)

resyncing p4 depot fails

Reported by: r.blum@… Owned by: Lewis Baker
Priority: normal Component: PerforcePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I'm starting up trac-admin, and issue the resync command.

After a while, I get this:

  Trac [C:\data\test]> resync
  Resyncing repository history...
  Command failed: 'depotFile'

Attachments (0)

Change History (10)

comment:1 Changed 18 years ago by jovi

My resync fails also. There is over 9000 changesets in repository. Using Trac Version 0.10b1 on Windows.

Resyncing repository history...
Traceback (most recent call last):
  File "c:\Python24\Scripts\trac-admin", line 22, in ?
    sys.exit(run(sys.argv[1:]))
  File "C:\Python24\Lib\site-packages\trac\scripts\admin.py", line 1196, in run
    return admin.onecmd(command)
  File "C:\Python24\Lib\site-packages\trac\scripts\admin.py", line 100, in onecmd
    print>>sys.stderr, 'Command failed: %s' % e
AttributeError: NoSuchFile instance has no attribute 'args'

Last lines from log file(Removed source file names):

2006-09-06 16:03:54,069 Trac[api] DEBUG: get_changeset(3443)
2006-09-06 16:03:54,069 Trac[api] DEBUG: PerforceChangeset(3443) created
2006-09-06 16:03:54,069 Trac[api] DEBUG: PerforceChangeset.get_changes()
2006-09-06 16:03:54,069 Trac[api] DEBUG: PerforceChangeset(3443).get_changes()
2006-09-06 16:03:54,069 Trac[api] DEBUG: Change 3443 contains //depot/XXXX@3443 [edit]
2006-09-06 16:03:54,069 Trac[api] DEBUG: Change 3443 contains //depot/XXXX@3443 [edit]

comment:2 Changed 18 years ago by Lewis Baker

Owner: changed from ttressieres to Lewis Baker

Do you know what was special about the particular changelist that is causing it to fail? Were there deleted file revisions? Do the file revisions contain integrations?

What Perforce server version are you using?

comment:3 Changed 18 years ago by jovi

Perforce Server version: 2002.2/43075 on Windows 2000.

Python version: 2.4.2

I am not allowed to show the source files, but here are a description of the changeset.

p4 describe  -s 3443
Change 3443 by xxx@xxx on 2003/12/08 13:53:00

        ...

Affected files ...

... //depot/xxx#9 edit
... //depot/xxx#2 edit
... //depot/xxx#4 delete
... //depot/xxx#1 add
... //depot/xxx#6 delete
... //depot/xxx#1 add
... //depot/xxx#6 edit
... //depot/xxx#4 delete
... //depot/xxx#1 add
... //depot/xxx#3 edit
... //depot/xxx#2 edit
... //depot/xxx#3 edit
... //depot/xxx#5 delete
... //depot/xxx#1 add

When I run automatic resync from apache I got the following error:

 DEBUG: Change 3443 contains //depot/xxxxx@3443 [edit]
2006-09-15 13:15:44,848 Trac[main] ERROR: NoSuchFile instance has no attribute 'args'
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 355, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python24\Lib\site-packages\trac\web\main.py", line 224, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Python24\Lib\site-packages\trac\Timeline.py", line 148, in process_request
    [f[0] for f in available_filters])
  File "C:\Python24\Lib\site-packages\trac\Timeline.py", line 222, in _provider_failure
    ", ".join(guilty_kinds), ep_name, exc_name, to_unicode(exc), href))
  File "C:\Python24\Lib\site-packages\trac\util\text.py", line 53, in to_unicode
    return unicode(text)
AttributeError: NoSuchFile instance has no attribute 'args'

comment:4 in reply to:  3 Changed 18 years ago by Lewis Baker

Status: newassigned

Replying to jovi:

Did any of these changes involve deleting a file and adding a file under a directory of the same name? eg

... //depot/foo#4 delete
... //depot/foo/bar#1 add

The p4trac.repos.Node._get_action method contains logic that checks that a node is not a directory before checking if it is a file or deleted file and throws a NoSuchFile exception if the node is a directory. This check can probably be removed without adverse side-effects.

@@ -705,16 +705,12 @@
     def _get_action(self):
         """The most recent action performed on this file node.
 
         One of 'add', 'edit', 'delete', 'branch', 'import', 'integrate'.
 
         @raise NoSuchFile: If this node is not a file node.
         """
 
-        if self.isDirectory:
-            raise NoSuchFile(self._nodePath.path,
-                             self._nodePath.rev)
-
         if self.isFile:
             fileInfo = self._repo._getFileInfo(self._nodePath)
             assert fileInfo is not None
         else:

comment:5 Changed 18 years ago by jovi

The change to the p4trac.repos.Node._get_action method fixed the problem.

It failed before on these changes in the changeset:

... //depot/foo/foo#4 delete
... //depot/foo/bar#1 add

comment:6 Changed 18 years ago by Lewis Baker

(In [1287]) Fixed a bug that caused PerforceChangeset.get_changes() to raise an error if a file was deleted and a directory with the same name added in the same changelist.

See #665 for details.

comment:7 in reply to:  description Changed 18 years ago by Lewis Baker

Replying to r.blum@gmx.net:

I'm starting up trac-admin, and issue the resync command.

After a while, I get this:

  Trac [C:\data\test]> resync
  Resyncing repository history...
  Command failed: 'depotFile'

This would seem to be due to the output of a 'p4 fstat' command not containing a 'depotFile' entry.

Would you able to provide some more details on which version of the Perforce server you are running, the contents of the changelist being synced or of the 'p4 fstat' record that is causing the error?

comment:8 Changed 17 years ago by anonymous

Resyncing repository history... Command failed: 'depotFile'

I am getting the same error....i put the path depot/user/ for the path

Any help is appreciated....thanx

comment:9 Changed 15 years ago by anonymous

hi, i don't know if you still need a solution for the error Command failed: 'depotFile' but as far as i can remember, i had a similar problem. you could verify the repository with the following command:

p4 verify -q //...

in my case it returned some filenames that were actually missing. afterwards, i deleted the missing files with this command:

p4 obliterate -y <file>

if you happen to have a backup of your repository, you can try to restore those files. a detailed description on what you can do with resolving the problem of missing files in your perforce repository can be found here.

i hope that helps or even resolves your problem

kind regards, andi

comment:10 Changed 3 years ago by Ryan J Ollos

Resolution: wontfix
Status: assignedclosed

Plugin is deprecated.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Lewis Baker.
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.