Skip to content

Git LFS error reported after upgrading to latest Heroku CLI #4745

Closed

Description

@codebender

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.

image

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

  1. Open desktop via the command line with github command
  2. 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

Activity

  1. shiftkey commented on May 21, 2018

    @shiftkey
    Member

    @codebender thanks for the report! This is being raised by Git LFS due to the unexpected syntax in your .netrc file - I dealt with a similar issue to this over in #2858.

    I'm not sure whether netrc files 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.

  2. shiftkey commented on May 22, 2018

    @shiftkey
    Member

    @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 .netrc is expecting certain structure here and the Heroku CLI is adding additional fields.

  3. added
    bug
    on May 22, 2018
  4. jdx commented on May 22, 2018

    @jdx

    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.

  5. shiftkey commented on May 22, 2018

    @shiftkey
    Member

    @jdxcode that's probably more of a question for the Git LFS team than myself about whether they want to update their go-netrc dependency to use your fork and take in those patches.

  6. changed the title [-].netrc file error related to Heroku command line sso login[/-] [+]Git LFS error reported after upgrading to latest Heroku CLI[/+] on May 22, 2018
  7. added
    macOS
    on May 22, 2018
  8. ttaylorr commented on May 22, 2018

    @ttaylorr

    @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.

  9. jdx commented on May 22, 2018

    @jdx

    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.

  10. ttaylorr commented on May 25, 2018

    @ttaylorr

    @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?

  11. shiftkey commented on May 25, 2018

    @shiftkey
    Member

    Will that work OK for you?

    @ttaylorr all good here

  12. ttaylorr commented on May 29, 2018

    @ttaylorr

    @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?

    Git LFS v2.4.2 was released containing git-lfs/git-lfs#3027, which should fix this issue!

  13. robertofd1995 commented on May 30, 2018

    @robertofd1995

    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

  14. ttaylorr commented on May 30, 2018

    @ttaylorr

    @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.

  15. robertofd1995 commented on May 30, 2018

    @robertofd1995

    @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

  16. jdx commented on May 30, 2018

    @jdx
  17. self-assigned this
    on Jun 10, 2018
  18. codebender commented on Jun 22, 2018

    @codebender
    Author

    @shiftkey Thanks for the fix!

  19. shiftkey commented on Jun 22, 2018

    @shiftkey
    Member

    @codebender the fix is going out to beta now, with it slated to be available to everyone Monday

  20. locked as resolved and limited conversation to collaborators on Aug 21, 2018
  21. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmacOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions