gitgithubandroid-sourcerepo

Need some guidance on how to salvage a repo sync following a computer crash


I was at the tail end of syncing a repository for an AOSP build when my computer froze. I couldn't get it going so I manually shut it down. When I rebooted, I resarted the sync which only took 10 minutes or so. When it finished I was left with this error:

error: cts/: platform/cts checkout 518922e7374115e5b7b6eac7aef000c9b0ac5e9a 
error: Cannot checkout platform/cts
error: Unable to fully sync the tree
error: Checking out local projects failed.
Failing repos:
cts
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
platform/cts checkout 518922e7374115e5b7b6eac7aef000c9b0ac5e9a 

I re-ran repo sync this time -j1 --fail-fast This is what I got

`fatal: Unable to create '/home/jr/aaos/.vscode/Worker/cts/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
error: cts/: platform/cts checkout 518922e7374115e5b7b6eac7aef000c9b0ac5e9a 
error: Cannot checkout platform/cts
error: Unable to fully sync the tree
error: Checking out local projects failed.
Failing repos:
cts
Try re-running with "-j1 --fail-fast" to exit at the first error.
================================================================================
Repo command failed due to the following `SyncError` errors:
platform/cts checkout 518922e7374115e5b7b6eac7aef000c9b0ac5e9a 
(env) jr@Expiremental:~/aaos/.vscode/Worker$ `

Do I just delete the CTS folder and re sync?


Solution

  • Remove /home/jr/aaos/.vscode/Worker/cts/.git/index.lock and try it again. You can try a minimum sync first, repo sync platform/cts. If it goes well, run the full repo sync again. The index.lock was not properly removed because you ended the process by shutting down the machine.

    If repo sync platform/cts still fails, you can remove these paths and then try it again.

    rm -rf /home/jr/aaos/.vscode/Worker/cts
    rm -rf /home/jr/aaos/.vscode/Worker/.repo/projects/cts.git
    rm -rf /home/jr/aaos/.vscode/Worker/.repo/project-objects/platform/cts.git