Gitlab::Ci::Parsers::Security::Common::SecurityReportParserError: JSON parsing failed
https://sentry.gitlab.net/gitlab/gitlabcom/issues/2739044/?referrer=gitlab_plugin
Oj::ParseError: unexpected character () at line 1, column 2 [parse.c:714]
gitlab/json.rb:85:in `load'
Oj.load(string, opts)
gitlab/json.rb:85:in `adapter_load'
Oj.load(string, opts)
gitlab/json.rb:25:in `parse'
data = adapter_load(string, **opts)
gitlab/ci/parsers/security/common.rb:58:in `report_data'
@report_data ||= Gitlab::Json.parse!(json_data)
gitlab/ci/parsers/security/concerns/deprecated_syntax.rb:19:in `report_data'
data = super
...
(103 additional frame(s) were not displayed)
JSON::ParserError: unexpected character () at line 1, column 2 [parse.c:714]
gitlab/json.rb:87:in `rescue in adapter_load'
raise parser_error, ex
gitlab/json.rb:82:in `adapter_load'
def adapter_load(string, *args, **opts)
gitlab/json.rb:25:in `parse'
data = adapter_load(string, **opts)
gitlab/ci/parsers/security/common.rb:58:in `report_data'
@report_data ||= Gitlab::Json.parse!(json_data)
gitlab/ci/parsers/security/concerns/deprecated_syntax.rb:19:in `report_data'
data = super
...
(103 additional frame(s) were not displayed)
Gitlab::Ci::Parsers::Security::Common::SecurityReportParserError: JSON parsing failed
gitlab/ci/parsers/security/common.rb:35:in `rescue in parse!'
raise SecurityReportParserError, 'JSON parsing failed'
gitlab/ci/parsers/security/common.rb:21:in `parse!'
def parse!
gitlab/ci/parsers/instrumentation.rb:13:in `block in parse!'
parser_result = super
benchmark.rb:308:in `realtime'
yield
gitlab/ci/parsers/instrumentation.rb:12:in `parse!'
duration = Benchmark.realtime do
...
(99 additional frame(s) were not displayed)
JSON parsing failed
Implementation plan
TBC
My guess is that we need to rescue SecurityReportParserError
in the relevant perform
methods and set the sidekiq job status to done
instead of letting the parent error handle slap a fail
on it.
Edited by Thiago Figueiró