Skip to content

line 1: keyword expected; got ine after brew install on mac #2543

Closed

Description

@SebastianoF

Hi there!
After cloning a repo with git-lfs, what I found is only a checkout the repository where the data are not stored. I.e. I see the data structure of the repo and the sha256 of each large file.

The problem seems to be related to the installation, as returning line 1: keyword expected; got ine after the installation:

$ brew update
Already up-to-date.
$ brew install git-lfs
==> Downloading https://homebrew.bintray.com/bottles/git-lfs-2.2.1.el_capitan.bo
Already downloaded: /Users/sebastiano/Library/Caches/Homebrew/git-lfs-2.2.1.el_capitan.bottle.tar.gz
==> Pouring git-lfs-2.2.1.el_capitan.bottle.tar.gz
==> Caveats
Update your git config to finish installation:

  # Update global git config
  $ git lfs install

  # Update system git config
  $ git lfs install --system
==> Summary
🍺  /usr/local/Cellar/git-lfs/2.2.1: 65 files, 7.9MB
$ git lfs install
line 1: keyword expected; got ine

The same string is returned after each git-lfs command:

$ git lfs something
Error: unknown command "something" for "git-lfs"
Run 'git-lfs --help' for usage.
line 1: keyword expected; got ine

Many thanks in advance for the help!

Activity

  1. changed the title [-]line 1: keyword expected; got ine after brew Mac installation[/-] [+]line 1: keyword expected; got ine after brew install on mac[/+] on Sep 1, 2017
  2. technoweenie commented on Sep 1, 2017

    @technoweenie
    Contributor

    That error typically means you're running a build intended for another platform. Does which git-lfs point to where brew installed it?

  3. SebastianoF commented on Sep 1, 2017

    @SebastianoF
    Author

    Thanks for the reply!
    What i get is:

    $ brew info git-lfs
    git-lfs: stable 2.2.1 (bottled)
    Git extension for versioning large files
    https://github.com/git-lfs/git-lfs
    /usr/local/Cellar/git-lfs/2.2.1 (65 files, 7.9MB) *
      Poured from bottle on 2017-09-01 at 11:53:06
    From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/git-lfs.rb
    ==> Dependencies
    Build: go ✘
    ==> Caveats
    Update your git config to finish installation:
    
      # Update global git config
      $ git lfs install
    
      # Update system git config
      $ git lfs install --system
     $
     $ which git-lfs
    /usr/local/bin/git-lfs
     $ type git-lfs
    git-lfs is hashed (/usr/local/bin/git-lfs)
    

    So, should $ which git-lfs return /usr/local/Cellar/git-lfs? Sorry if the question is trivial, I do not know how brew works under the hood...


    Edit:
    I'm on a mac El Captain 10.11.5

    $ brew --version
    Homebrew 1.3.1
    Homebrew/homebrew-core (git revision 22df4; last commit 2017-09-01)
    

    Thanks

  4. technoweenie commented on Sep 1, 2017

    @technoweenie
    Contributor

    It depends on how you have brew setup, but /usr/local/bin/git-lfs does look correct. I believe brew installs packages to a directory like /usr/local/Cellar/git-lfs/2.2.1, and then symlinks to a path like /usr/local/bin.

    Try running brew unlink git-lfs. Does /usr/local/bin/git-lfs exist?

    Also, good call running type. How about file /usr/local/bin/git-lfs?

    # mac
    $ file /usr/local/bin/git-lfs
    /usr/local/bin/git-lfs: Mach-O 64-bit executable x86_64
    
    $ file linux-amd64/git-lfs-2.3.0-pre/git-lfs
    linux-amd64/git-lfs-2.3.0-pre/git-lfs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
    
    $ file windows-amd64/git-lfs-2.3.0-pre/git-lfs.exe
    windows-amd64/git-lfs-2.3.0-pre/git-lfs.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
    

    If you're still stuck, you can grab a pre-compiled build.

    NOTE: You can run brew link git-lfs to create the symlink again without having to re-download or re-compile anything.

  5. SebastianoF commented on Sep 2, 2017

    @SebastianoF
    Author

    Thanks!
    Command file /usr/local/bin/git-lfs works as expected on mac.
    I unlinked and re-linked via brew and found again the same problem.

    After downloading the two pre-compiled build related to mac and unzipped in a folder I still got the same problem:

    $ ls
    git-lfs-2.2.1_adm64     git-lfs-2.2.1_darwin368
    
    $ ./git-lfs-2.2.1_adm64/git-lfs --help
    git lfs <command> [<args>]
    
    Git LFS is a system for managing and versioning large files in
    association with a Git repository.  Instead of storing the large files
    within the Git repository as blobs, Git LFS stores special "pointer
    files" in the repository, while storing the actual file contents on a
    Git LFS server.  The contents of the large file are downloaded
    automatically when needed, for example when a Git branch containing
    the large file is checked out.
    
    Git LFS works by using a "smudge" filter to look up the large file
    contents based on the pointer file, and a "clean" filter to create a
    new version of the pointer file when the large file's contents change.
    It also uses a pre-push hook to upload the large file contents to
    the Git LFS server whenever a commit containing a new large file
    version is about to be pushed to the corresponding Git server.
    
    <...>
    
    * git lfs pre-push:
        Git pre-push hook implementation.
    * git lfs smudge:
        Git smudge filter that converts pointer in blobs to the actual content.
    line 1: keyword expected; got ine
    
    $ ./git-lfs-2.2.1_darwin368/git-lfs --help
    git lfs <command> [<args>]
    
    Git LFS is a system for managing and versioning large files in
    association with a Git repository.  Instead of storing the large files
    within the Git repository as blobs, Git LFS stores special "pointer
    files" in the repository, while storing the actual file contents on a
    Git LFS server.  The contents of the large file are downloaded
    automatically when needed, for example when a Git branch containing
    the large file is checked out.
    
    <...>
    
    * git lfs pre-push:
        Git pre-push hook implementation.
    * git lfs smudge:
        Git smudge filter that converts pointer in blobs to the actual content.
    line 1: keyword expected; got ine
    

    It may means that brew works correctly, and that it must be something else on my OS that does not like git-lfs. Otherwise git-lfs on linux works perfectly...
    Close the issue for now, thanks!

  6. technoweenie commented on Sep 11, 2017

    @technoweenie
    Contributor

    Welp, I think I found the issue. My fault for not doing the obvious check (searching for 'keyword expected' in the code base):

    return &t, fmt.Errorf("keyword expected; got " + string(tkind))

    Can you confirm your ~/.netrc file is legit? There's a possibility that the https://github.com/bgentry/go-netrc package has parsing bug. If you could even send a sanitized version of your file, that'd be great, too. Spaces and tabs need to be intact, so we can reproduce the exact same parsing bug. But machines, logins, and passwords should be randomized of course :)

  7. SebastianoF commented on Sep 17, 2017

    @SebastianoF
    Author

    Wow, you got it!!
    Here is my faulty .netrc. For some unknown reasons had lost the initial characters of the first line:

    ine  a_machine.somewhere.uk
    login    YYY
    password XXX
    

    Which is exactly the unexpected ine in the output message. 🚀 🚀 🚀🚀 🚀 🚀🚀 🚀 🚀 !!

  8. technoweenie commented on Sep 18, 2017

    @technoweenie
    Contributor

    Thanks for confirming. Clearly LFS needs to report that error better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions