fatal: protocol error: bad line length 2210commit b157c973280ccadb739f08bb6283d580241ec459
Author: FIRSTNAME LASTNAME <yulLASTNAME@company.com>
Date: Wed Sep 12 18:29:40 2018 -0700
<change://problem/12435467>Clang-1001 failed to build Driver [CLONED_FROM_milestone]
[Problem]
enable repword support for com driver
[Root Cause]
enable repword support for com driver
[Scenario/Frequency]
always
[Description of Change]
enable repword support for com driver
[Platforms Impacted]
ABC
[Memory/Performance/Power/Security Impact]
Low
[Dependencies]
None
[Risks]
Low
[Test Method]
Tested
Change-Id: I51a54859892a7e2c087d654ca16e882d55e67c4b
Reviewed-on: https://tech-gerrit.sd.company.com/17226
Reviewed-by: FIRSTNAME3 LASTNAME3 <usernam3@company.com>
Build-OSX: service account<service@company.com>
Tested-by: FIRSTNAME LASTNAME <FIRSTNAME_LASTNAME@company.com>
Reviewed-on: https://tech-gerrit.sd.company.com/12345 Tested-by: FIRSTNAME2 LASTNAME2 <FIRSTNAME2_LASTNAME2@company.com>HiI am trying to push a commit and running into below error,i looked at other posts and but couldn't find anything specific to what the code 2210 means,our developers are clueless about this error,any guidance on how to debug or fix this error?fatal: protocol error: bad line length 2210
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
HiI am trying to push a commit and running into below error,i looked at other posts and but couldn't find anything specific to what the code 2210 means,our developers are clueless about this error,any guidance on how to debug or fix this error?fatal: protocol error: bad line length 2210
Create a simple ref-update hook that simply runs:
#!/usr/bin/env python
raise SystemExit('z'*5+'oops'+'z'*(65536-5))
(i.e. print 'zzzzzoops' plus 65531 more z characters. You can replace 'z' with anything else. All that matters is the combination of the length being more than 65535 and the position of the oops relative to how much more the length is than 65535). Then when you try to push to the repo, you'll be greeted by:
$ git push origin HEAD:refs/for/master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 308 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1)
remote: Processing changes: refs: 1, done
fatal: protocol error: bad line length character: oops
I could replace 'oops' in "fatal: protocol error: bad line length character: oops" with any other four-character string by just modifying my little python script appropriately.
How does this happen? Messages sent with the git protocol are sent in a packetized stream, with each git-packet being prefixed by the length of the packet. The prefix is always a 4-hex-digit length, with as many leading 0's in the length as necessary. So the longest single message that can be sent in a git-packet is 16**4 = 65536 bytes.
Technically the fact that a protocol error is displayed is a bug in gerrit (if you send a really huge message in a pre-receive hook, git breaks it up correctly and transfers it to the other side. gerrit must do some kind of two-byte math in calculating the length and not check for overflow). It should have instead shown the ridiculously long message and then we would have quickly found the bug in our hook. But it's hard to blame gerrit because who'd be dumb enough to print that much output in an error message? (Other than me?)