Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » cloning a repo with git-lfs support generates NumberFormatException: For input string: "t"
cloning a repo with git-lfs support generates NumberFormatException: For input string: "t" [message #1837374] Thu, 28 January 2021 18:36 Go to next message
Bill Babcock is currently offline Bill BabcockFriend
Messages: 8
Registered: January 2021
Junior Member
Hi Folks,

ENV:
- OSX 11.1 (Big Sur)
- eclipse
Eclipse IDE for Enterprise Java Developers (includes Incubating components)

Version: 2020-12 (4.18.0)
Build id: 20201210-1552

- java
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing)

Since upgrading I've needed to re-enable git support, namely git lfs. In the past I had no luck getting the "Enable git-lfs support" button to "enable" but was able to get around it by adding a path variable so eclipse could find git-lfs. But now it seems like egit/jgit support for this works, I can click the enable button and it tells me support has been enabled.

The issue I'm having is when I try and clone a repository which requires git-lfs, I get the following stack:

!ENTRY org.eclipse.egit.ui 4 0 2021-01-28 13:16:15.767
!MESSAGE For input string: "t"
!STACK 0
java.lang.NumberFormatException: For input string: "t"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
	at java.base/java.lang.Long.parseLong(Long.java:707)
	at java.base/java.lang.Long.parseLong(Long.java:832)
	at org.eclipse.jgit.lfs.LfsPointer.parseLfsPointer(LfsPointer.java:144)
	at org.eclipse.jgit.lfs.SmudgeFilter.<init>(SmudgeFilter.java:93)
	at org.eclipse.jgit.attributes.FilterCommandRegistry.createFilterCommand(FilterCommandRegistry.java:115)
	at org.eclipse.jgit.dircache.DirCacheCheckout.runBuiltinFilterCommand(DirCacheCheckout.java:1631)
	at org.eclipse.jgit.dircache.DirCacheCheckout.getContent(DirCacheCheckout.java:1574)
	at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1487)
	at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:563)
	at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:467)
	at org.eclipse.jgit.api.CloneCommand.checkout(CloneCommand.java:376)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:204)
	at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:194)
	at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:488)
	at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access$2(AbstractGitCloneWizard.java:481)
	at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard$6.run(AbstractGitCloneWizard.java:460)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:6


I'd prefer to use egit/jgit for all of this, but if I have to I guess I could disable that and go back to the system binaries but I'd prefer not to.

Any help is most appreciated.

- bill
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&q [message #1837395 is a reply to message #1837374] Fri, 29 January 2021 09:35 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Looks like .gitattributes is set up wrongly, and the LFS filter gets run on a non-LFS object? Is the repo being clond public, so that we could try to reproduce?
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837402 is a reply to message #1837395] Fri, 29 January 2021 11:23 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
I've opened bug 570744 for this. But all the same I wonder what .gitattributes says.
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837407 is a reply to message #1837402] Fri, 29 January 2021 13:49 Go to previous messageGo to next message
Bill Babcock is currently offline Bill BabcockFriend
Messages: 8
Registered: January 2021
Junior Member
Hi - thanks for responding.
The repo is not public, but the .gitattributes file shows this:

* text=auto

# Text formats
*.txt text
*.sh text

# Binary Formats
*.tgz binary
*.rpm binary

*.tar filter=lfs diff=lfs merge=lfs -text


I should also note that I am getting around this by running git from the command line and it's not having any issues with lfs, etc.

[Updated on: Fri, 29 January 2021 13:50]

Report message to a moderator

Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837412 is a reply to message #1837407] Fri, 29 January 2021 14:44 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Is there any tar-file in the repo that is not a LFS pointer? Possibly one that was committed before the repo moved to using git-lfs? (I suspect that tar file contains C sources.)

That might explain the error.

Not sure, but from looking at the git-lfs sources it seems to me that standard git-lfs would pass through such an already committed tar file normally. (Might become a LFS pointer/file if checked-in again, though). JGit's internal SmudgeFilter doesn't appear to do so.
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837414 is a reply to message #1837412] Fri, 29 January 2021 15:03 Go to previous messageGo to next message
Bill Babcock is currently offline Bill BabcockFriend
Messages: 8
Registered: January 2021
Junior Member
When I clone the repo on the commandline, I get this (obviously obfuscated in a silly way but you get the idea):
Encountered 1 file(s) that should have been pointers, but weren't:
	misc/foo/filename.tar


Just the one file.
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837416 is a reply to message #1837414] Fri, 29 January 2021 15:29 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
That file causes your trouble. Is the file checked out correctly with command-line git? I.e., not empty, and you can actually untar it? And please satisfy my curiosity: does it contain C sources? :-)
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837417 is a reply to message #1837416] Fri, 29 January 2021 15:38 Go to previous messageGo to next message
Bill Babcock is currently offline Bill BabcockFriend
Messages: 8
Registered: January 2021
Junior Member
Yes, it checks out fine. I can untar it, and it's C sources. :)
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837422 is a reply to message #1837417] Fri, 29 January 2021 16:42 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Great, thanks. Opened another bug 570758 for this.
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1837423 is a reply to message #1837422] Fri, 29 January 2021 16:57 Go to previous messageGo to next message
Bill Babcock is currently offline Bill BabcockFriend
Messages: 8
Registered: January 2021
Junior Member
Thanks - I appreciate the investigation!
Re: cloning a repo with git-lfs support generates NumberFormatException: For input string: "t&a [message #1838984 is a reply to message #1837423] Wed, 10 March 2021 20:33 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Bug 570758 and bug 570744 are fixed in JGit 5.11, which will come out on March 17, 2021.

[Updated on: Wed, 10 March 2021 20:34]

Report message to a moderator

Previous Topic:"Store in Secure Store"doesn't work
Next Topic:ReceivePack and preReceiveHook
Goto Forum:
  


Current Time: Tue Sep 21 18:29:35 GMT 2021

Powered by FUDForum. Page generated in 0.02125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top