pipe-cd / pipe-cd/pipecd

Missing error handling on json.Unmarshal inside MySQL Row Iteration

Open
#6,699 0 comments 0 reactions 1 assignee View on GitHub

@vedant21-oss is already working on this.

Since Apr 27, 2026.

area/datastore type/bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.