1 من 16551 تحميل لم يتم ترحيلها إلى S3. فشل ترحيل S3 لقاعدة البيانات 'default'

,

حسنًا، تم إصلاح هذه المشكلة الآن! إليك كيف فعلت ذلك (بمساعدة كبيرة من أرتور من منتدانا)

في 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 قمت ببساطة بتدمير التحميل الإشكالي. الآن لدي مشكلة مع

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

لكن أعتقد أنني واجهت مشكلة أكبر - الأصول بعد تجميعها لا يتم تحميلها إلى حاوية S3:

من الواضح أنه يجب أن يكون هناك مجلد للأصول ولكن لا يوجد أي منها. هذا شيء يمنعني من وضع شبكة توصيل المحتوى (CDN) أمام كل شيء، ولكن أعتقد أن هذه مشكلة أخرى، لموضوع مختلف؟

4 إعجابات

للملفات التي تم تغييرها:

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

حصلت على ثلاثة معرفات ثم ذهبت إلى https://example.com/p/ID وحذفتها من واجهة المستخدم. ثم سارت الأمور بسلاسة!

3 إعجابات

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.