Skip to content

JSON::ParserError: A JSON text must at least contain two octets!

I think this issue may have been introduced by 74520f23 . In this case, build.status is failed. Is

/cc: @ayufan

-Stan

https://sentry.gitlap.com/gitlab/gitlabcom/issues/5046/

JSON::ParserError: A JSON text must at least contain two octets!
  lib/ci/ansi2html.rb:199:in `restore_state'
    state = JSON.parse(state, symbolize_names: true)
  lib/ci/ansi2html.rb:93:in `convert'
    restore_state(raw, new_state) if new_state
  lib/ci/ansi2html.rb:27:in `convert'
    Converter.new.convert(ansi, state)
  app/models/ci/build.rb:102:in `trace_with_state'
    trace_with_state = Ci::Ansi2html::convert(trace, state) if trace.present?
  app/controllers/projects/builds_controller.rb:44:in `block (2 levels) in trace'
    render json: @build.trace_with_state(params[:state]).merge!(id: @build.id, status: @build.status)
...
(104 additional frame(s) were not displayed)