File secret source silently ignores secrets after a line over 64 KiB
Author: Indra55Created Sep 25, 2026Updated Sep 27, 2026
Labelsbugtriage
Brief summary
A valid key=value line over 64 KiB stops the file secret source from reading the rest of the file. Source initialization succeeds, but later secrets are missing. The scanner error is not checked.
k6 version
k6 v2.0.0-20260925085912-20394f8f3736 (commit/20394f8f37, go1.27.1-X:nodwarf5, linux/amd64)
OS
Arch Linux
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Here is the formatted reproduction guide:
- Create the secrets file with a valid 70 KB value followed by another secret:
python3 -c 'from pathlib import Path; Path("/tmp/secrets.file").write_text("first=ok\nlarge=" + "x"*70000 + "\ntail=present\n")'
- Save this script as
/tmp/repro.js:
import secrets from 'k6/secrets';
export default async function () {
console.log('first length:', (await secrets.get('first')).length);
console.log('tail length:', (await secrets.get('tail')).length);
}
- Run the test:
k6 run --quiet --vus 1 --iterations 1 \
--secret-source=file=/tmp/secrets.file /tmp/repro.jsExpected behaviour
Both first and tail should be available. If a line-size limit is intentional, k6 should instead reject the file during source initialization with a clear error; it should not silently load only part of the file.
Actual behaviour
The source initializes and first is available, but retrieving tail fails:
level=info msg="first length: 2"
level=error msg="Uncaught (in promise) no value"Source: grafana/k6