LoginSignup
23
12

More than 5 years have passed since last update.

今年、遭遇したBigQueryのエラーログを愛でる

Posted at

私は去年の暮れから(2015年12月)BigQueryの導入を行い、結果導入し活用を行なってきました。

その中で遭遇した数々のエラーログ達を愛でながら、どういった形で対応を行なったか振り返りたいと思います。

BigQueryへの接続は
https://github.com/google/google-api-php-client
を使用して実装を行なっています。その為、皆様の使っている環境とは微妙に返却されるエラーが違っている可能性もあります。
また、BigQueryは常に進化しています。私が遭遇した事柄も、もうBigQueryは対応し再現しないかもしれません。
エラーが発生した日時はそのままにしておりますがプロジェクト名、プログラム名などは置き換えてありますのでその旨、ご了承ください。

使用したプログラムは1時間に一度、集計処理を行うようなイメージを持って頂ければと。

以下が2016年、僕を沸かせてくれたログたちになります。

Datasetが404 Not Found


ALERT 2016-08-25 18:00:06 --> 404: Not found: Dataset projectId:dataset - sampleProgram - line:xxx

そのままですね、Datasetが404 Not Foundとなりました。
実際にDatasetが無いのか?
というとそんな事はなくDatasetを作った直後にAPIを経由して問い合わせを行うとこのエラーに遭遇するという事がありました。

  • 対応策
    • 3分程度待ってからリトライする

Tableが404 Not Found


ALERT 2016-08-25 18:30:10 --> notFound: Not found: Table projectId:dataset.table - sampleProgram - line:xxx

今度はTableの404ですね。
これも実際にTableが存在しないのか?
というとそんな事はなく、何故かたまに404が返却される時があるようです。

  • 対応策
    • ちょっとだけ待ってからリトライする(10秒程度)

Tableが既に存在している


ALERT 2016-08-30 18:59:09 --> 409: Already Exists: Table projectId:dataset.table - sampleProgram - line:xxx

既にテーブルが存在していると言われた。テーブルが本当に存在している時に言われるのは正しいのですが
テーブルを同じ名前で消したり作ったりを早い頻度で繰り返すと、テーブルが無いのにこのエラーに遭遇する事があったように思います。

  • 対応策
    • ちょっとだけ待ってからリトライする

BigQueryで何かが起きている


ALERT 2016-09-02 04:31:41 --> {  "error": "internal_failure",  "error_description": "Backend Error" }  - sampleProgram - line:xxx
ALERT 2016-09-02 18:32:37 --> backendError: Error encountered during execution. Retrying may solve the problem. - sampleProgram - line:xxx
ALERT 2016-09-09 09:30:08 --> 500: Internal Error - sampleProgram - line:xxx
ALERT 2016-09-14 00:37:21 --> 500: Backend Error - sampleProgram - line:xxx
ALERT 2016-09-14 02:31:05 --> 503: Error encountered during execution. Retrying may solve the problem. - sampleProgram - line:xxx
ALERT 2016-10-17 22:21:34 --> 500: An internal error occurred and the request could not be completed. - sampleProgram - line:xxx

何パターンか種類があるのですがいずれもBigQueryに何かが起きてエラーになってるようです。

  • 対応策
    • 気にせずリトライする

何かが間違っている


ALERT 2016-10-20 14:32:05 --> tableUnavailable: Something went wrong with the table you queried. Contact the table owner for assistance. - sampleProgram - line:xxx
ALERT 2016-11-09 09:30:18 --> tableUnavailable: Something went wrong with the table you queried. Contact the table owner for assistance. - sampleProgram - line:xxx

このエラーはオーナーに連絡してとか言われてますがそんなこと言われてもオーナー自分だし・・・・
って感じですね。対応も何もしていませんしリトライすればエラーは発生しませんでした。

  • 対応策
    • 気にせずリトライする

返却されるデータ量が多すぎると言われた


ALERT 2016-12-08 17:03:15 --> responseTooLarge: Response too large to return. Consider setting allowLargeResults to true in your job configuration. For more details, see https://cloud.google.com/bigquery/querying-data#largequeryresults - sampleProgram - line:xxx

返却されるデータ量が大きすぎてエラーになりました。
allowLargeResultsを許可する事でこのエラーは回避出来ます。
ただ、溶かした顔をしたくないのでデフォルトで許可する運用はしたくないので悩ましいですね。

  • 対応策
    • allowLargeResultsを許可する

一年使ってみて思う事


まとめてしまうと大体の場合において、ちょっと待ってリトライすればエラーは解決します。
RDBとは違いますしエラーもそれなりに起きるのですが、やはりBigQueryは素晴らしいマネージドサービスです。

主に今年の夏から12月初頭に発生した、エラーログについて取り上げさせて貰いました。
今年はGCPと過ごした1年でしたが来年もGCPと一緒に過ごす1年になりそうです。

皆様も素敵なGCP、BigQuery生活をお過ごしくださいませ。

23
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
12