production_json.log is missing an entry

Summary

production_json.log is JSON-formatted. This means that it can only hold valid UTF-8. So if I run:

curl https://gitlab.com/gitlab-org/gitlab-ce/info/refs/dturner-bad-utf-8/$(printf '\xff')

Except on my gitlab server instead of yours, I'll see the request in production.log but not production_json.log

Your server says "Your browser sent an invalid request.", which mine doesn't (it does return http 400), so it's possible that whatever proxy is in front of your gitlab server will keep this out of even your production.log file. But I can repro it on my server.

Steps to reproduce

See above.

Results of GitLab environment info

9.5.6-ee

Possible fixes

Use XML or some other format that can hold arbitrary binary data. Or encode URLs somehow. Or configure nginx to reject these requests before they hit production.log. But if you do the latter, what about other cases of non-uft-8 data that might make it into that file? Maybe there aren't any?

Edited Jun 30, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading