Skip to content

fix: split container property labels on rune boundaries - #9602

Merged
taylorsilva merged 1 commit into
concourse:masterfrom
kurtmc:fix/utf8-split
Jun 16, 2026
Merged

taylorsilva merged 1 commit into
concourse:masterfrom
kurtmc:fix/utf8-split

Conversation

@kurtmc

@kurtmc kurtmc commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Property values over containerd's 4096-byte label limit are split into multiple labels. The split used a raw byte offset, so a multi-byte UTF-8 rune straddling the boundary was bisected, leaving a chunk that is invalid UTF-8. containerd then rejects it ("set label: grpc: error while marshaling: string field contains invalid UTF-8"), erroring the build.

Back the chunk boundary off to the nearest rune start before slicing.

Discussion from closed git-resource PR: concourse/git-resource#475

Property values over containerd's 4096-byte label limit are split into
multiple labels. The split used a raw byte offset, so a multi-byte UTF-8
rune straddling the boundary was bisected, leaving a chunk that is invalid
UTF-8. containerd then rejects it ("set label: grpc: error while marshaling:
string field contains invalid UTF-8"), erroring the build.

Back the chunk boundary off to the nearest rune start before slicing.

Signed-off-by: Kurt McAlpine <[email protected]>
@kurtmc
kurtmc requested a review from a team June 15, 2026 22:44
@kurtmc kurtmc added the bug label Jun 15, 2026

@taylorsilva taylorsilva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I verified that the test fails when commenting out the new code. Thanks for figuring this out and making a PR Kurt! I'm shipping 8.2.4 tomorrow so I'll get this in that release.

@taylorsilva
taylorsilva merged commit 5afccf2 into concourse:master Jun 16, 2026
11 checks passed
@taylorsilva taylorsilva added this to the v8.2.4 milestone Jun 16, 2026
@taylorsilva taylorsilva mentioned this pull request Jun 16, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants