Missing error handling on json.Unmarshal inside MySQL Row Iteration
@vedant21-oss is already working on this.
Since Apr 27, 2026.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
Description
In the MySQL Datastore implementation, rowDataConverter.Data() blindly ignores the error returned by json.Unmarshal(jsonRaw, &obj).
If the datastore retrieves a malformed JSON slice or truncated bytes from MySQL, json.Unmarshal fails silently. Consequently, the function returns an empty or partially populated map. This leads to silent logic errors and "ghost bugs" down the pipeline instead of throwing an explicit error.
Code Context
https://github.com/pipe-cd/pipecd/blob/master/pkg/datastore/mysql/iterator.go#L86
Proposed Fix
Update the compiling interface (dataConverter) to return (map[string]interface{}, error) and bubble the failure up to the Iterator.Next() trace. I am raising a PR for this shortly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.