Shrine

Migration of shrine from refile failed

hi

I am using 3.4 of shrine.

Migration of shrine from refile failed.

I followed the documentation and tried, but the migration failed with an error.

The following error occurs when attacher = Shrine::Attacher.from_model(self, name).

Shrine::Error: {} isn't valid uploaded file data
from /bundle/gems/shrine-3.4.0/lib/shrine/uploaded_file.rb:40:in `initialize'

I retrieved the state of Attacher just before the error occurred and found the following.

[2] pry(#<Shrine::Attacher>)> self
=> #<Shrine::Attacher:0x00007f95f6eeb108
 @cache=:cache,
 @column_serializer=Shrine::Plugins::Column::JsonSerializer,
 @context=
  {:record=>
    #<ReferralLetterFileUpload:0x00007f95f6d3b948
     id: 1,
     image_id: "49f7879cd24ec31dfab325a4bb6c4c02e4589357d056ef3e295346d3997e",
     image_filename: "sample.pdf",
     image_size: 169273,
     image_content_type: "application/pdf",
     referral_letter_id: 5,
     resource_type: nil,
     created_at: Mon, 14 Mar 2022 12:09:38 JST +09:00,
     updated_at: Tue, 15 Mar 2022 12:29:31 JST +09:00,
     image_data: nil>,
   :name=>:image},
 @errors=[],
 @file=nil,
 @model=true,
 @model_cache=true,
 @name=:image,
 @previous=nil,
 @record=
  #<ReferralLetterFileUpload:0x00007f95f6d3b948
   id: 1,
   image_id: "49f7879cd24ec31dfab325a4bb6c4c02e4589357d056ef3e295346d3997e",
   image_filename: "sample.pdf",
   image_size: 169273,
   image_content_type: "application/pdf",
   referral_letter_id: 5,
   resource_type: nil,
   created_at: Mon, 14 Mar 2022 12:09:38 JST +09:00,
   updated_at: Tue, 15 Mar 2022 12:29:31 JST +09:00,
   image_data: nil>,
 @store=:store>

How can this be resolved in this case?