orbitalci / orbital

Orbital is a self-hosted CI system for solo/small consulting dev teams. Written in Rust.
GNU General Public License v3.0
29 stars 2 forks source link

Buffer for info channel during Docker build is smaller than the configured max token #204

Closed tjtelan closed 4 years ago

tjtelan commented 5 years ago

Output from ocelot logs OCELOT | BY THE WAY SOMETHING WENT WRONG SCANNING STAGE INPUT

Output in werker logs

Mar 01 00:50:40 werker-new-doo-4 werker[769]: {"function":"github.com/shankj3/ocelot/build/builder/docker.(*Docker).writeToInfo","level":"debug","msg":"finished writing to channel for stage BUILD | ","time":"2019-03-01T00:50:40Z"}
Mar 01 00:50:40 werker-new-doo-4 werker[769]: {"error":"bufio.Scanner: token too long","function":"github.com/shankj3/ocelot/build/builder/docker.(*Docker).writeToInfo","level":"error","msg":"error outputing to info channel!","time":"2019-03-01T00:50:40Z"}
tjtelan commented 5 years ago

Snippet from docker.writeToInfo()

buf := make([]byte, 0, 64*1024)
scanner.Buffer(buf, 1024*1024)

This error happens because our buffer slice is 64 bytes, but we configure the max length of a token to be 1024 bytes, which is not surprising when the buffer overflows.