Repository navigation
Conversation
A commit (or branch/tag name) containing invalid UTF-8 made Concourse fail to marshal the resource metadata into gRPC labels: set label: grpc: error while marshaling: string field contains invalid UTF-8 The metadata fields derived from git (author, committer, message, branch, tags, tag) are now passed through `iconv -f UTF-8 -t UTF-8 -c` before jq, so invalid bytes are dropped rather than passed through verbatim (or replaced with U+FFFD by jq, which is version-dependent). glibc-iconv provides iconv in the resource image. Adds a unit test and an end-to-end test covering a commit, branch and tag that carry invalid UTF-8.
|
@kurtmc what version of Concourse are you on? Since this issue could affect any resource I prefer trying to fix it in |
|
@taylorsilva we're on v8.2.3 |
|
I'll look into reproducing this issue in the docker compose setup of concourse, so we have a concrete example to look at. |
|
That would be awesome, thank you! |
|
Another idea, since it's fine if we reproduce this with the git resource: can you push a commit that contains the offending string to a public repo somewhere? Maybe fork https://github.com/concourse/examples and add a commit that causes this error. I recall having quite a time trying to reproduce this since most tools don't let you write non-utf-8 strings now. |
|
Gave my idea a quick try but no luck reproducing: concourse/examples@main...non-utf8
not sure where else to sneak in a non-utf8 character 😕 Hope you can figure out how to reproduce this. |
|
@taylorsilva I've reproduced the issue locally, and pushed a commit to my examples fork: https://github.com/kurtmc/examples/tree/utf8-emdash-repro |
|
The issue is here: https://github.com/concourse/concourse/blob/v8.2.3/worker/runtime/properties.go#L43-L49 The byte slice ( |
|
Closing the PR, as this is an issue in concourse/concourse. |


It's possible for invalid UTF-8 characters to get into commit message so we are seeing the following error in production. I've added a sanitise step to elimite this issue.
