RepoSense icon indicating copy to clipboard operation
RepoSense copied to clipboard

Bug: RepoSense cannot clone a repository

Open fyusuf-a opened this issue 2 years ago • 5 comments

Tell us about your environment

  • RepoSense Version: 07d6ce9e9c
  • OS and Version: Ubuntu 20.04.4 LTS
  • git version: 2.25.1

Please include the steps to reproduce the bug.

  1. Run java -jar RepoSense.jar --repos https://github.com/fyusuf-a/ft_transcendence.git --view

What was expected to happen?

Cloning of the repository should work. A git clone https://github.com/fyusuf-a/ft_transcendence.git runs without a problem.

What actually happened? Please include a screenshot of the output.

The following message is displayed: [ERROR] Exception met while cloning or checking out fyusuf-a/ft_transcendence[master].Analysis terminated.

fyusuf-a avatar Jul 24 '22 10:07 fyusuf-a

Thank you for raising this up. I tried this on Windows 11 with git 2.35.1.windows.2. This is my log output:

warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'


	at reposense.system.CommandRunner.runCommand(CommandRunner.java:23)
	at reposense.git.GitClone.cloneFromBareAndUpdateBranch(GitClone.java:121)
	at reposense.report.ReportGenerator.analyzeRepos(ReportGenerator.java:334)
	at reposense.report.ReportGenerator.lambda$cloneAndAnalyzeRepos$1(ReportGenerator.java:246)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591)
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: reposense.system.CommandRunnerProcessException: Error returned from command git clone "repos\fyusuf-a_ft_transcendence\ft_transcendence_bare" --branch master "repos\fyusuf-a_ft_transcendence\ft_transcendence" on path . :
Cloning into 'repos\fyusuf-a_ft_transcendence\ft_transcendence'...
done.
Updating files:  81% (181/221)
Updating files:  82% (182/221)
Updating files:  83% (184/221)
Updating files:  84% (186/221)
Updating files:  85% (188/221)
Updating files:  86% (191/221)
Updating files:  87% (193/221)
Updating files:  88% (195/221)
Updating files:  89% (197/221)
Updating files:  90% (199/221)
Updating files:  91% (202/221)
Updating files:  92% (204/221)
Updating files:  93% (206/221)
Updating files:  94% (208/221)
Updating files:  95% (210/221)
Updating files:  96% (213/221)
Updating files:  97% (215/221)
Updating files:  98% (217/221)
Updating files:  99% (219/221)
Updating files: 100% (221/221)
Updating files: 100% (221/221), done.
Downloading frontend/src/assets/images/GitHub-Mark-120px-plus.png (4.3 KB)
Error downloading object: frontend/src/assets/images/GitHub-Mark-120px-plus.png (7898110): Smudge error: Error downloading frontend/src/assets/images/GitHub-Mark-120px-plus.png (7898110808edb63a715e399ebd3c9bd0281520c5e404a8820f91abffdd7da7e6): error transferring "7898110808edb63a715e399ebd3c9bd0281520c5e404a8820f91abffdd7da7e6": [0] remote missing object 7898110808edb63a715e399ebd3c9bd0281520c5e404a8820f91abffdd7da7e6

In your case, this may have happened: https://stackoverflow.com/questions/43989902/git-pull-smudge-filter-lfs-failed

yhtMinceraft1010X avatar Jul 29 '22 05:07 yhtMinceraft1010X

In your case, this may have happened: https://stackoverflow.com/questions/43989902/git-pull-smudge-filter-lfs-failed

You may be able to find something similar in your logs. The directory for RepoSense logs is <working directory>/<output directory>/logs. For <output directory>, the default name is reposense-report.

yhtMinceraft1010X avatar Jul 29 '22 06:07 yhtMinceraft1010X

Yes, it seems to be a git-lfs error. Please note that I have git-lfs installed and that a git clone of the project works.

Aug 04, 2022 10:40:34 AM reposense.report.RepoCloner spawnCloneProcess
INFO: Cloning in parallel from https://github.com/fyusuf-a/ft_transcendence.git...
Aug 04, 2022 10:40:35 AM reposense.report.RepoCloner waitForCloneProcess
INFO: Waiting for cloning of https://github.com/fyusuf-a/ft_transcendence.git to complete...
Aug 04, 2022 10:40:35 AM reposense.report.RepoCloner waitForCloneProcess
INFO: Cloning of https://github.com/fyusuf-a/ft_transcendence.git completed!
Aug 04, 2022 10:40:35 AM reposense.report.ReportGenerator analyzeRepos
INFO: [1/1] Analyzing https://github.com/fyusuf-a/ft_transcendence.git (master)...
Aug 04, 2022 10:40:35 AM reposense.git.GitClone cloneFromBareAndUpdateBranch
SEVERE: Exception met while cloning or checking out fyusuf-a/ft_transcendence[master].Analysis terminated.
java.lang.RuntimeException: reposense.system.CommandRunnerProcessException: Error returned from command git clone 'repos/fyusuf-a_ft_transcendence/ft_transcendence_bare' --branch master 'repos/fyusuf-a_ft_transcendence/ft_transcendence' on path . :
Cloning into 'repos/fyusuf-a_ft_transcendence/ft_transcendence'...
done.
Downloading frontend/src/assets/images/40cat.png (1.3 MB)
Error downloading object: frontend/src/assets/images/40cat.png (d2e0b8f): Smudge error: Error downloading frontend/src/assets/images/40cat.png (d2e0b8f21fa3bf5d7ccc4d355fba4c2d549f97222db6b42c6005a36d7225910d): EOF

Errors logged to /tmp/repos/fyusuf-a_ft_transcendence/ft_transcendence/.git/lfs/logs/20220804T104035.915634029.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: frontend/src/assets/images/40cat.png: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'


	at reposense.system.CommandRunner.runCommand(CommandRunner.java:23)
	at reposense.git.GitClone.cloneFromBareAndUpdateBranch(GitClone.java:121)
	at reposense.report.ReportGenerator.analyzeRepos(ReportGenerator.java:334)
	at reposense.report.ReportGenerator.lambda$cloneAndAnalyzeRepos$1(ReportGenerator.java:246)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: reposense.system.CommandRunnerProcessException: Error returned from command git clone 'repos/fyusuf-a_ft_transcendence/ft_transcendence_bare' --branch master 'repos/fyusuf-a_ft_transcendence/ft_transcendence' on path . :
Cloning into 'repos/fyusuf-a_ft_transcendence/ft_transcendence'...
done.
Downloading frontend/src/assets/images/40cat.png (1.3 MB)
Error downloading object: frontend/src/assets/images/40cat.png (d2e0b8f): Smudge error: Error downloading frontend/src/assets/images/40cat.png (d2e0b8f21fa3bf5d7ccc4d355fba4c2d549f97222db6b42c6005a36d7225910d): EOF

Errors logged to /tmp/repos/fyusuf-a_ft_transcendence/ft_transcendence/.git/lfs/logs/20220804T104035.915634029.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: frontend/src/assets/images/40cat.png: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'


	at reposense.system.CommandRunnerProcess.waitForProcess(CommandRunnerProcess.java:46)
	at reposense.system.CommandRunner.runCommand(CommandRunner.java:21)
	... 8 more

Aug 04, 2022 10:40:36 AM reposense.report.ReportGenerator generateReposReport
INFO: The report is generated at /tmp/reposense-report
Aug 04, 2022 10:40:36 AM reposense.RepoSense main
INFO: Elapsed processing time: 1.22 second(s)
Aug 04, 2022 10:40:36 AM reposense.system.ReportServer startServer
INFO: Starting a server at port 9000...
Aug 04, 2022 10:40:36 AM reposense.system.ReportServer launchBrowser
INFO: Loading http://localhost:9000/ on the default browser...
Aug 04, 2022 10:40:36 AM reposense.system.ReportServer startServer
INFO: Press Ctrl + C or equivalent to stop the server

fyusuf-a avatar Aug 04 '22 08:08 fyusuf-a

Hi, I would like to investigate this issue.

lawwm avatar Aug 14 '22 15:08 lawwm

This is what I think causes the error. In the application, it first runs git clone --bare into a local directory. Then it tries to git clone from that bare local directory later on which is what causes the exception.

  1. The tracked LFS files are stored in the remote git repo on the Git host.
  2. During the first git clone --bare, the remote origin of the first local repo is set to the remote repo.
  3. During the second git clone, the remote origin of the second local repo is set to the first local repo.
  4. However, the first local repo does not contain the LFS files, as they are in remote repo.
  5. Therefore, you will get an error transferring "ff5a9f54814c4f272862d30ca87b491881efd4d1b84eaa9c37fe778dfae7083a": [0] remote missing object ff5a9f54814c4f272862d30ca87b491881efd4d1b84eaa9c37fe778dfae7083a

When I run git remote set-url origin for the second repo to link to the remote repo, git lfs pull succeeds.

For the solution, I assume we would not want to actually fetch the LFS files as they can be quite large? We can set git lfs install --skip-smudge instead, and the small LFS pointer files would be displayed instead. Or would it be better to omit these pointer files?

For example, these small LFS pointer files would be displayed on Reposense as version https://git-lfs.github.com/spec/v1 oid sha256:ff5a9f54814c4f272862d30ca87b491881efd4d1b84eaa9c37fe778dfae7083a size 293817

lawwm avatar Aug 15 '22 07:08 lawwm