Wednesday, June 16, 2021
"fatal: git fetch-pack: expected shallow list" golang build error (CentOS 7)
Ran into an error like the following when trying to build etcd as a CentOS 7 package:
go: email@example.com requires firstname.lastname@example.org requires email@example.com: invalid version: git fetch --unshallow -f origin in /root/go/pkg/mod/cache/vcs/0ab7c7bc964e6f4054247fed3ac8d636309918420efe8a7cabef12d9f9904311: exit status 128: fatal: git fetch-pack: expected shallow list
or sometimes this:
go: firstname.lastname@example.org requires email@example.com requires firstname.lastname@example.org: invalid version: git fetch --unshallow -f origin in /root/go/pkg/mod/cache/vcs/f72f7a6f267d2fe79b1e174efab21a591b07c84ef53364f65b8281fda7000b49: exit status 128: fatal: git fetch-pack: expected shallow list
The mysterious thing was, the build had previously completed without issue many times, and there were no obvious changes in any of the build elements involved.
This issue does resemble that described in golang GitHub issue #38373; the workaround suggested by the poster involves resolving version references in the
go.mod file. However that did not seem feasible for this build, which indirectly pulls in a large number of golang modules from various git repositories, which would make tracking down any version reference issues a somewhat Herculean task.
It was however possible to resolve the error (as suggested in a comment on the issue) by upgrading the
git package to a more recent one, as the default CentOS 7 version is a very dated 1.8.x (released in 2014 or earlier).
Posted at 6:19 AM |Comments (0)