[DRE-maint] Bug#968626: gitlab: Error 500 during CI artifacts upload from gitlab-runner

Maximilian Stein m at steiny.biz
Sat Dec 19 18:04:40 GMT 2020


Hi folks,

I just found a workaround for that issue. Apparently, the issue is a
missing type check/type confusion in "etag" (or in the invocation of
this lib). With the patch attached to this mail, artifacts can be
uploaded again.

To debug the issue, I added a begin/resuce block around the failing call
to @app.call in lib/gitlab/middleware/read_only/controller.rb:51 and
dumped the entire stack trace:

          begin
            @app.call(@env)
          rescue NoMethodError => e
            Gitlab::AppLogger.error("Here we are")
            Gitlab::AppLogger.error(e.message)
            e.backtrace.each { |line| Gitlab::AppLogger.error(line) }
          end

The result was dumped into the "application.log" and clearly showed the
origin of the exception:

2020-12-19T15:54:30.166Z: Here we are
2020-12-19T15:54:30.168Z: undefined method `empty?' for 201:Integer
2020-12-19T15:54:30.169Z: /usr/lib/ruby/vendor_ruby/rack/etag.rb:70:in
`block in digest_body'
2020-12-19T15:54:30.169Z:
/usr/lib/ruby/vendor_ruby/rack/body_proxy.rb:34:in `block in each'
2020-12-19T15:54:30.169Z:
/usr/lib/ruby/vendor_ruby/rack/body_proxy.rb:34:in `each'
2020-12-19T15:54:30.170Z:
/usr/lib/ruby/vendor_ruby/rack/body_proxy.rb:34:in `each'
2020-12-19T15:54:30.170Z: /usr/lib/ruby/vendor_ruby/rack/etag.rb:68:in
`digest_body'
2020-12-19T15:54:30.170Z: /usr/lib/ruby/vendor_ruby/rack/etag.rb:31:in
`call'
2020-12-19T15:54:30.170Z:
/usr/lib/ruby/vendor_ruby/rack/conditional_get.rb:40:in `call'
2020-12-19T15:54:30.170Z: /usr/lib/ruby/vendor_ruby/rack/head.rb:14:in
`call'
2020-12-19T15:54:30.171Z:
/usr/share/rubygems-integration/all/gems/actionpack-6.0.3.1/lib/action_dispatch/http/content_security_policy.rb:18:in
`call'
2020-12-19T15:54:30.171Z:
/usr/share/gitlab/lib/gitlab/middleware/read_only/controller.rb:52:in `call'

So, right now, I do have a workaround, although I don't where the
problem is exactly (i.e., in gitlab or in etag) nor how it should be
fixed. I hope this helps debugging the issue further!

Best,
Maximilian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: etag.patch
Type: text/x-patch
Size: 476 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20201219/43a46175/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20201219/43a46175/attachment.sig>


More information about the Pkg-ruby-extras-maintainers mailing list