16551개 업로드 중 1개가 S3로 마이그레이션되지 않았습니다. 'default' DB의 S3 마이그레이션 실패

,

좋아요, 이제 이 문제가 수정되었습니다! Artur(우리 포럼에서)의 엄청난 도움 덕분에 이렇게 해결했습니다.

to_s3_migration.rb 파일에서 이 부분을:

count = Upload.by_users.where("url NOT LIKE '#{base_url}%'").count
      if count > 0
        error_message =
          "#{count} of #{Upload.count} uploads are not migrated to S3. #{failure_message}"
        raise_or_log(error_message, should_raise)
        success = false
      end

다음과 같이 변경했습니다:

count = Upload.by_users.where("url NOT LIKE '#{base_url}%'").count
      if count > 0
        failed_uploads = Upload.by_users.where("url NOT LIKE '#{base_url}%'")
        failed_ids = failed_uploads.map(&:id)
        failed_id_list = failed_ids.join(", ")
        error_message =
          "#{count} of #{Upload.count} uploads are not migrated to S3. \n List of failed IDs: \n #{failed_id_list}; #{failure_message}"
        raise_or_log(error_message, should_raise)
        success = false
      end

그 후 rails 콘솔에서 문제 있는 업로드를 삭제(destroy)했습니다. 이제 다음과 같은 문제가 발생했습니다:

FileStore::ToS3MigrationError: 3 posts are not remapped to new S3 upload URL. S3 migration failed for db 'default'.

하지만 더 큰 문제에 직면한 것 같습니다 - 컴파일된 에셋이 S3 버킷에 업로드되지 않고 있습니다:

분명히 asset 폴더가 있어야 하는데 하나도 없습니다. 이것은 CDN을 모든 것 앞에 배치하는 것을 막고 있는 것인데, 이건 다른 문제라 다른 주제에서 다뤄야 하지 않을까 싶습니다?

변경된 파일:

count = Post.where("cooked LIKE '%#{cdn_path}%'").count
      if count > 0
        failed_posts = Post.where("cooked LIKE '%#{cdn_path}%'")
        id_list = failed_posts.map(&:id).join(", ")
        error_message = "#{count} posts are not remapped to new S3 upload URL. \n List of failing posts: \n #{id_list} \n #{failure_message}"
        raise_or_log(error_message, should_raise)
        success = false
      end

다음으로 변경:

count = Post.where("cooked LIKE '%#{cdn_path}%'").count
      if count > 0
        failed_posts = Post.where("cooked LIKE '%#{cdn_path}%'")
        failed_ids = failed_posts.map(&:id).join(", ")
        failed_id_list = failed_ids.join(", ")
        error_message = "#{count} posts are not remapped to new S3 upload URL. \n List of failing posts: \n #{failed_id_list} \n #{failure_message}"
        raise_or_log(error_message, should_raise)
        success = false
      end

세 개의 ID를 확인한 후 https://example.com/p/ID 로 이동하여 UI에서 삭제했습니다. 그 후 모든 것이 순조롭게 진행되었습니다!