Closed
Description
Description
I get this error when opening up Github Desktop, bad netrc file /Users/username/.netrc: line 7: keyword expected; got method. I believe it is not liking the entry in my .netrc file that is put there by the heroku CLI.
Here is what my .netrc file looks like with fake data:
machine api.heroku.com
login [email protected]
password fake-password
method sso
org fakeorg
It looks like the Github Desktop is not liking this method line.
Version
- GitHub Desktop: 1.1.1
- Operating system: MacOS 10.13.4
Steps to Reproduce
- Open desktop via the command line with
githubcommand - Error is displayed
Expected Behavior
No error during startup
Actual Behavior
Error displayed
Additional Information
Logs
2018-05-21T15:48:17.702Z - info: [main] Processing protocol url
2018-05-21T15:48:18.099Z - info: [ui] [AppStore] loading 12 repositories from store
2018-05-21T15:48:18.100Z - info: [ui] [AppStore] found account: codebender (Matthew Bender)
2018-05-21T15:48:18.686Z - info: [ui] launching: 1.1.1 (Mac OS 10.13.4)
2018-05-21T15:48:18.686Z - info: [ui] execPath: '/Applications/GitHub Desktop.app/Contents/Frameworks/GitHub Desktop Helper.app/Contents/MacOS/GitHub Desktop Helper'
2018-05-21T15:48:18.727Z - error: [ui] `git lfs install --skip-repo` exited with an unexpected code: 2.
bad netrc file /Users/username/.netrc: line 7: keyword expected; got method
Reacted by Muhammad Ibnuh and Kazuki Matsushita

Activity
shiftkey commentedon May 21, 2018
@codebender thanks for the report! This is being raised by Git LFS due to the unexpected syntax in your
.netrcfile - I dealt with a similar issue to this over in #2858.I'm not sure whether
netrcfiles support any sort of flexibility with extra tags, and I can't find any documentation about it from Heroku's end indicating this is intended behaviour (best link i could find) so I'd recommend commenting out those lines by prefixing a#and seeing if anything Heroku-related is affected.shiftkey commentedon May 22, 2018
@zeke pointed out in #4752 that this is new feature of the Heroku CLI integration: heroku/cli#539
As I think this will broadly affect Git LFS usage, which is the component that is raising this error, I'd like some 👀 from @ttaylorr about what to do next, because
.netrcis expecting certain structure here and the Heroku CLI is adding additional fields.jdx commentedon May 22, 2018
this might be helpful: jdx/go-netrc-old@2d5e848
They're are actually using the same netrc parser we used to use in the Heroku CLI when it was in Go. This patch should work for parsing at least.
shiftkey commentedon May 22, 2018
@jdxcode that's probably more of a question for the Git LFS team than myself about whether they want to update their
go-netrcdependency to use your fork and take in those patches.[-].netrc file error related to Heroku command line sso login[/-][+]Git LFS error reported after upgrading to latest Heroku CLI[/+]ttaylorr commentedon May 22, 2018
@shiftkey thanks for letting me know. I definitely agree with the entire assessment thus far that (1) Git LFS is complaining because of (2) go-netrc error-ing on keywords that it does not recognize.
@jdxcode thanks for sending along that patch. I think that is mostly what we're looking for. That said, I am curious whether or not the patch will retain unrecognized lines if the netrc is written to disk. I don't think it will matter, since we don't update netrc files in the first place, but it would be good to know nonetheless.
jdx commentedon May 22, 2018
I believe it will retain when dumping the netrc because it's still keeping all the tokens, there just isn't a way to reference it.
ttaylorr commentedon May 25, 2018
@jdxcode I had a chance to look at your patch, and found that a few additional tweaks were needed in order to ensure that additional unknown keywords are round-tripped correctly. Specifically, the
parse()loop relies on certain conditionals to be set in order to associate what would otherwise be unknown keywords with macro definitions.The patch that I picked up for use in Git LFS (via git-lfs/git-lfs#3027) can be found here: git-lfs/go-netrc@5affb93432.
@shiftkey I am looking at cutting a release containing that (+ a few other patches) for v2.4.2 early next week. Will that work OK for you?
shiftkey commentedon May 25, 2018
@ttaylorr all good here
ttaylorr commentedon May 29, 2018
Git LFS v2.4.2 was released containing git-lfs/git-lfs#3027, which should fix this issue!
robertofd1995 commentedon May 30, 2018
Guys i had the same issue and after uploading git lfs to v2.4.2 now I get this error
Repository or object not found: https://git.heroku.com/project.git/info/lfs/objects/batch
ttaylorr commentedon May 30, 2018
@robertofd1995 does Heroku support Git LFS? If so, can you please open an issue in https://github.com/git-lfs/git-lfs? I am out of the office right now, but would be more than happy to dig in shortly.
robertofd1995 commentedon May 30, 2018
@ttaylorr I just look up for it, and no Heroku doesn't support Git lfs, strange but....
I solved it with rm .git/hooks/pre-push
jdx commentedon May 30, 2018
we do not support lfs
codebender commentedon Jun 22, 2018
@shiftkey Thanks for the fix!
shiftkey commentedon Jun 22, 2018
@codebender the fix is going out to beta now, with it slated to be available to everyone Monday