1

I was using the ac2git tool to concert my accurev depot to git repository. I am getting the following error when running the command python ac2git.py after following the necessary steps, as instructed here.

2016-08-29 09:54:14,058 - ac2git - ERROR - The script has encountered an exception, aborting!
Traceback (most recent call last):
File "ac2git.py", line 3596, in AccuRev2GitMain
rv = state.Start(isRestart=args.restart, isSoftRestart=args.softRestart)
File "ac2git.py", line 2974, in Start
self.RetrieveStreams()
File "ac2git.py", line 1556, in RetrieveStreams
tr, commitHash = self.RetrieveStream(depot=depot, stream=streamInfo,dataRef=dataRef, stateRef=stateRef, hwmRef=hwmRef, startTransaction=self.config.accurev.startTransaction, endTransaction=endTr.id)
File "ac2git.py", line 1511, in RetrieveStream
dataTr,  dataHash  = self.RetrieveStreamData(stream=stream, dataRef=dataRef,stateRef=stateRef)
File "ac2git.py", line 1394, in RetrieveStreamData
commitHash = self.Commit(transaction=tr, allowEmptyCommit=True,messageOverride="transaction {trId}".format(trId=tr.id), parents=[], ref=dataRef)
File "ac2git.py", line 670, in Commit
self.PreserveEmptyDirs()
File "ac2git.py", line 440, in PreserveEmptyDirs
if git.GetGitDirPrefix(path) is None and len(os.listdir(path)) == 0:
FileNotFoundError: [WinError 3] The system cannot find the path specified:'C:///Users/*****/*****/app/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list'

The error is quite vague and I can't seem to find any documentation on this tool that can help with the error. Has anyone faced this issue before?

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67

1 Answers1

1

I am not familiar with the tool you are using but it seems the last line in the output excerpt you provided gives the best information:

FileNotFoundError: [WinError 3] The system cannot find the path specified:'C:///Users/*****/*****/app/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list'

That path looks to be malformed with extra slashes and directory names that are not valid within the file system. Also, the file path is at 227 characters in the output and if the directory names between "Users" and "app" are long enough, you could be hitting the 256 character path name limit in Windows.

Mike Abusheery
  • 539
  • 2
  • 6
  • I think you are right, it does exceed the limit. I am looking for ways I can expand the character limitation, if that is the root cause of the issue, my application should run fine. – Shruti Srivastava Aug 30 '16 at 15:32
  • I tried git config --system core.longpaths true I also tried prefixing the path with \\?\ For increasing the limit, but Im still getting the same error. Any idea if there is some other way ? – Shruti Srivastava Aug 30 '16 at 17:21
  • 1
    I fixed the issue @Mike, got to the bottom of it, because of what you pointed out.Further delving into it got me here: [http://stackoverflow.com/questions/39274722/using-path-extension-for-windows-7-with-python-script](Solution) – Shruti Srivastava Sep 02 '16 at 14:30
  • I tried calling both `os.listdir('C:\\\Users\\')` and `os.listdir('C:///Users//')` in python 2.7 (on Widnows) and it listed the directory by collapsing all of the doubled up slashes. I also tried the `os.listdir('///home//user///')` in python 3.4 (on Linux) and it also printed the expected result by collapsing all the series of slashes. So I suspect that it is definitely the long file name limit that is causing this. – nonsensickle Sep 04 '16 at 10:52