saveourtool/save-cloud

"Error in JGit API" when attempting to fetch a test source while no Git tag is selected

Open

#1.706 geöffnet am 10. Jan. 2023

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Kotlin (4 Forks)github user discovery
buggood first issue

Repository-Metriken

Stars
 (38 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

The UI allows to press the "Fetch"button even though no tag/branch/commit is selected:

image

On the preprocessor side, this results in:

18:05:41.166 [reactor-http-nio-3] ERROR c.s.s.p.s.GitPreprocessorService - Failed to clone git repository https://github.com/0x6675636b796f75676974687562/save-flaky-tests.git java.lang.IllegalStateException: Error in JGit API
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.withRethrow(GitUtil.kt:163)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.gitCallWithRethrow(GitUtil.kt:151)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.callWithRethrow(GitUtil.kt:155)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.doCloneToDirectory(GitUtil.kt:126)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.doCloneToDirectory$default(GitUtil.kt:108)
Caused by: org.eclipse.jgit.api.errors.TransportException: Remote branch 'null' not found in upstream origin
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:246)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:325)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:191)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:1)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt$callWithRethrow$1.invoke(GitUtil.kt:156)
Caused by: org.eclipse.jgit.errors.TransportException: Remote branch 'null' not found in upstream origin
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:155)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:103)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1462)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:235)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:325)

followed by

18:05:41.167 [reactor-http-nio-3] ERROR c.s.s.p.c.TestSuitesPreprocessorController - Failed to fetch from null java.lang.IllegalStateException: Error in JGit API
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.withRethrow(GitUtil.kt:163)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.gitCallWithRethrow(GitUtil.kt:151)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.callWithRethrow(GitUtil.kt:155)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.doCloneToDirectory(GitUtil.kt:126)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt.doCloneToDirectory$default(GitUtil.kt:108)
Caused by: org.eclipse.jgit.api.errors.TransportException: Remote branch 'null' not found in upstream origin
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:246)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:325)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:191)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:1)
	at com.saveourtool.save.preprocessor.utils.GitUtilKt$callWithRethrow$1.invoke(GitUtil.kt:156)
Caused by: org.eclipse.jgit.errors.TransportException: Remote branch 'null' not found in upstream origin
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:155)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:103)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1462)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:235)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:325)

BTW, the

There are no tags in ...

message is incorrect in my particular case, so the preprocessor should probably return HTTP 500 instead of HTTP 404 in case of an internal error.

Contributor Guide