upgraded to git 2.40.0 on homebrew and 1Password quit signing, throws error

eswat2
eswat2
Community Member

➜ .brew-file git:(main) ✗ git commit -a -m "update"
error: error: Found argument '-U' which wasn't expected, or isn't valid in this context

If you tried to supply `-U` as a value rather than a flag, use `-- -U`

USAGE:
op-ssh-sign [OPTIONS] -Y [--] [payload]

For more information try --help

fatal: failed to write commit object

NOTE: if i remove git from homebrew and use the Apple supplied git, it all works. But this means i'm running an older version of git for everything...


1Password Version: 1Password for Mac 8.10.1 (81001033)
Extension Version: 2.8.1
OS Version: macOS Ventura 13.2.1
Browser:_ Chrome 111.0.5563.64 (Official Build) (arm64)
Referrer: forum-search:git 2.40.0

Comments

  • eswat2
    eswat2
    Community Member

    has anyone else seen this issue ??

  • eswat2
    eswat2
    Community Member

    the current version of git supplied by apple is:

    ➜ ~ git --version
    git version 2.37.1 (Apple Git-137.1)

  • scottaw
    scottaw
    Community Member
    edited March 2023

    Yeah, I did the same thing. Homebrew, upgrade to 2.40, same exact error.

    https://1password.community/discussion/138747/git-2-40-breaks-op-ssh-sign#latest

  • joshukraine
    joshukraine
    Community Member

    Same issue here. Happened as soon as I upgraded to git 2.40.0 (homebrew).

  • a.jaffe
    a.jaffe
    Community Member
    edited March 2023

    Same here. Is there any way to specify a path to the git binary for (just) this operation, until there’s a fix?

  • We're working on a fix for this. For now, what you can do as a workaround is comment out the gpg.ssh.program line in your .gitconfig and set SSH_AUTH_SOCK yourself:

    On macOS:

    export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
    

    If you want to use it with a GUI application, you can launch it from the terminal session which has SSH_AUTH_SOCK set, e.g.

    open -a /Applications/Tower.app
    

    We'll keep you posted for when the fix is out.

  • jftyukfty44
    jftyukfty44
    Community Member

    I have an exactly the same problem. Thanks for working on that!

  • rstolpe
    rstolpe
    Community Member
    edited March 2023

    @floris_1P how? I did enter export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock in terminal but that did not work with vscode.
    It complained that it can't find the key after I did remove it from the configuration file.

    "Git: Couldn't find key in agent?" is the error message.

    I'm kind of a spot here now as I ened to fix a bug in my code.

  • @rstolpe Does it work when you try to commit from the terminal?

  • a.jaffe
    a.jaffe
    Community Member

    I'm also having problems getting this to work.

    I note that I don't have gpg.ssh.program in .gitconfig. Rather, I have
    IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
    in .ssh/config.

    I wonder if I need to reboot or at least log out/in?

  • You can run git config --show-origin --get-all gpg.ssh.program to see where op-ssh-sign gets set. Make sure comment out or remove that line. Alternatively, if it's easier, you can also consider downgrading Git.

    We have a fix for it ready, which will become available later today.

  • a.jaffe
    a.jaffe
    Community Member
    edited March 2023

    We have a fix for it ready, which will become available later today.

    I can certainly wait until later today!

    (But for what it's worth, git config --show-origin --get-all gpg.ssh.program returns no output. I don't think that it is mentioned in the docs for using op with ssh and git.)

  • hughbiquitous
    hughbiquitous
    Community Member

    @floris_1P I already have SSH_AUTH_SOCK set to $HOME/.1password/agent.sock, so I just commented out the [gpg "ssh"] section from my .gitconfig and everything worked just fine.

    This makes me wonder -- is the [gpg "ssh"] section even necessary if SSH_AUTH_SOCK is already set? Put another way, is op-ssh-sign doing anything that I don't already get by having SSH_AUTH_SOCK set up?

  • rstolpe
    rstolpe
    Community Member

    @floris_1P How's that fix going? :)

  • shender
    shender
    Community Member

    It's already out for macOS:
    https://releases.1password.com/mac/8.10/#changelog

    Working for me with the original git config back in place and no extra env vars.

    @floris_1P Thank you 🫡

  • eswat2
    eswat2
    Community Member

    awesome, just updated 1Password and reinstalled git 2.40.0 via brew, it seems to be working again... Thank you !!

  • scotte.zinn
    scotte.zinn
    Community Member

    Works for me as well - kudos to the support and dev team on a quick turnaround! Thanks all

  • scottaw
    scottaw
    Community Member

    Yep, thanks for the super fast turnaround on this one.

  • Indeed, we have released a fix for this both on the production and on the nightly channels.

This discussion has been closed.