ユーザー定義のビジネス ルールに基づいて、電子メールの添付ファイルを自動的にインデックスに登録し、Google ドライブに直接保存するウェブ アプリを作成しました。一部の Google ドライブ アカウントの同期中にエラーが発生し、何が問題なのかを特定できません。
これはエラーです:
リスト ファイル エラー: バックエンド エラー /mnt/opt/openera/current/app/models/cloud_account/google_drive.rb:299:in 'list_files' /mnt/opt/openera/current/app/models/cloud_account/google_drive.rb: 220: 'do_discover_files' で /mnt/opt/openera/current/app/models/cloud_account/base.rb:304: 'discover_files' で /mnt/opt/openera/current/app/workers/worker/file_synchronizer.rb: 10:in 'perform' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/processor.rb:45:in 'block (3 レベル)処理中' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/chain.rb:109:in 'call' /mnt/opt /openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/chain.rb:109:in 'voke でブロック'/mnt/opt/openera/current/lib/sidekiq_repeat_jobs/middleware/server/repeat_jobs.rb:36:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq- 2.6.5/lib/sidekiq/middleware/chain.rb:111:in 'ブロックイン voke' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/ lib/sidekiq/middleware/server/timeout.rb:14:in 'cal l' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/ middleware/chain.rb:111: in 'block in in voke' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/server/ active_record.rb:6:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/chain.rb:111:in 「voke でブロック」/mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/server/retry_jobs.rb:49:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq -2.6.5/lib/sidekiq/middleware/chain.rb:111:in 'ブロックイン voke' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5 /lib/sidekiq/middleware/server/logging.rb:11:in 'block in call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib /sidekiq/logging.rb:22:in 'with_context' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/server/logging. rb:7:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/chain.rb:111:in 'block in in voke' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware/chain.rb:114:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/middleware /chain.rb:114:in 'invoke' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/processor.rb:44:in 'ブロック (2 レベル) 処理中' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/processor.rb:80:in 'stats' / mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/sidekiq-2.6.5/lib/sidekiq/processor.rb:43:「ブロック中」/mnt/opt/openera/current /vendor/bundle/ruby/1.9.1/gems/celluloid-0.12.4/lib/celluloid/calls.rb:23:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9. 1/gems/celluloid-0.12.4/lib/celluloid/calls.rb:23:in 'public_send'/mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/celluloid-0.12.4/lib/celluloid/calls.rb:23:in 'dispatch' /mnt/opt/openera/current/ vendor/bundle/ruby/1.9.1/gems/celluloid-0.12.4/lib/celluloid/future.rb:18:in 'block in initiali ze' /mnt/opt/openera/current/vendor/bundle/ruby/ 1.9.1/gems/celluloid-0.12.4/lib/celluloid/internal_pool.rb:48:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/celluloid-0.12 .4/lib/celluloid/internal_pool.rb:48:in 'block in create'rb:48:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/celluloid-0.12.4/lib/celluloid/internal_pool.rb:48:in 'block in c言う」rb:48:in 'call' /mnt/opt/openera/current/vendor/bundle/ruby/1.9.1/gems/celluloid-0.12.4/lib/celluloid/internal_pool.rb:48:in 'block in c言う」
更新: これがシニア開発者からの実際のコードです。
dev here (ffoeg) 呼び出した実際のコードを追加:
def list_files
pageToken = nil
params = {'maxResults' => 65535, 'q' => 'trashed = false'}
files = []
drive = session.discovered_api("drive", "v2")
while true do
call_params = pageToken.blank? ? params : params.merge('pageToken' => pageToken)
result = session.execute(api_method: drive.files.list, parameters: call_params)
if result.status == 200
files += result.data.items
break if result.data['nextPageToken'].blank?
pageToken = result.data['nextPageToken']
else
raise "List Files Error: #{result.data['error']['message']}"
end
end
files
end
再度更新:
正確なエラーを取得するためにコードを更新しました。
List Files Error: {"errors"=>[{"domain"=>"global", "reason"=>"backendError",
"message"=>"Backend Error"}], "code"=>503, "message"=>"Backend Error"}