YouTube Data API set_thumbnail generates error – failedPrecondition: Precondition check failed

I’ve been using the YouTube Data API v3/Google APIs Client Library for Ruby for over a year now to upload, update and delete videos automatically. I frequently receive errors from the API when trying to set the thumbnail image for a video right after it has been uploaded (something about a rate limit being exceeded and having to check some quota), but I am always well under the service quotas, there is no mention of the error in the documentation, and resubmitting the thumbnail always goes through so I just resubmit the thumbnail as needed. Most of the time everything works as expected.

Today, however, every time a video has been uploaded and a thumbnail was submitted, I’ve gotten a new error: failedPrecondition: Precondition check failed

This time, the error happens every time, and resubmitting does not help at all. Nothing has changed recently in my code, and everything else (uploading the video and the description) works as usual, so it does not seem to be a problem with authentication or a bad request. The images are small (less than 100K).

There is no mention of this exception in the Google developer documentation, so there is no way to know what could be wrong.

The code simply does a service.set_thumbnail(vid, upload_source: file), where vid is the YouTube ID of the video and file is the path to the image file. Again, this was working a couple of days ago.

The exception returned is:

failedPrecondition: Precondition check failed.

/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:239:in `check_status'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/api_command.rb:135:in `check_status'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:202:in `process_response'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/upload.rb:174:in `process_response'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/upload.rb:259:in `execute_once'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:126:in `block (2 levels) in do_retry'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:123:in `block in do_retry'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:113:in `do_retry'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/http_command.rb:104:in `execute'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.1/lib/google/apis/core/base_service.rb:418:in `execute_or_queue_command'
/home/uploader/local/ruby-3.2.1/lib/ruby/gems/3.2.0/gems/google-apis-youtube_v3-0.6.0/lib/google/apis/youtube_v3/service.rb:3262:in `set_thumbnail'
/home/uploader/rails/app/controllers/concerns/youtube_handler.rb:63:in `block in set_thumbnail'
/home/uploader/rails/app/controllers/concerns/youtube_handler.rb:62:in `open'
/home/uploader/rails/app/controllers/concerns/youtube_handler.rb:62:in `set_thumbnail'

It looks like the library code tries three times to upload the image and gives up.

Has anyone encountered this error?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật