kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Error pulling code from Gitee due to outdated go-git dependency

Open zhouya2010 opened this issue 7 months ago • 0 comments

When using Kaniko to pull code from Gitee (https://gitee.com/), I encounter the following error:

Error: error resolving source context: error decoding upload-pack response: invalid pkt-len found

After investigation, I found this is caused by an outdated version of github.com/go-git/go-git/v5 in Kaniko's dependencies. When testing with the latest version of go-git, the issue is resolved.

Reproduction Steps:

  1. Configure Kaniko to clone a repository from Gitee (e.g., https://gitee.com/yszs/sip-service.git)

  2. Observe the "invalid pkt-len found" error

Test Case: I verified the fix by testing with the latest go-git version:

_, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{
    URL: "https://gitee.com/yszs/sip-service.git",
    Progress: os.Stdout,
})

Suggested Solution: Please update the github.com/go-git/go-git/v5 dependency to the latest version to resolve this compatibility issue with Gitee.

Additional Context: This appears to be related to how go-git handles the git protocol packets from Gitee's servers, which was improved in later versions.

zhouya2010 avatar May 09 '25 08:05 zhouya2010