org.eclipse.jgit.transport.WantNotValidException: want XXXXXX not valid

9,700 views
Skip to first unread message

Layona Kunjumon

unread,
May 16, 2024, 8:33:39 AM5/16/24
to Repo and Gerrit Discussion
Hi All,

We are encountering below error in logs where users are reporting an issue with "fatal: remote error: want ******* not valid.". We have so many similar "not valid" and "missing unknown" entries in the logs. We have checked the missing object date and it is way past in time (eg:2019).

[2024-05-16 15:11:50,067] [SSH git-upload-pack /REPO (USERNAME)] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user USERNAME account XXXXXXX) during git-upload-pack '/REPO'
org.eclipse.jgit.transport.UploadPackInternalServerErrorException
        at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:789)
        at com.google.gerrit.sshd.commands.Upload.runImpl(Upload.java:78)
        at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:98)
        at com.google.gerrit.sshd.AbstractGitCommand.access$000(AbstractGitCommand.java:31)
        at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:63)
        at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:467)
        at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:83)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:646)
        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: org.eclipse.jgit.transport.WantNotValidException: want 530ee96ae4a8d8a8275aba7d39818c90085f9ed5 not valid
        at org.eclipse.jgit.transport.UploadPack.parseWants(UploadPack.java:1896)
        at org.eclipse.jgit.transport.UploadPack.processHaveLines(UploadPack.java:1749)
        at org.eclipse.jgit.transport.UploadPack.negotiate(UploadPack.java:1722)
        at org.eclipse.jgit.transport.UploadPack.service(UploadPack.java:1069)
        at org.eclipse.jgit.transport.UploadPack.uploadWithExceptionPropagation(UploadPack.java:858)
        at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:766)
        ... 14 more
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 530ee96ae4a8d8a8275aba7d39818c90085f9ed5
        at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:135)
        at org.eclipse.jgit.lib.ObjectReader$1.open(ObjectReader.java:288)
        at org.eclipse.jgit.revwalk.RevWalk$2.next(RevWalk.java:1189)
        at org.eclipse.jgit.transport.UploadPack.parseWants(UploadPack.java:1883)
        ... 19 more

Error from end user:
╰─$ git clone "ssh://USERNAME@GERRIT_URL:29418/REPONAME"
Cloning into 'REPO'...
fatal: remote error: want 530ee96ae4a8d8a8275aba7d39818c90085f9ed5 not valid
fatal: internal server error

clone with debug:

╰─$ GIT_TRACE=1 git clone "ssh://USERNAME@GERRIT_URL:29418/REPONAME"
07:11:47.988535 git.c:460               trace: built-in: git clone ssh://USERNAME@GERRIT_URL:29418/REPONAME
Cloning into 'REPO'...
07:11:47.993220 run-command.c:655       trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL -p 29418 USERNAME@GERRIT_URL 'git-upload-pack '\''/REPONAME'\'''
fatal: remote error: want 530ee96ae4a8d8a8275aba7d39818c90085f9ed5 not valid

As checked in server end, it is pointing to a valid object and the object is existing in the repository:

╰─$ git ls-remote "ssh://USERNAME@GERRIT_URL:29418/REPO" | grep 530ee96ae4a8d8a8275aba7d39818c90085f9ed5
530ee96ae4a8d8a8275aba7d39818c90085f9ed5        refs/tags/TAGNAME

The clone works by bypassing Gerrit. Gerrit version is 2.16.28-72-g3587102a0d. Does this an expected behaviour? Could you please help to check this? 

Regards,
Layona

Luca Milanesio

unread,
May 16, 2024, 9:06:34 AM5/16/24
to Repo and Gerrit Discussion, Luca Milanesio, Layona Kunjumon
Gerrit v2.16 is EOL (see [1]), however, you could look at Enterprise Support for more details (see [2]) and I’m sure there will be people wishing to help also on older releases.
The wants-not-valid issue is well known and resolved in more resent versions of Gerrit that includes the new “allow-sha1-in-wants” option in JGit.

Bottom line: by upgrading to newer versions and using the “allow-sha1-in-wants” the problem goes away.
Also, with regards to the missing unknown, I’ve fixed one issue where JGit di not manage to refresh the packlist, index and bitmap even if that was updated on the filesystem.
All recent non-EOL versions of Gerrit have those fixes.

HTH

Luca.





Regards,
Layona

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/6b18f46a-6ded-43a2-8df9-df74dd3624c5n%40googlegroups.com.

Layona Kunjumon

unread,
May 16, 2024, 10:00:25 AM5/16/24
to Repo and Gerrit Discussion
Hi Luca,

  Thanks for the response. Could you please share the bug or known issue link for reference.?  

Luca Milanesio

unread,
May 16, 2024, 10:07:55 AM5/16/24
to Repo and Gerrit Discussion, Luca Milanesio, Layona Kunjumon

On 16 May 2024, at 15:00, Layona Kunjumon <layonal...@gmail.com> wrote:

Hi Luca,

  Thanks for the response. Could you please share the bug or known issue link for reference.?  

Please avoid top-posting, as it makes this conversation thread difficult to read.
See [3].
See [4].

Also, with regards to the missing unknown, I’ve fixed one issue where JGit di not manage to refresh the packlist, index and bitmap even if that was updated on the filesystem.

See [5].




Regards,
Layona

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/6b18f46a-6ded-43a2-8df9-df74dd3624c5n%40googlegroups.com.


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages