Skip to content

Geo: Investigate problems with upload records for designs

Problem

Design replication itself works but when I upload designs, a special upload record is created:

=> #<Upload:0x00000001374bf158
 id: 1,
 size: 8123,
 path:
  "uploads/-/system/design_management/action/image_v432x230/1/80f95bbf062367502ed58b093b6ff8fae026af0090721e3be5383a351abc",
 checksum: "0526ebc9bf05ad998cf0829391d521cc1d82fc9c5b6bc8a02f67ab5783980649",
 model_id: 1,
 model_type: "DesignManagement::Action",
 uploader: "DesignManagement::DesignV432x230Uploader",
 created_at: Tue, 19 Apr 2022 17:00:02.649883000 UTC +00:00,
 store: 1,
 mount_point: "image_v432x230",
 secret: nil,
 verification_checksum: nil>

it can not be verified on primary because the exception is raised Error during verification: undefined method 'underscore' for NilClass:Class. That happens because model is not set in https://gitlab.com/gitlab-org/gitlab/blob/2a8f6990d08816871f493b793b264db018aafb1f/app/uploaders/design_management/design_v432x230_uploader.rb#L42:

    def dynamic_segment
      File.join(model.class.underscore, mounted_as.to_s, model.id.to_s)
    end

Steps to reproduce

Upload designs on the primary.

Proposal

Investigate the reason and find the solution.

Edited by Valery Sizov