Got to fail carthage outdated command because of git protocol.version

My environment is as follows:

language: objective-c
osx_image: xcode10.1

~/Library/Logs/scan/MyApp.log

I’m using fastlane and this is the fastlane scan log.

/bin/sh -c /Users/travis/Library/Developer/Xcode/DerivedData/MyApp-bhautcgmwfkvfigchtwqqwjosuwi/Build/Intermediates.noindex/MyApp.build/Staging-iphonesimulator/MyApp.build/Script-FD5D11F2208D6019001687FC.sh
*** Fetching TagListView
A shell task (/usr/bin/env git fetch --prune --quiet https://b4dbac396898493bdaa671908a266a0e13e3567b@github.com/ElaWorkshop/TagListView.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/travis/Library/Caches/org.carthage.CarthageKit/dependencies/TagListView)) failed with exit code 128:
fatal: unknown value for config 'protocol.version': 2

Command PhaseScriptExecution failed with a nonzero exit code

Git config

Traviss-Mac-6:myapp travis$ git config --global -l
protocol.version=2

Git version

Traviss-Mac-6:myapp travis$ git version
git version 2.19.1

Passed after I changed global git config protocol.version from 2 to 1.

Got to fail these days suddenly and I have no idea what was changed in your environment.

This is a recent change.

When reporting a problem, please include a build log URL, so we can help you better.

Thanks.

2 Likes

Thank you for the quick response. This is the build log.
https://api.travis-ci.com/v3/job/178463989/log.txt

This job does not have an error message you indicated previously. Could you double check you have the right job?

Yes, the error message I wrote was that I got from the log file while running the debug job.
The log file was some like ~/Library/Logs/scan/*

That is not very helpful, but the likely explanation is this: Your invocation of git is actually one for the system git (as in /usr/bin/git) which is not recent enough to understand the protocol version 2. To wit:

Traviss-Mac-6:travis_production_test travis$ git --version
git version 2.19.1
Traviss-Mac-6:travis_production_test travis$ which git
/usr/local/bin/git
Traviss-Mac-6:travis_production_test travis$ /usr/bin/git --version
git version 2.17.2 (Apple Git-113)

I don’t know much about Carthage implementation, it seems they just use git to fetch the git repository as far as I glanced at their code.

When Xcode executes run script, environment variables are printed out as below:

export PATH=
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin
/Applications/Xcode-10.1.app/Contents/Developer/usr/bin
/Applications/Xcode-10.1.app/Contents/Developer/usr/local/bin
/Users/travis/.rvm/gems/ruby-2.4.5/bin
/Users/travis/.rvm/gems/ruby-2.4.5@global/bin
/Users/travis/.rvm/rubies/ruby-2.4.5/bin
/Users/travis/.rvm/bin
/Users/travis/.nvm/versions/node/v10.13.0/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
/Users/travis/bin
/Users/travis/.local/bin
/Users/travis/.debug

And I found more prioritized git executable in /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git

Besides, that git version is 2.17.2.

Traviss-Mac-6:paidy-ios-app travis$ /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git --version
git version 2.17.2 (Apple Git-113)

In conclusion, Carthage just uses any git executable and it’ll be /Applications/Xcode-10.1.app/Contents/Developer/usr/bin/git which has unexpected version in Travis.

@BanzaiMan What do you think?

Thanks for this insight, @torufuruya!

We’ve reverted the change that enabled Git Wire Protocol v2 so this issue should be fixed now.

Could you confirm by restarting a previously failing build?

Thanks!

It’s working now. Thanks!

Glad to hear it and sorry again for the disruption!