[DRE-maint] Bug#933961: gitlab: Viewing diff of a commit results in error 500

Claudius Steinhauser cs+debian at koch-aplsystems.de
Mon Aug 5 15:50:46 BST 2019


Package: gitlab
Version: 11.8.10+dfsg-1
Severity: normal

Dear Maintainer,

   * What led up to the situation?

Some update to the unstable packages in the last two weeks

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

This bug is fixed upstream: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/gitaly_client/blob_service.rb
If you take the function get_blobs and just paste it into the current file it works again.

   * What was the outcome of this action?
   * What outcome did you expect instead?

The lines are identical in experimantal so I guess it would fail there too.

rolling back previously updated packages had no effect:
ruby-gitaly:amd64 (1.27.0+dfsg-2, 1.27.2+dfsg-1) -> nope
ruby-nokogiri:amd64 (1.10.0+dfsg1-2, 1.10.3+dfsg1-2) -> nope
ruby2.5:amd64 (2.5.5-3+b1, 2.5.5-4), libruby2.5:amd64 (2.5.5-3+b1, 2.5.5-4) -> nope
ruby-sidekiq:amd64 (5.2.3+dfsg-1, 5.2.7+dfsg-1) -> nope
ruby-pkg-config:amd64 (1.3.4-1, 1.3.7-2) -> nope
ruby-batch-loader:amd64 (1.2.2-1, 1.4.1+dfsg.1-1) -> nope

Here is the full error from production.log:

Started GET "/group/project/commit/b022b4e76636517examplefcf500733c97af52" for IP at 2019-08-05 15:25:16 +0200
Processing by Projects::CommitController#show as HTML
  Parameters: {"namespace_id"=>"group", "project_id"=>"project", "id"=>"##projectid##"}
Completed 500 Internal Server Error in 44ms (ActiveRecord: 8.5ms)

ActionView::Template::Error (can't modify frozen Array):
    24:             %a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
    25:               = sprite_icon(diff_file_changed_icon(diff_file), size: 16, css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon append-right-8")
    26:               %span.diff-changed-file-content.append-right-8
    27:                 - if diff_file.blob&.name
    28:                   %strong.diff-changed-file-name
    29:                     = diff_file.blob.name
    30:                 - else

lib/gitlab/gitaly_client/blob_service.rb:58:in `map!'
lib/gitlab/gitaly_client/blob_service.rb:58:in `get_blobs'
lib/gitlab/git/blob.rb:70:in `batch'
lib/gitlab/git/repository.rb:784:in `batch_blobs'
app/models/repository.rb:530:in `blobs_at'
app/models/blob.rb:84:in `block in lazy'
lib/gitlab/diff/file.rb:136:in `new_blob'
lib/gitlab/diff/file.rb:158:in `blob'
app/views/projects/diffs/_stats.html.haml:27:in `block in _app_views_projects_diffs__stats_html_haml__3454639706286172227_47155273729500'
lib/gitlab/git/diff_collection.rb:43:in `each'
lib/gitlab/git/diff_collection.rb:43:in `each'
app/views/projects/diffs/_stats.html.haml:22:in `_app_views_projects_diffs__stats_html_haml__3454639706286172227_47155273729500'
app/views/projects/diffs/_diffs.html.haml:22:in `_app_views_projects_diffs__diffs_html_haml___304649406669282730_47155274548540'
app/views/projects/commit/show.html.haml:13:in `_app_views_projects_commit_show_html_haml___1524022692417963359_47155277999500'
app/controllers/application_controller.rb:113:in `render'
app/controllers/projects/commit_controller.rb:28:in `block (2 levels) in show'
app/controllers/projects/commit_controller.rb:26:in `show'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:423:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:26:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'

this is the patch I applied to make my gitlab work again:
/usr/share/gitlab/lib/gitlab/gitaly_client # diff -C3 blob_service.new.rb blob_service.old.rb

*** blob_service.new.rb 2019-08-05 16:44:35.140722915 +0200
--- blob_service.old.rb 2019-08-05 16:44:52.800372340 +0200
***************
*** 55,67 ****
        def get_blobs(revision_paths, limit = -1)
          return [] if revision_paths.empty?

!         request_revision_paths = revision_paths.map do |rev, path|
            Gitaly::GetBlobsRequest::RevisionPath.new(revision: rev, path: encode_binary(path))
          end

          request = Gitaly::GetBlobsRequest.new(
            repository: @gitaly_repo,
!           revision_paths: request_revision_paths,
            limit: limit
          )

--- 55,67 ----
        def get_blobs(revision_paths, limit = -1)
          return [] if revision_paths.empty?

!         revision_paths.map! do |rev, path|
            Gitaly::GetBlobsRequest::RevisionPath.new(revision: rev, path: encode_binary(path))
          end

          request = Gitaly::GetBlobsRequest.new(
            repository: @gitaly_repo,
!           revision_paths: revision_paths,
            limit: limit
          )





-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gitlab depends on:
ii  apache2 [httpd]                           2.4.38-3
ii  asciidoctor                               1.5.8-1
ii  bc                                        1.07.1-2+b2
ii  bundler                                   1.17.3-3
ii  bzip2                                     1.0.6-9.2
ii  dbconfig-pgsql                            2.0.11
ii  debconf [debconf-2.0]                     1.5.72
ii  gitlab-common                             11.8.10+dfsg-1
ii  gitlab-workhorse                          7.6.0+debian-1+b21
ii  libjs-pdf                                 1.5.188+dfsg-1
ii  libjs-uglify                              2.8.29-6
ii  lsb-base                                  10.2019051400
ii  nodejs                                    10.15.2~dfsg-2
ii  openssh-client                            1:8.0p1-4
ii  postfix [mail-transport-agent]            3.4.5-1
ii  postgresql-client                         11+203
ii  postgresql-client-11 [postgresql-client]  11.4-1
ii  postgresql-contrib                        11+203
ii  rake                                      12.3.1-3
ii  redis-server                              5:5.0.5-2
ii  ruby                                      1:2.5.1
ii  ruby-ace-rails-ap                         4.1.1-1
ii  ruby-acts-as-taggable-on                  6.0.0-3
ii  ruby-addressable                          2.5.2-1
ii  ruby-akismet                              2.0.0-1
ii  ruby-asana                                0.8.1-2
ii  ruby-asciidoctor-plantuml                 0.0.8-1
ii  ruby-attr-encrypted                       3.1.0-2
ii  ruby-babosa                               1.0.2-2
ii  ruby-base32                               0.3.2-3
ii  ruby-batch-loader                         1.4.1+dfsg.1-1
ii  ruby-bcrypt-pbkdf                         1.0.1-1
ii  ruby-bootstrap-form                       2.7.0-1
ii  ruby-browser                              2.5.3-1
ii  ruby-carrierwave                          1.3.1-2
ii  ruby-charlock-holmes                      0.7.6-1
ii  ruby-chronic                              0.10.2-3
ii  ruby-chronic-duration                     0.10.6-1
ii  ruby-commonmarker                         0.17.9-1
ii  ruby-connection-pool                      2.2.2-1
ii  ruby-creole                               0.5.0-2
ii  ruby-default-value-for                    3.1.1-3
ii  ruby-device-detector                      1.0.1-2
ii  ruby-devise                               4.5.0-3
ii  ruby-devise-two-factor                    3.0.3-2
ii  ruby-diffy                                3.2.1-1
ii  ruby-discordrb-webhooks                   3.3.0-1
ii  ruby-doorkeeper                           4.4.2-1
ii  ruby-doorkeeper-openid-connect            1.5.5-1
ii  ruby-ed25519                              1.2.4-1
ii  ruby-email-reply-trimmer                  0.1.6-1
ii  ruby-escape-utils                         1.2.1-1+b1
ii  ruby-excon                                0.60.0-1
ii  ruby-faraday                              0.15.4-3
ii  ruby-fast-blank                           1.0.0-1+b1
ii  ruby-flipper                              0.13.0-3
pn  ruby-flipper-active-record                <none>
pn  ruby-flipper-active-support-cache-store   <none>
ii  ruby-flowdock                             0.7.1-1
ii  ruby-fog-aliyun                           0.3.2-3
ii  ruby-fog-aws                              3.3.0-5
ii  ruby-fog-core                             2.1.0-3
ii  ruby-fog-google                           1.8.2-2
ii  ruby-fog-local                            0.6.0-1
ii  ruby-fog-openstack                        1.0.8-2
ii  ruby-fog-rackspace                        0.1.6-2
ii  ruby-fogbugz                              0.2.1-3
ii  ruby-font-awesome-rails                   4.7.0.4-1
ii  ruby-fugit                                1.1.8-1
ii  ruby-gemojione                            3.3.0-1
ii  ruby-gettext-i18n-rails                   1.8.0-1
ii  ruby-gettext-i18n-rails-js                1.3.0+dfsg-2
pn  ruby-gitaly-proto                         <none>
ii  ruby-github-markup                        1.7.0+dfsg-2
ii  ruby-gitlab-sidekiq-fetcher               0.4.0-2
ii  ruby-gon                                  6.2.1-1
ii  ruby-google-api-client                    0.28.4-1
ii  ruby-google-protobuf                      3.6.1.3-2
ii  ruby-googleauth                           0.8.0-2
ii  ruby-gpgme                                2.0.18-1
ii  ruby-grape                                1.1.0-2
ii  ruby-grape-entity                         0.7.1-1
ii  ruby-grape-logging                        1.7.0-1
ii  ruby-grape-path-helpers                   1.1.0-1
ii  ruby-graphiql-rails                       1.4.10-1
ii  ruby-graphql                              1.8.4-1
ii  ruby-grpc                                 1.16.1-1
ii  ruby-hamlit                               2.9.2-2
ii  ruby-hangouts-chat                        0.0.5-2
ii  ruby-hashie-forbidden-attributes          0.1.1-1
ii  ruby-health-check                         2.6.0-1
ii  ruby-hipchat                              1.5.2-3
ii  ruby-html-pipeline                        2.8.4-1
ii  ruby-html2text                            0.2.0-1
ii  ruby-httparty                             0.16.2+dfsg1-3
ii  ruby-icalendar                            2.4.1-2
ii  ruby-influxdb                             0.2.3-2
ii  ruby-jira                                 1.5.0-1
ii  ruby-jquery-atwho-rails                   1.5.4+dfsg-1
ii  ruby-js-regex                             3.1.1-1
ii  ruby-kaminari                             1.0.1-4
ii  ruby-kgio                                 2.11.2-1+b1
ii  ruby-kubeclient                           4.3.0-1
ii  ruby-licensee                             8.9.2-1
ii  ruby-lograge                              0.10.0-1
ii  ruby-loofah                               2.2.3-1
ii  ruby-mail-room                            0.9.1-2
ii  ruby-method-source                        0.9.2-1
ii  ruby-mimemagic                            0.3.2+dfsg-1
ii  ruby-mini-magick                          4.9.2-1.1
ii  ruby-nakayoshi-fork                       0.0.4-1
ii  ruby-net-ldap                             0.16.1-1
ii  ruby-net-ssh                              1:5.2.0-1
ii  ruby-nokogiri                             1.10.3+dfsg1-2
ii  ruby-ntlm                                 0.6.1-2
ii  ruby-oauth2                               1.4.1-2
ii  ruby-octokit                              4.13.0-1
ii  ruby-omniauth                             1.8.1-1
ii  ruby-omniauth-auth0                       2.0.0-1
ii  ruby-omniauth-authentiq                   0.3.3-1
ii  ruby-omniauth-azure-oauth2                0.0.10-1
ii  ruby-omniauth-cas3                        1.1.4-2
ii  ruby-omniauth-crowd                       2.4.0-1
ii  ruby-omniauth-facebook                    4.0.0-2
ii  ruby-omniauth-github                      1.3.0-1
ii  ruby-omniauth-gitlab                      1.0.2-1
ii  ruby-omniauth-kerberos                    0.3.0-3
ii  ruby-omniauth-ldap                        2.1.1-1
ii  ruby-omniauth-oauth2-generic              0.2.2-1
ii  ruby-omniauth-saml                        1.10.0-1
ii  ruby-omniauth-shibboleth                  1.3.0-1
ii  ruby-omniauth-twitter                     1.4.0-1
ii  ruby-org                                  0.9.12-2
ii  ruby-parser                               3.11.0-1
ii  ruby-peek                                 1.0.1-1
ii  ruby-peek-gc                              0.0.2-1
ii  ruby-peek-pg                              1.3.0-1
ii  ruby-peek-rblineprof                      0.2.0-1
ii  ruby-peek-redis                           1.2.0-1
ii  ruby-pg                                   1.1.3-3
ii  ruby-posix-spawn                          0.3.13-2+b1
ii  ruby-premailer-rails                      1.9.7-1
ii  ruby-prof                                 0.17.0+dfsg-3+b1
ii  ruby-progressbar                          1.9.0-2
ii  ruby-prometheus-client-mmap               0.9.4-1
ii  ruby-rack                                 2.0.6-3
ii  ruby-rack-attack                          4.4.1-1
ii  ruby-rack-cors                            1.0.2-1
ii  ruby-rack-oauth2                          1.9.2-1
ii  ruby-rack-proxy                           0.6.1-2
ii  ruby-rails                                2:5.2.2.1+dfsg-1
ii  ruby-rails-deprecated-sanitizer           1.0.3-3
ii  ruby-rails-i18n                           5.1.2-2
ii  ruby-rainbow                              3.0.0-2
ii  ruby-raindrops                            0.19.0-1+b2
ii  ruby-rbtrace                              0.4.10-1
ii  ruby-re2                                  1.1.1-2+b3
ii  ruby-recaptcha                            4.11.1-2
ii  ruby-redcarpet                            3.4.0-4+b1
ii  ruby-redcloth                             4.3.2-3+b1
ii  ruby-redis                                3.3.5-1
ii  ruby-redis-namespace                      1.6.0-1
ii  ruby-redis-rails                          5.0.2-3
ii  ruby-request-store                        1.3.0-1
ii  ruby-responders                           2.4.0-3
ii  ruby-rouge                                3.6.0-1
ii  ruby-rqrcode-rails3                       0.1.7-1
ii  ruby-rugged                               0.27.4+ds-1
ii  ruby-sanitize                             4.6.6-2
ii  ruby-sass                                 3.7.4-1
ii  ruby-sass-rails                           5.0.6-2
ii  ruby-seed-fu                              2.3.7-2
ii  ruby-select2-rails                        3.5.9.3-2
ii  ruby-sentry-raven                         2.9.0-1
ii  ruby-settingslogic                        2.0.9-3
ii  ruby-sidekiq                              5.2.7+dfsg-1
ii  ruby-sidekiq-cron                         1.1.0-3
ii  ruby-slack-notifier                       1.5.1-2
ii  ruby-sprockets                            3.7.2-1
ii  ruby-sshkey                               1.9.0-1
ii  ruby-state-machines-activerecord          0.5.1-2
ii  ruby-sys-filesystem                       1.1.7-2
ii  ruby-task-list                            2.0.0-2
ii  ruby-toml-rb                              1.0.0-2
ii  ruby-truncato                             0.7.11-1
ii  ruby-u2f                                  0.2.1-2
ii  ruby-uglifier                             2.7.2+dfsg-2
ii  ruby-unf                                  0.1.4-2
ii  ruby-unf-ext                              0.0.7.5-1
ii  ruby-unicorn-worker-killer                0.4.4-1
ii  ruby-validates-hostname                   1.0.7-1
ii  ruby-version-sorter                       2.2.4-1
ii  ruby-virtus                               1.0.5-3
ii  ruby-vmstat                               2.3.0-2+b1
ii  ruby-webpack-rails                        0.9.11+git-1
ii  ruby-wikicloth                            0.8.1+dfsg-4
ii  ruby-zip                                  1.2.2-1
ii  ucf                                       3.0038+nmu1
ii  unicorn                                   5.4.1-2
ii  yarnpkg                                   1.13.0-1

Versions of packages gitlab recommends:
pn  certbot  <none>
ii  gitaly   1.20.0+debian-1+b1

gitlab suggests no packages.

-- Configuration Files:
/etc/default/gitlab changed [not included]
/etc/gitlab/initializers/active_record_verbose_query_logs.rb [Errno 2] No such file or directory: '/etc/gitlab/initializers/active_record_verbose_query_logs.rb'
/etc/gitlab/initializers/smtp_settings.rb changed [not included]
/etc/gitlab/unicorn.rb [Errno 2] No such file or directory: '/etc/gitlab/unicorn.rb'

-- debconf information excluded



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